diff --git a/build.gradle b/build.gradle index c15f6e826..eff87ae2b 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { maven { url 'https://kotlin.bintray.com/kotlinx' } } dependencies { - classpath 'com.android.tools.build:gradle:3.6.1' + classpath 'com.android.tools.build:gradle:3.6.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${vKotlin}" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$vNav" diff --git a/native/jni/init/init.hpp b/native/jni/init/init.hpp index 804d7be31..28637b8e9 100644 --- a/native/jni/init/init.hpp +++ b/native/jni/init/init.hpp @@ -66,7 +66,6 @@ public: class SARBase : public MagiskInit { protected: raw_data config; - dev_t system_dev; void backup_files(const char *self_path); void patch_rootdir(); diff --git a/native/jni/init/mount.cpp b/native/jni/init/mount.cpp index b2768c293..11f4dfa56 100644 --- a/native/jni/init/mount.cpp +++ b/native/jni/init/mount.cpp @@ -218,7 +218,6 @@ void SARInit::early_mount() { exit(1); } } - system_dev = dev; xmkdir("/system_root", 0755); if (xmount("/dev/root", "/system_root", "ext4", MS_RDONLY, nullptr)) xmount("/dev/root", "/system_root", "erofs", MS_RDONLY, nullptr); @@ -237,17 +236,6 @@ void SecondStageInit::early_mount() { rm_rf("/.backup"); rm_rf("/overlay.d"); - // Find system_dev - parse_mnt("/proc/mounts", [&](mntent *me) -> bool { - if (me->mnt_dir == "/system_root"sv) { - struct stat st; - stat(me->mnt_fsname, &st); - system_dev = st.st_rdev; - return false; - } - return true; - }); - switch_root("/system_root"); } diff --git a/native/jni/init/rootdir.cpp b/native/jni/init/rootdir.cpp index 3dc20f560..f363eb85e 100644 --- a/native/jni/init/rootdir.cpp +++ b/native/jni/init/rootdir.cpp @@ -270,8 +270,10 @@ void SARBase::patch_rootdir() { sbin_overlay(self, config); // Mount system_root mirror + struct stat st; + xstat("/", &st); xmkdir(ROOTMIR, 0755); - mknod(ROOTBLK, S_IFBLK | 0600, system_dev); + mknod(ROOTBLK, S_IFBLK | 0600, st.st_dev); if (xmount(ROOTBLK, ROOTMIR, "ext4", MS_RDONLY, nullptr)) xmount(ROOTBLK, ROOTMIR, "erofs", MS_RDONLY, nullptr);