This commit is contained in:
zhaarey
2024-12-20 17:46:15 +08:00
parent 3b3a73bb60
commit 6ffd3585b6
11 changed files with 166 additions and 41 deletions

View File

@ -1,6 +1,6 @@
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
@ -35,24 +35,22 @@ int main(int argc, char *argv[], char *envp[]) {
chmod("/system/bin/linker64", 0755);
chmod("/system/bin/main", 0755);
if (unshare(CLONE_NEWPID)) {
perror("unshare");
return 1;
}
child_proc = fork();
if (child_proc == -1) {
perror("fork");
return 1;
}
if (child_proc > 0) {
close(STDOUT_FILENO);
wait(NULL);
wait(NULL); // Parent waits for the child process to terminate
return 0;
}
// Child process logic
mkdir("/data/data/com.apple.android.music/files", 0777);
mkdir("/data/data/com.apple.android.music/files/mpl_db", 0777);
execve("/system/bin/main", argv, envp);
perror("execve");
return 1;
}
}