mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-10 04:31:55 +00:00
Dump stub app to MAGISKTMP/stub.apk
This commit is contained in:
@@ -35,7 +35,7 @@ bool unxz(int fd, const uint8_t *buf, size_t size) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static int dump_manager(const char *path, mode_t mode) {
|
||||
int dump_manager(const char *path, mode_t mode) {
|
||||
int fd = xopen(path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, mode);
|
||||
if (fd < 0)
|
||||
return 1;
|
||||
|
||||
@@ -32,6 +32,7 @@ void load_kernel_info(BootConfig *config);
|
||||
bool check_two_stage();
|
||||
void setup_klog();
|
||||
const char *backup_init();
|
||||
int dump_manager(const char *path, mode_t mode);
|
||||
|
||||
/***************
|
||||
* Base classes
|
||||
|
||||
@@ -233,6 +233,8 @@ void SARBase::patch_ro_root() {
|
||||
} else {
|
||||
xsymlink("./magisk32", "magisk");
|
||||
}
|
||||
|
||||
dump_manager("stub.apk", 0644);
|
||||
}
|
||||
|
||||
if ((access(SPLIT_PLAT_CIL, F_OK) != 0 && access("/sepolicy", F_OK) == 0) || !hijack_sepolicy()) {
|
||||
@@ -305,6 +307,8 @@ void MagiskInit::patch_rw_root() {
|
||||
} else {
|
||||
xsymlink("./magisk32", "magisk");
|
||||
}
|
||||
|
||||
dump_manager("stub.apk", 0644);
|
||||
}
|
||||
|
||||
if ((!treble && access("/sepolicy", F_OK) == 0) || !hijack_sepolicy()) {
|
||||
|
||||
Reference in New Issue
Block a user