[core] Abort installation on devices with incompatible frameworks (#557)
* [core] Abort installation on devices with incompatible frameworks * Update util_functions.sh * Update util_functions.sh Co-authored-by: vvb2060 <vvb2060@gmail.com>
This commit is contained in:
parent
7a35906cb6
commit
95f0305b12
|
|
@ -43,6 +43,7 @@ extract "$ZIPFILE" 'util_functions.sh' "$TMPDIR"
|
||||||
. "$TMPDIR/util_functions.sh"
|
. "$TMPDIR/util_functions.sh"
|
||||||
check_android_version
|
check_android_version
|
||||||
check_magisk_version
|
check_magisk_version
|
||||||
|
check_incompatible_module
|
||||||
|
|
||||||
# Extract riru.sh
|
# Extract riru.sh
|
||||||
extract "$ZIPFILE" 'riru.sh' "$TMPDIR"
|
extract "$ZIPFILE" 'riru.sh' "$TMPDIR"
|
||||||
|
|
@ -110,10 +111,6 @@ if [ -f /data/adb/lspd/misc_path ]; then
|
||||||
# read current MISC_PATH
|
# read current MISC_PATH
|
||||||
MISC_PATH=$(cat /data/adb/lspd/misc_path)
|
MISC_PATH=$(cat /data/adb/lspd/misc_path)
|
||||||
ui_print " - Use previous path $MISC_PATH"
|
ui_print " - Use previous path $MISC_PATH"
|
||||||
elif [ -f /data/adb/edxp/misc_path ]; then
|
|
||||||
ui_print " - WARNING: This installation will disable EdXposed because of incompatibility"
|
|
||||||
touch "$(magisk --path)/.magisk/modules/riru_edxposed/disable"
|
|
||||||
touch "$(magisk --path)/.magisk/modules/riru_edxposed_sandhook/disable"
|
|
||||||
else
|
else
|
||||||
# generate random MISC_PATH
|
# generate random MISC_PATH
|
||||||
MISC_RAND=$(tr -cd 'A-Za-z0-9' </dev/urandom | head -c16)
|
MISC_RAND=$(tr -cd 'A-Za-z0-9' </dev/urandom | head -c16)
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@
|
||||||
check_magisk_version() {
|
check_magisk_version() {
|
||||||
ui_print "- Magisk version: $MAGISK_VER_CODE"
|
ui_print "- Magisk version: $MAGISK_VER_CODE"
|
||||||
if [ "$MAGISK_VER_CODE" -lt 21000 ]; then
|
if [ "$MAGISK_VER_CODE" -lt 21000 ]; then
|
||||||
ui_print "*********************************************************"
|
ui_print "*********************************************************"
|
||||||
ui_print "! Please install Magisk v21+"
|
ui_print "! Please install Magisk v21+"
|
||||||
abort "*********************************************************"
|
abort "*********************************************************"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@ require_new_android() {
|
||||||
ui_print "! Unsupported Android version ${1} (below Oreo MR1)"
|
ui_print "! Unsupported Android version ${1} (below Oreo MR1)"
|
||||||
ui_print "! Learn more from our GitHub Wiki"
|
ui_print "! Learn more from our GitHub Wiki"
|
||||||
[ "$BOOTMODE" == "true" ] && am start -a android.intent.action.VIEW -d https://github.com/LSPosed/LSPosed/wiki/Available-Android-versions
|
[ "$BOOTMODE" == "true" ] && am start -a android.intent.action.VIEW -d https://github.com/LSPosed/LSPosed/wiki/Available-Android-versions
|
||||||
abort "*********************************************************"
|
abort "*********************************************************"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_android_version() {
|
check_android_version() {
|
||||||
|
|
@ -42,3 +42,16 @@ check_android_version() {
|
||||||
require_new_android "$API"
|
require_new_android "$API"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_incompatible_module() {
|
||||||
|
MODULEDIR="$(magisk --path)/.magisk/modules"
|
||||||
|
FINDMODULE=false
|
||||||
|
for id in "riru_dreamland" "riru_edxposed" "riru_edxposed_sandhook" "taichi"; do
|
||||||
|
[ -d $MODULEDIR/$id ] && [ ! -f $MODULEDIR/$id/disable ] && FINDMODULE=true
|
||||||
|
done
|
||||||
|
if $FINDMODULE; then
|
||||||
|
ui_print "*********************************************************"
|
||||||
|
ui_print "! Please disable or uninstall incompatible frameworks (Dreamland, EdXposed or Taichi)"
|
||||||
|
abort "*********************************************************"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue