Preparation for dynamic tmpfs path

This commit is contained in:
topjohnwu
2020-04-12 05:34:56 -07:00
parent d739dcac2b
commit e0a281583d
13 changed files with 289 additions and 258 deletions

View File

@@ -37,7 +37,7 @@ Advanced Options (Internal APIs):
--clone-attr SRC DEST clone permission, owner, and selinux context
--clone SRC DEST clone SRC to DEST
--sqlite SQL exec SQL commands to Magisk database
--path print internal tmpfs mount path
--path print Magisk tmpfs mount path
Available applets:
)EOF");
@@ -116,8 +116,10 @@ int magisk_main(int argc, char *argv[]) {
write_int(fd, REMOVE_MODULES);
return read_int(fd);
} else if (argv[1] == "--path"sv) {
// TODO: hardcode /sbin for now, actual logic will be used for Android 11
printf("/sbin\n");
int fd = connect_daemon();
write_int(fd, GET_PATH);
char *path = read_string(fd);
printf("%s\n", path);
return 0;
}
#if 0