Skip to content

Commit

Permalink
prevent install_apk from writing /system/addon.d/magisk/magisk.apk
Browse files Browse the repository at this point in the history
Co-Authored-By:  programminghoch10 <16062290+programminghoch10@users.noreply.github.com>
  • Loading branch information
binarynoise and programminghoch10 committed Feb 10, 2024
1 parent 1333c18 commit d94b617
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions native/src/core/package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit d94b617

Please sign in to comment.