mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-21 15:05:28 +00:00
Clean up more codes
This commit is contained in:
parent
5c325d9466
commit
54ecc001f4
@ -6,7 +6,7 @@
|
||||
|
||||
## Introduction
|
||||
|
||||
Magisk is a suite of open source software for customizing Android, supporting devices higher than Android 5.0.<br>
|
||||
Magisk is a suite of open source software for customizing Android, supporting devices higher than Android 6.0.<br>
|
||||
Some highlight features:
|
||||
|
||||
- **MagiskSU**: Provide root access for applications
|
||||
|
@ -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());
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user