From 54ecc001f4490a4c67dc896153661b91214a69b9 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Fri, 17 Mar 2023 20:08:31 +0800 Subject: [PATCH] Clean up more codes --- README.MD | 2 +- .../magisk/widget/ConcealableBottomNavigationView.java | 10 ---------- docs/guides.md | 2 +- native/src/Android.mk | 2 -- native/src/zygisk/loader.c | 5 +---- scripts/avd_magisk.sh | 2 +- scripts/avd_patch.sh | 2 +- scripts/flash_script.sh | 2 +- .../java/com/topjohnwu/magisk/DownloadActivity.java | 2 +- stub/src/main/java/com/topjohnwu/magisk/DynLoad.java | 2 +- 10 files changed, 8 insertions(+), 23 deletions(-) diff --git a/README.MD b/README.MD index 4b64c27dd..0f948275d 100644 --- a/README.MD +++ b/README.MD @@ -6,7 +6,7 @@ ## Introduction -Magisk is a suite of open source software for customizing Android, supporting devices higher than Android 5.0.
+Magisk is a suite of open source software for customizing Android, supporting devices higher than Android 6.0.
Some highlight features: - **MagiskSU**: Provide root access for applications diff --git a/app/src/main/java/com/topjohnwu/magisk/widget/ConcealableBottomNavigationView.java b/app/src/main/java/com/topjohnwu/magisk/widget/ConcealableBottomNavigationView.java index 2d6b2d82a..93c4c985e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/widget/ConcealableBottomNavigationView.java +++ b/app/src/main/java/com/topjohnwu/magisk/widget/ConcealableBottomNavigationView.java @@ -23,8 +23,6 @@ public class ConcealableBottomNavigationView extends BottomNavigationView { }; private boolean isHidden; - private int lastHeight = -1; - public ConcealableBottomNavigationView(@NonNull Context context) { this(context, null); } @@ -42,14 +40,6 @@ public class ConcealableBottomNavigationView extends BottomNavigationView { } private void recreateAnimator(int height) { - if (lastHeight == height) return; - lastHeight = height; - - // End the current animation before setting a new one - // otherwise it crashes on Android 5.0 - StateListAnimator lastAnimator = getStateListAnimator(); - if (lastAnimator != null) lastAnimator.jumpToCurrentState(); - Animator toHidden = ObjectAnimator.ofFloat(this, "translationY", height); toHidden.setDuration(175); toHidden.setInterpolator(new FastOutLinearInInterpolator()); diff --git a/docs/guides.md b/docs/guides.md index b13134a84..39e62b80c 100644 --- a/docs/guides.md +++ b/docs/guides.md @@ -178,7 +178,7 @@ The `customize.sh` script runs in Magisk's BusyBox `ash` shell with "Standalone - `ZIPFILE` (path): your module's installation zip - `ARCH` (string): the CPU architecture of the device. Value is either `arm`, `arm64`, `x86`, or `x64` - `IS64BIT` (bool): `true` if `$ARCH` is either `arm64` or `x64` -- `API` (int): the API level (Android version) of the device (e.g. `21` for Android 5.0) +- `API` (int): the API level (Android version) of the device (e.g. `23` for Android 6.0) ##### Functions diff --git a/native/src/Android.mk b/native/src/Android.mk index c68e1c0d9..3e331d05b 100644 --- a/native/src/Android.mk +++ b/native/src/Android.mk @@ -126,7 +126,6 @@ ifdef B_POLICY include $(CLEAR_VARS) LOCAL_MODULE := magiskpolicy LOCAL_STATIC_LIBRARIES := \ - libbase \ libbase \ libpolicy \ libpolicy-rs @@ -143,7 +142,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := resetprop LOCAL_STATIC_LIBRARIES := \ libbase \ - libcompat \ libnanopb \ libsystemproperties \ libmagisk-rs diff --git a/native/src/zygisk/loader.c b/native/src/zygisk/loader.c index fc06d6850..bcf385750 100644 --- a/native/src/zygisk/loader.c +++ b/native/src/zygisk/loader.c @@ -14,10 +14,7 @@ static void zygisk_loader() { android_dlextinfo info = { .flags = ANDROID_DLEXT_FORCE_LOAD }; - // Android 5.x doesn't support ANDROID_DLEXT_FORCE_LOAD - void *handle = - android_dlopen_ext(SECOND_STAGE_PATH, RTLD_LAZY, &info) ?: - dlopen(SECOND_STAGE_PATH, RTLD_LAZY); + void *handle = android_dlopen_ext(SECOND_STAGE_PATH, RTLD_LAZY, &info); if (handle) { void(*entry)(void*) = dlsym(handle, "zygisk_inject_entry"); if (entry) { diff --git a/scripts/avd_magisk.sh b/scripts/avd_magisk.sh index ca081385d..4f6feb020 100755 --- a/scripts/avd_magisk.sh +++ b/scripts/avd_magisk.sh @@ -3,7 +3,7 @@ # AVD Magisk Setup ##################################################################### # -# Support API level: 21 - 33 +# Support API level: 23 - 33 # # With an emulator booted and accessible via ADB, usage: # ./build.py emulator diff --git a/scripts/avd_patch.sh b/scripts/avd_patch.sh index ca6e68164..0774998b2 100644 --- a/scripts/avd_patch.sh +++ b/scripts/avd_patch.sh @@ -3,7 +3,7 @@ # AVD MagiskInit Setup ##################################################################### # -# Support API level: 23 - 33 (21 and 22 images do not have SELinux) +# Support API level: 23 - 33 # # With an emulator booted and accessible via ADB, usage: # ./build.py avd_patch path/to/booted/avd-image/ramdisk.img diff --git a/scripts/flash_script.sh b/scripts/flash_script.sh index 7e449cc97..e1cddcd62 100644 --- a/scripts/flash_script.sh +++ b/scripts/flash_script.sh @@ -48,7 +48,7 @@ ui_print "- Target image: $BOOTIMAGE" # Detect version and architecture api_level_arch_detect -[ $API -lt 21 ] && abort "! Magisk only support Android 5.0 and above" +[ $API -lt 23 ] && abort "! Magisk only support Android 6.0 and above" ui_print "- Device platform: $ABI" diff --git a/stub/src/main/java/com/topjohnwu/magisk/DownloadActivity.java b/stub/src/main/java/com/topjohnwu/magisk/DownloadActivity.java index 7236a4500..dbce2c5d2 100644 --- a/stub/src/main/java/com/topjohnwu/magisk/DownloadActivity.java +++ b/stub/src/main/java/com/topjohnwu/magisk/DownloadActivity.java @@ -186,7 +186,7 @@ public class DownloadActivity extends Activity { File dir = new File(getCodeCacheDir(), "res"); dir.mkdirs(); - // addAssetPath requires a directory containing AndroidManifest.xml on Android 5 + // addAssetPath requires a directory containing AndroidManifest.xml on Android 6.0 try (var stubApk = new ZipFile(getPackageCodePath()); var manifest = new FileOutputStream(new File(dir, "AndroidManifest.xml"))) { var stubManifest = stubApk.getInputStream( diff --git a/stub/src/main/java/com/topjohnwu/magisk/DynLoad.java b/stub/src/main/java/com/topjohnwu/magisk/DynLoad.java index 41ce3d9d9..877a6fba5 100644 --- a/stub/src/main/java/com/topjohnwu/magisk/DynLoad.java +++ b/stub/src/main/java/com/topjohnwu/magisk/DynLoad.java @@ -188,7 +188,7 @@ public class DynLoad { mcl.set(loadedApk, new DelegateClassLoader()); } catch (Exception e) { // Actually impossible as this method is only called on API < 29, - // and API 21 - 28 do not restrict access to these fields. + // and API 23 - 28 do not restrict access to these fields. Log.e(DynLoad.class.getSimpleName(), "", e); } }