mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
Add boot actions
This commit is contained in:
parent
29895ff474
commit
750872cc37
2
build.py
2
build.py
@ -108,7 +108,7 @@ def build_apk(args):
|
|||||||
|
|
||||||
proc = subprocess.run([
|
proc = subprocess.run([
|
||||||
os.path.join(os.environ['ANDROID_HOME'], 'build-tools', build_tool, 'zipalign'),
|
os.path.join(os.environ['ANDROID_HOME'], 'build-tools', build_tool, 'zipalign'),
|
||||||
'-v', '-p', '4', unsigned, aligned])
|
'-v', '-p', '4', unsigned, aligned], stdout=subprocess.DEVNULL)
|
||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
error('Zipalign Magisk Manager failed!')
|
error('Zipalign Magisk Manager failed!')
|
||||||
|
|
||||||
|
@ -83,6 +83,12 @@ ui_print "- Constructing environment"
|
|||||||
|
|
||||||
is_mounted /data && MAGISKBIN=/data/magisk || MAGISKBIN=/cache/data_bin
|
is_mounted /data && MAGISKBIN=/data/magisk || MAGISKBIN=/cache/data_bin
|
||||||
|
|
||||||
|
if $BOOTMODE; then
|
||||||
|
# Cleanup binary mirrors
|
||||||
|
umount -l /dev/magisk/mirror/bin 2>/dev/null
|
||||||
|
rm -rf /dev/magisk/mirror/bin 2>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
# Copy required files
|
# Copy required files
|
||||||
rm -rf $MAGISKBIN 2>/dev/null
|
rm -rf $MAGISKBIN 2>/dev/null
|
||||||
mkdir -p $MAGISKBIN
|
mkdir -p $MAGISKBIN
|
||||||
@ -103,10 +109,7 @@ fi
|
|||||||
# Magisk Image
|
# Magisk Image
|
||||||
##########################################################################################
|
##########################################################################################
|
||||||
|
|
||||||
$BOOTMODE || recovery_actions
|
$BOOTMODE && boot_actions || recovery_actions
|
||||||
|
|
||||||
# Fix SuperSU.....
|
|
||||||
$BOOTMODE && $MAGISKBIN/magisk magiskpolicy --live "allow fsck * * *"
|
|
||||||
|
|
||||||
if (is_mounted /data); then
|
if (is_mounted /data); then
|
||||||
IMG=/data/magisk.img
|
IMG=/data/magisk.img
|
||||||
|
@ -121,6 +121,15 @@ api_level_arch_detect() {
|
|||||||
if [ "$ABILONG" = "x86_64" ]; then ARCH=x64; IS64BIT=true; fi;
|
if [ "$ABILONG" = "x86_64" ]; then ARCH=x64; IS64BIT=true; fi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boot_actions() {
|
||||||
|
if [ ! -d /dev/magisk/mirror/bin ]; then
|
||||||
|
mkdir -p /dev/magisk/mirror/bin
|
||||||
|
mount -o bind $MAGISKBIN /dev/magisk/mirror/bin
|
||||||
|
fi
|
||||||
|
MAGISKBIN=/dev/magisk/mirror/bin
|
||||||
|
$MAGISKBIN/magisk magiskpolicy --live "allow fsck * * *"
|
||||||
|
}
|
||||||
|
|
||||||
recovery_actions() {
|
recovery_actions() {
|
||||||
# TWRP bug fix
|
# TWRP bug fix
|
||||||
mount -o bind /dev/urandom /dev/random
|
mount -o bind /dev/urandom /dev/random
|
||||||
|
Loading…
x
Reference in New Issue
Block a user