Start LSPosed daemon in `service.sh`

This reverts partially commit c622d0f1f9.

In my test device (Pixel 6, Android 16 qpr2, KernelSU), calling twice LSPosed daemon results a detection based on `mount_id` values. In `com.reveny.nativecheck` 7.6.1, it is named as `Detected Magic Mount`.
Of course, this naming is incorrect and misleading. We refer to https://github.com/JingMatrix/NeoZygisk/pull/39 for details of this detection point.
This commit is contained in:
JingMatrix 2025-11-12 16:32:30 +01:00
parent f5af5690f5
commit 0e457e3247
4 changed files with 5 additions and 32 deletions

View File

@ -99,9 +99,7 @@ public class ServiceManager {
int systemServerMaxRetry = 1; int systemServerMaxRetry = 1;
for (String arg : args) { for (String arg : args) {
if (arg.equals("--from-service")) { if (arg.startsWith("--system-server-max-retry=")) {
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

@ -73,7 +73,6 @@ ui_print "- Extracting module files"
extract "$ZIPFILE" 'module.prop' "$MODPATH" extract "$ZIPFILE" 'module.prop' "$MODPATH"
extract "$ZIPFILE" 'action.sh' "$MODPATH" extract "$ZIPFILE" 'action.sh' "$MODPATH"
extract "$ZIPFILE" 'post-fs-data.sh' "$MODPATH"
extract "$ZIPFILE" 'service.sh' "$MODPATH" extract "$ZIPFILE" 'service.sh' "$MODPATH"
extract "$ZIPFILE" 'uninstall.sh' "$MODPATH" extract "$ZIPFILE" 'uninstall.sh' "$MODPATH"
extract "$ZIPFILE" 'sepolicy.rule' "$MODPATH" extract "$ZIPFILE" 'sepolicy.rule' "$MODPATH"

View File

@ -1,26 +0,0 @@
#
# This file is part of LSPosed.
#
# LSPosed is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# LSPosed is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
#
# Copyright (C) 2021 LSPosed Contributors
#
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%/*} MODDIR=${0%/*}
cd "$MODDIR" 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 delaying the normal mount timing of zygote, we start LSPosed service daemon in late_start service mode instead of post-fs-data mode
unshare --propagation slave -m sh -c "$MODDIR/daemon $@&"