Start service daemon in post-fs-data.sh (#429)

For trace cleaning modules to work properly, such as the DenyList feature of NeoZygisk, it is better to execute modules mount (`dex2oat` for the case of LSPosed) at post-fs-data.sh.

Moreover, the `logd` daemon of LSPosed should start as early as possible.

This reverts commit 92cbed418e (pull-request #57).

The original pull-request claimed a `PlayIntegrityFix` break, but was not reproducible on other devices.
This commit is contained in:
JingMatrix 2025-11-08 10:49:14 +01:00
parent e7018a3b87
commit c622d0f1f9
3 changed files with 7 additions and 5 deletions

View File

@ -99,7 +99,9 @@ public class ServiceManager {
int systemServerMaxRetry = 1; int systemServerMaxRetry = 1;
for (String arg : args) { for (String arg : args) {
if (arg.startsWith("--system-server-max-retry=")) { 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=")) {
try { try {
systemServerMaxRetry = Integer.parseInt(arg.substring(arg.lastIndexOf('=') + 1)); systemServerMaxRetry = Integer.parseInt(arg.substring(arg.lastIndexOf('=') + 1));
} catch (Throwable ignored) { } catch (Throwable ignored) {

View File

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

View File

@ -18,8 +18,6 @@
# #
MODDIR=${0%/*} MODDIR=${0%/*}
cd "$MODDIR" cd "$MODDIR"
# post-fs-data.sh may be blocked by other modules. retry to start this
# 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 --from-service $@&"
unshare --propagation slave -m sh -c "$MODDIR/daemon $@&"