Commit ba7cb473 authored by topjohnwu's avatar topjohnwu

Make version reporting consistent

parent 48d417f9
......@@ -124,7 +124,7 @@ static void main_daemon() {
});
}
LOGI(SHOW_VER(Magisk) " daemon started\n");
LOGI(NAME_WITH_VER(Magisk) " daemon started\n");
// Get server stat
stat("/proc/self/exe", &self_st);
......
......@@ -15,7 +15,7 @@ using namespace std::literals;
[[noreturn]] static void usage() {
fprintf(stderr,
FULL_VER(Magisk) R"EOF( multi-call binary
NAME_WITH_VER(Magisk) R"EOF( multi-call binary
Usage: magisk [applet [arguments]...]
or: magisk [options]...
......
......@@ -11,9 +11,9 @@
#define MAGISK_VERSION str(__MVSTR)
#define MAGISK_VER_CODE __MCODE
#define MAGISK_FULL_VER MAGISK_VERSION "(" str(MAGISK_VER_CODE) ")"
#define SHOW_VER(name) str(name) " v" MAGISK_VERSION "(" str(MAGISK_VER_CODE) ")"
#define FULL_VER(name) SHOW_VER(name) " (by topjohnwu)"
#define NAME_WITH_VER(name) str(name) " " MAGISK_FULL_VER
#ifdef __MDBG
#define MAGISK_DEBUG
......
......@@ -16,7 +16,7 @@ using namespace std;
static void usage(char *arg0) {
fprintf(stderr,
FULL_VER(MagiskBoot) R"EOF( - Boot Image Modification Tool
NAME_WITH_VER(MagiskBoot) R"EOF( - Boot Image Modification Tool
Usage: %s <action> [args...]
......
......@@ -20,7 +20,7 @@ bool hide_enabled = false;
[[noreturn]] static void usage(char *arg0) {
fprintf(stderr,
FULL_VER(MagiskHide) "\n\n"
NAME_WITH_VER(MagiskHide) "\n\n"
"Usage: %s [action [arguments...] ]\n\n"
"Actions:\n"
" status Return the status of magiskhide\n"
......
......@@ -12,7 +12,7 @@ using namespace std::literals;
[[noreturn]] static void usage(char *arg0) {
fprintf(stderr,
FULL_VER(MagiskPolicy) R"EOF(
NAME_WITH_VER(MagiskPolicy) R"EOF(
Usage: %s [--options...] [policy statements...]
......
......@@ -55,7 +55,7 @@ illegal:
[[noreturn]] static void usage(char* arg0) {
fprintf(stderr,
FULL_VER(resetprop) " - System Props Modification Tool\n\n"
NAME_WITH_VER(resetprop) " - System Props Modification Tool\n\n"
"Usage: %s [flags] [options...]\n"
"\n"
"Options:\n"
......
......@@ -34,7 +34,7 @@ static void usage(int status) {
FILE *stream = (status == EXIT_SUCCESS) ? stdout : stderr;
fprintf(stream,
FULL_VER(MagiskSU) "\n\n"
NAME_WITH_VER(MagiskSU) "\n\n"
"Usage: su [options] [-] [user [argument...]]\n\n"
"Options:\n"
" -c, --command COMMAND pass COMMAND to the invoked shell\n"
......
......@@ -74,8 +74,11 @@ main() {
$BOOTMODE || recovery_actions
PRETTY_VER=$MAGISK_VER
echo $PRETTY_VER | grep -q '\.' && PRETTY_VER=v$PRETTY_VER
if echo $MAGISK_VER | grep -q '\.'; then
PRETTY_VER=$MAGISK_VER
else
PRETTY_VER="$MAGISK_VER($MAGISK_VER_CODE)"
fi
print_title "Magisk $PRETTY_VER addon.d"
mount_partitions
......
......@@ -34,8 +34,11 @@ setup_flashable
# Detection
############
PRETTY_VER=$MAGISK_VER
echo $PRETTY_VER | grep -q '\.' && PRETTY_VER=v$PRETTY_VER
if echo $MAGISK_VER | grep -q '\.'; then
PRETTY_VER=$MAGISK_VER
else
PRETTY_VER="$MAGISK_VER($MAGISK_VER_CODE)"
fi
print_title "Magisk $PRETTY_VER Installer"
is_mounted /data || mount /data || is_mounted /cache || mount /cache
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment