From d94b61771933ff750d426d70e783301d243147d4 Mon Sep 17 00:00:00 2001 From: binarynoise Date: Sun, 2 Jul 2023 22:32:17 +0200 Subject: [PATCH] prevent install_apk from writing /system/addon.d/magisk/magisk.apk Co-Authored-By: programminghoch10 <16062290+programminghoch10@users.noreply.github.com> --- native/src/core/package.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/native/src/core/package.cpp b/native/src/core/package.cpp index e3ac1d9d2..76a005276 100644 --- a/native/src/core/package.cpp +++ b/native/src/core/package.cpp @@ -85,15 +85,7 @@ void preserve_stub_apk() { } static void install_stub() { - if (stub_apk_fd < 0) - return; - struct stat st{}; - fstat(stub_apk_fd, &st); char apk[] = "/system/addon.d/magisk/magisk.apk"; - int dfd = xopen(apk, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0600); - xsendfile(dfd, stub_apk_fd, nullptr, st.st_size); - lseek(stub_apk_fd, 0, SEEK_SET); - close(dfd); install_apk(apk); }