[core] Delay kill ppid (#682)

* Delay kill ppid

* remove useless nohup

* Exit when received uncaught exception
This commit is contained in:
LoveSy 2021-05-26 18:56:09 +08:00 committed by GitHub
parent ca80fd9446
commit c741133b67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -135,4 +135,4 @@ 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
nohup /system/bin/app_process -Djava.class.path=$(magisk --path)/.magisk/modules/riru_lsposed/framework/lspd.dex /system/bin --nice-name=lspd org.lsposed.lspd.core.Main >/dev/null 2>&1
/system/bin/app_process -Djava.class.path=$(magisk --path)/.magisk/modules/riru_lsposed/framework/lspd.dex /system/bin --nice-name=lspd org.lsposed.lspd.core.Main >/dev/null 2>&1

View File

@ -20,4 +20,4 @@
#
# post-fs-data.sh may be blocked by other modules. retry to start this
nohup /system/bin/app_process -Djava.class.path=$(magisk --path)/.magisk/modules/riru_lsposed/framework/lspd.dex /system/bin --nice-name=lspd org.lsposed.lspd.core.Main --from-service >/dev/null 2>&1
/system/bin/app_process -Djava.class.path=$(magisk --path)/.magisk/modules/riru_lsposed/framework/lspd.dex /system/bin --nice-name=lspd org.lsposed.lspd.core.Main --from-service >/dev/null 2>&1

View File

@ -59,7 +59,6 @@ public class ServiceManager {
public static void start(String[] args) {
if (!ConfigManager.getInstance().tryLock()) System.exit(0);
android.os.Process.killProcess(android.system.Os.getppid());
for (String arg : args) {
if (arg.equals("--debug")) {
DdmHandleAppName.setAppName("lspd", 0);
@ -72,7 +71,8 @@ public class ServiceManager {
Log.i(TAG, String.format("version %s (%s)", BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE));
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
Log.e(TAG, Log.getStackTraceString(e));
Log.e(TAG, "Uncaught exception", e);
System.exit(1);
});
Looper.prepareMainLooper();
@ -84,6 +84,8 @@ public class ServiceManager {
systemServerService.putBinderForSystemServer();
android.os.Process.killProcess(android.system.Os.getppid());
waitSystemService("package");
waitSystemService("activity");
waitSystemService(Context.USER_SERVICE);