1
mirror of https://github.com/topjohnwu/Magisk synced 2024-11-14 22:28:37 +01:00

Change to applet name to prevent showing magisk.bin

This commit is contained in:
topjohnwu 2018-06-17 01:47:55 +08:00
parent 9b41976252
commit 4d5841332a

View File

@ -163,8 +163,10 @@ int magisk_main(int argc, char *argv[]) {
argc--;
argv++;
for (int i = 0; applet[i]; ++i) {
if (strcmp(basename(argv[0]), applet[i]) == 0)
if (strcmp(basename(argv[0]), applet[i]) == 0) {
strcpy(argv0, basename(argv[0]));
return (*applet_main[i])(argc, argv);
}
}
usage();
@ -184,8 +186,10 @@ int main(int argc, char *argv[]) {
// Applets
for (int i = 0; applet[i]; ++i) {
if (strcmp(basename(argv[0]), applet[i]) == 0)
if (strcmp(basename(argv[0]), applet[i]) == 0) {
strcpy(argv0, basename(argv[0]));
return (*applet_main[i])(argc, argv);
}
}
// Not an applet