From e774408782ac55694e1b7ac414dd8e12513d7ab8 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 11 Oct 2023 14:17:31 -0700 Subject: [PATCH] Allow AVD hacks on release builds --- native/src/init/mount.cpp | 5 +---- native/src/init/rootdir.cpp | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/native/src/init/mount.cpp b/native/src/init/mount.cpp index e9f2fd215..e8b3c171b 100644 --- a/native/src/init/mount.cpp +++ b/native/src/init/mount.cpp @@ -223,10 +223,8 @@ mount_root: bool is_two_stage = access("/apex", F_OK) == 0; LOGD("is_two_stage: [%d]\n", is_two_stage); -#if MAGISK_DEBUG // For API 28 AVD, it uses legacy SAR setup that requires - // special hacks in magiskinit to work properly. We do not - // necessarily want this enabled in production builds. + // special hacks in magiskinit to work properly. if (!is_two_stage && config->emulator) { avd_hack = true; // These values are hardcoded for API 28 AVD @@ -236,7 +234,6 @@ mount_root: setup_block(); xmount(blk_info.block_dev, "/vendor", "ext4", MS_RDONLY, nullptr); } -#endif return is_two_stage; } diff --git a/native/src/init/rootdir.cpp b/native/src/init/rootdir.cpp index ac058f587..9761d6b92 100644 --- a/native/src/init/rootdir.cpp +++ b/native/src/init/rootdir.cpp @@ -236,7 +236,6 @@ void MagiskInit::patch_ro_root() { xrename("overlay.d", ROOTOVL); -#if MAGISK_DEBUG extern bool avd_hack; // Handle avd hack if (avd_hack) { @@ -252,7 +251,6 @@ void MagiskInit::patch_ro_root() { close(src); close(dest); } -#endif load_overlay_rc(ROOTOVL); if (access(ROOTOVL "/sbin", F_OK) == 0) {