Stop using polymorphism in magiskinit

This commit is contained in:
topjohnwu
2024-12-03 02:17:57 -08:00
parent c8e9ce7627
commit 3c6889505b
7 changed files with 125 additions and 187 deletions

View File

@@ -64,7 +64,7 @@ bool MagiskInit::hijack_sepolicy() {
// This only happens on Android 8.0 - 9.0
char buf[4096];
ssprintf(buf, sizeof(buf), "%s/fstab/compatible", config->dt_dir);
ssprintf(buf, sizeof(buf), "%s/fstab/compatible", config.dt_dir);
dt_compat = full_read(buf);
if (dt_compat.empty()) {
// Device does not do early mount and uses monolithic policy
@@ -106,7 +106,7 @@ bool MagiskInit::hijack_sepolicy() {
int fd = xopen(MOCK_COMPAT, O_WRONLY);
char buf[4096];
ssprintf(buf, sizeof(buf), "%s/fstab/compatible", config->dt_dir);
ssprintf(buf, sizeof(buf), "%s/fstab/compatible", config.dt_dir);
xumount2(buf, MNT_DETACH);
hijack();