[core] ensure app_process starts before zygote (#172)

Fix system modules not loaded in some devices

修复部分机型不能加载系统模块
This commit is contained in:
LoveSy 2021-02-23 10:21:57 +08:00 committed by GitHub
parent ceb70aea3b
commit 6314bae5db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 11 deletions

View File

@ -159,3 +159,15 @@ if [[ ! -z "${MISC_PATH}" ]]; then
start_log_catcher all "LSPosed:V XSharedPreferences:V LSPosed-Bridge:V LSPosedManager:V LSPosedService:V *:F" true ${LOG_VERBOSE}
fi
rm -f /data/adb/lspd/new_install
start_app_process() {
while true
do
COUNT=$(awk 1 /proc/**/cmdline | grep -c zygote)
if [[ "$COUNT" -ge 1 ]]; then
/system/bin/app_process -Djava.class.path=/data/adb/lspd/framework/lspd.dex /system/bin --nice-name=lspd io.github.lsposed.lspd.core.Main
fi
done
}
start_app_process &

View File

@ -21,10 +21,3 @@
#
MODDIR=${0%/*}
if [[ -f "${MODDIR}/reboot_twice_flag" ]]; then
rm -f "${MODDIR}/reboot_twice_flag"
reboot
fi
/system/bin/app_process -Djava.class.path=/data/adb/lspd/framework/lspd.dex /system/bin --nice-name=lspd io.github.lsposed.lspd.core.Main &

View File

@ -48,10 +48,6 @@ check_riru_version() {
check_magisk_version() {
ui_print "- Magisk ${LANG_CUST_INST_VERSION}: ${MAGISK_VER_CODE}"
# before Magisk 16e4c67, sepolicy.rule is copied on the second reboot
if [[ "$MAGISK_VER_CODE" -lt 21006 ]]; then
touch "${MODPATH}/reboot_twice_flag"
fi
}
require_new_android() {