mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-25 02:55:33 +00:00
Clean up more codes
This commit is contained in:
parent
5c325d9466
commit
54ecc001f4
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
## Introduction
|
## 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:
|
Some highlight features:
|
||||||
|
|
||||||
- **MagiskSU**: Provide root access for applications
|
- **MagiskSU**: Provide root access for applications
|
||||||
|
@ -23,8 +23,6 @@ public class ConcealableBottomNavigationView extends BottomNavigationView {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private boolean isHidden;
|
private boolean isHidden;
|
||||||
private int lastHeight = -1;
|
|
||||||
|
|
||||||
public ConcealableBottomNavigationView(@NonNull Context context) {
|
public ConcealableBottomNavigationView(@NonNull Context context) {
|
||||||
this(context, null);
|
this(context, null);
|
||||||
}
|
}
|
||||||
@ -42,14 +40,6 @@ public class ConcealableBottomNavigationView extends BottomNavigationView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void recreateAnimator(int height) {
|
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);
|
Animator toHidden = ObjectAnimator.ofFloat(this, "translationY", height);
|
||||||
toHidden.setDuration(175);
|
toHidden.setDuration(175);
|
||||||
toHidden.setInterpolator(new FastOutLinearInInterpolator());
|
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
|
- `ZIPFILE` (path): your module's installation zip
|
||||||
- `ARCH` (string): the CPU architecture of the device. Value is either `arm`, `arm64`, `x86`, or `x64`
|
- `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`
|
- `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
|
##### Functions
|
||||||
|
|
||||||
|
@ -126,7 +126,6 @@ ifdef B_POLICY
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := magiskpolicy
|
LOCAL_MODULE := magiskpolicy
|
||||||
LOCAL_STATIC_LIBRARIES := \
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
libbase \
|
|
||||||
libbase \
|
libbase \
|
||||||
libpolicy \
|
libpolicy \
|
||||||
libpolicy-rs
|
libpolicy-rs
|
||||||
@ -143,7 +142,6 @@ include $(CLEAR_VARS)
|
|||||||
LOCAL_MODULE := resetprop
|
LOCAL_MODULE := resetprop
|
||||||
LOCAL_STATIC_LIBRARIES := \
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
libbase \
|
libbase \
|
||||||
libcompat \
|
|
||||||
libnanopb \
|
libnanopb \
|
||||||
libsystemproperties \
|
libsystemproperties \
|
||||||
libmagisk-rs
|
libmagisk-rs
|
||||||
|
@ -14,10 +14,7 @@ static void zygisk_loader() {
|
|||||||
android_dlextinfo info = {
|
android_dlextinfo info = {
|
||||||
.flags = ANDROID_DLEXT_FORCE_LOAD
|
.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);
|
||||||
void *handle =
|
|
||||||
android_dlopen_ext(SECOND_STAGE_PATH, RTLD_LAZY, &info) ?:
|
|
||||||
dlopen(SECOND_STAGE_PATH, RTLD_LAZY);
|
|
||||||
if (handle) {
|
if (handle) {
|
||||||
void(*entry)(void*) = dlsym(handle, "zygisk_inject_entry");
|
void(*entry)(void*) = dlsym(handle, "zygisk_inject_entry");
|
||||||
if (entry) {
|
if (entry) {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# AVD Magisk Setup
|
# AVD Magisk Setup
|
||||||
#####################################################################
|
#####################################################################
|
||||||
#
|
#
|
||||||
# Support API level: 21 - 33
|
# Support API level: 23 - 33
|
||||||
#
|
#
|
||||||
# With an emulator booted and accessible via ADB, usage:
|
# With an emulator booted and accessible via ADB, usage:
|
||||||
# ./build.py emulator
|
# ./build.py emulator
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# AVD MagiskInit Setup
|
# 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:
|
# With an emulator booted and accessible via ADB, usage:
|
||||||
# ./build.py avd_patch path/to/booted/avd-image/ramdisk.img
|
# ./build.py avd_patch path/to/booted/avd-image/ramdisk.img
|
||||||
|
@ -48,7 +48,7 @@ ui_print "- Target image: $BOOTIMAGE"
|
|||||||
# Detect version and architecture
|
# Detect version and architecture
|
||||||
api_level_arch_detect
|
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"
|
ui_print "- Device platform: $ABI"
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ public class DownloadActivity extends Activity {
|
|||||||
File dir = new File(getCodeCacheDir(), "res");
|
File dir = new File(getCodeCacheDir(), "res");
|
||||||
dir.mkdirs();
|
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());
|
try (var stubApk = new ZipFile(getPackageCodePath());
|
||||||
var manifest = new FileOutputStream(new File(dir, "AndroidManifest.xml"))) {
|
var manifest = new FileOutputStream(new File(dir, "AndroidManifest.xml"))) {
|
||||||
var stubManifest = stubApk.getInputStream(
|
var stubManifest = stubApk.getInputStream(
|
||||||
|
@ -188,7 +188,7 @@ public class DynLoad {
|
|||||||
mcl.set(loadedApk, new DelegateClassLoader());
|
mcl.set(loadedApk, new DelegateClassLoader());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Actually impossible as this method is only called on API < 29,
|
// 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);
|
Log.e(DynLoad.class.getSimpleName(), "", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user