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 <[email protected]>
  • Loading branch information
binarynoise and programminghoch10 committed Nov 9, 2023
1 parent bc4f5e7 commit ae057d4
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 @@ -83,15 +83,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 ae057d4

Please sign in to comment.