From 0543239ccab94b0c5a2f577d6d076f21726dd9a4 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 1 Sep 2018 11:15:05 -0400 Subject: [PATCH] Do not merge binaries if fake symlink --- native/jni/core/bootstages.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/native/jni/core/bootstages.c b/native/jni/core/bootstages.c index f70426c2d..b1c599842 100644 --- a/native/jni/core/bootstages.c +++ b/native/jni/core/bootstages.c @@ -637,7 +637,10 @@ void startup() { "/data/user_de/0/com.topjohnwu.magisk/install", NULL }; char *bin_path = NULL; for (int i = 0; alt_bin[i]; ++i) { - if (access(alt_bin[i], F_OK) == 0) { + struct stat st; + if (lstat(alt_bin[i], &st) != -1 && !S_ISLNK(st.st_mode)) { + rm_rf(DATABIN); + cp_afc(bin_path, DATABIN); bin_path = alt_bin[i]; break; }