Start service daemon in late_start mode (#57)

1. Starting daemon during post-fs-data can cause Play Integrity detection
   for devices without the PlayIntegrityFix module.
2. Starting LSPosed service daemon in post-fs-data mode is redundant on
   many devices
This commit is contained in:
Captain Throwback 2024-10-07 20:54:26 -04:00 committed by JingMatrix
parent 59285c1553
commit 92cbed418e
3 changed files with 5 additions and 7 deletions

View File

@ -95,9 +95,7 @@ public class ServiceManager {
int systemServerMaxRetry = 1;
for (String arg : args) {
if (arg.equals("--from-service")) {
Log.w(TAG, "LSPosed daemon is not started properly. Try for a late start...");
} else if (arg.startsWith("--system-server-max-retry=")) {
if (arg.startsWith("--system-server-max-retry=")) {
try {
systemServerMaxRetry = Integer.parseInt(arg.substring(arg.lastIndexOf('=') + 1));
} catch (Throwable ignored) {

View File

@ -21,6 +21,4 @@ MODDIR=${0%/*}
rm -f "/data/local/tmp/daemon.apk"
rm -f "/data/local/tmp/manager.apk"
cd "$MODDIR"
unshare --propagation slave -m sh -c "$MODDIR/daemon $@&"

View File

@ -18,6 +18,8 @@
#
MODDIR=${0%/*}
cd "$MODDIR"
# post-fs-data.sh may be blocked by other modules. retry to start this
unshare --propagation slave -m sh -c "$MODDIR/daemon --from-service $@&"
# To avoid breaking Play Integrity in certain cases, we start LSPosed service daemon in late_start service mode instead of post-fs-data mode
unshare --propagation slave -m sh -c "$MODDIR/daemon $@&"