From 6314bae5dbc09d97c71a99a5f1da45174cab2e5c Mon Sep 17 00:00:00 2001 From: LoveSy Date: Tue, 23 Feb 2021 10:21:57 +0800 Subject: [PATCH] [core] ensure app_process starts before zygote (#172) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix system modules not loaded in some devices 修复部分机型不能加载系统模块 --- core/template_override/post-fs-data.sh | 12 ++++++++++++ core/template_override/service.sh | 7 ------- core/template_override/util_functions.sh | 4 ---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/core/template_override/post-fs-data.sh b/core/template_override/post-fs-data.sh index ea62248b..6343d94d 100644 --- a/core/template_override/post-fs-data.sh +++ b/core/template_override/post-fs-data.sh @@ -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 & \ No newline at end of file diff --git a/core/template_override/service.sh b/core/template_override/service.sh index 2573004f..eb953593 100644 --- a/core/template_override/service.sh +++ b/core/template_override/service.sh @@ -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 & diff --git a/core/template_override/util_functions.sh b/core/template_override/util_functions.sh index ee715313..4a4de44d 100644 --- a/core/template_override/util_functions.sh +++ b/core/template_override/util_functions.sh @@ -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() {