Skip to content

Commit

Permalink
Fix reset native bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Aug 18, 2021
1 parent 2f71699 commit 3591478
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions rirud/src/main/java/riru/DaemonUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public class DaemonUtils {
private static Boolean has32Bit = null, has64Bit = null;
private static String originalNativeBridge;
private static String devRandom;
private static int ppid = -1;
private static int magiskVersionCode = -1;
private static String magiskTmpfsPath;

Expand All @@ -70,10 +69,6 @@ public class DaemonUtils {
private static final Set<Integer> zygotePid = Collections.newSetFromMap(new ConcurrentHashMap<>());

static {
originalNativeBridge = SystemProperties.get("ro.dalvik.vm.native.bridge");
if (TextUtils.isEmpty(originalNativeBridge)) {
originalNativeBridge = "0";
}

try {
isSELinuxEnforcing = hasSELinux() && SELinux.isSELinuxEnabled() && SELinux.isSELinuxEnforced();
Expand Down Expand Up @@ -122,6 +117,11 @@ public class DaemonUtils {
public static void init(String[] args) {
magiskVersionCode = Integer.parseInt(args[0]);
magiskTmpfsPath = args[1];
if (args.length > 2) {
originalNativeBridge = args[2];
} else {
originalNativeBridge = "0";
}
}

public static boolean isLoaded() {
Expand Down
2 changes: 1 addition & 1 deletion template/magisk_module/post-fs-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ sed -Ei 's/^description=(\[.*][[:space:]]*)?/description=[ app_process fails to
export CLASSPATH=$MODDIR/rirud.apk
cd $MODDIR
flock "module.prop"
unshare -m sh -c "/system/bin/app_process -Djava.class.path=rirud.apk /system/bin --nice-name=rirud riru.Daemon $(magisk -V) $(magisk --path) &"
unshare -m sh -c "/system/bin/app_process -Djava.class.path=rirud.apk /system/bin --nice-name=rirud riru.Daemon $(magisk -V) $(magisk --path) $(getprop ro.dalvik.vm.native.bridge)&"

0 comments on commit 3591478

Please sign in to comment.