More debug indication in UI

Close #5874
This commit is contained in:
topjohnwu
2022-05-30 01:53:07 -07:00
parent 5e6eb8dd01
commit 50e2f33d1c
4 changed files with 22 additions and 8 deletions

View File

@@ -174,7 +174,11 @@ static void handle_request_async(int client, int code, const sock_cred &cred) {
static void handle_request_sync(int client, int code) {
switch (code) {
case MainRequest::CHECK_VERSION:
write_string(client, MAGISK_VERSION ":MAGISK");
#if MAGISK_DEBUG
write_string(client, MAGISK_VERSION ":MAGISK:D");
#else
write_string(client, MAGISK_VERSION ":MAGISK:R");
#endif
break;
case MainRequest::CHECK_VERSION_CODE:
write_int(client, MAGISK_VER_CODE);

View File

@@ -52,7 +52,11 @@ int magisk_main(int argc, char *argv[]) {
if (argc < 2)
usage();
if (argv[1] == "-c"sv) {
printf(MAGISK_VERSION ":MAGISK (" str(MAGISK_VER_CODE) ")\n");
#if MAGISK_DEBUG
printf(MAGISK_VERSION ":MAGISK:D (" str(MAGISK_VER_CODE) ")\n");
#else
printf(MAGISK_VERSION ":MAGISK:R (" str(MAGISK_VER_CODE) ")\n");
#endif
return 0;
} else if (argv[1] == "-v"sv) {
int fd = connect_daemon(MainRequest::CHECK_VERSION);