From 4d5841332a704baeadf4426b6e666cbc94efbf95 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 17 Jun 2018 01:47:55 +0800 Subject: [PATCH] Change to applet name to prevent showing magisk.bin --- native/jni/core/magisk.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/native/jni/core/magisk.c b/native/jni/core/magisk.c index 2b7ca1dd9..cc0470967 100644 --- a/native/jni/core/magisk.c +++ b/native/jni/core/magisk.c @@ -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