mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-16 16:42:13 +00:00
Randomize service names
Fix Aniplex Game detections. Close #502, close #513
This commit is contained in:
@@ -292,7 +292,13 @@ static int dump_magiskrc(const char *path, mode_t mode) {
|
||||
int fd = creat(path, mode);
|
||||
if (fd < 0)
|
||||
return 1;
|
||||
xwrite(fd, magiskrc, sizeof(magiskrc));
|
||||
char startup_svc[8], late_start_svc[8], rc[sizeof(magiskrc) + 100];
|
||||
gen_rand_str(startup_svc, sizeof(startup_svc));
|
||||
do {
|
||||
gen_rand_str(late_start_svc, sizeof(late_start_svc));
|
||||
} while (strcmp(startup_svc, late_start_svc) == 0);
|
||||
int size = sprintf(rc, magiskrc, startup_svc, startup_svc, late_start_svc);
|
||||
xwrite(fd, rc, size);
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user