From c6a29636955ab3d2d7b2a6104dba2fc5637659a7 Mon Sep 17 00:00:00 2001 From: androidacy-user Date: Sat, 29 Apr 2023 12:30:12 -0400 Subject: [PATCH] (misc) tweak UI Signed-off-by: androidacy-user --- app/build.gradle.kts | 2 +- .../mmm/installer/InstallerInitializer.java | 19 +++++++++++++----- app/src/main/res/layout/module_entry.xml | 4 ++-- app/src/main/res/values-v31/colors.xml | 1 + app/src/main/res/values-v31/themes.xml | 13 +++++++----- app/src/main/res/values/colors.xml | 2 ++ app/src/main/res/values/themes.xml | 20 +++++++++---------- 7 files changed, 37 insertions(+), 24 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 80507d8..d076db6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -38,7 +38,7 @@ android { applicationId = "com.fox2code.mmm" minSdk = 24 targetSdk = 33 - versionCode = 67 + versionCode = 68 versionName = "2.0.1" vectorDrawables { useSupportLibrary = true diff --git a/app/src/main/java/com/fox2code/mmm/installer/InstallerInitializer.java b/app/src/main/java/com/fox2code/mmm/installer/InstallerInitializer.java index 7106dbd..e772fbb 100644 --- a/app/src/main/java/com/fox2code/mmm/installer/InstallerInitializer.java +++ b/app/src/main/java/com/fox2code/mmm/installer/InstallerInitializer.java @@ -109,17 +109,26 @@ public class InstallerInitializer extends Shell.Initializer { private static String tryGetMagiskPath(boolean forceCheck) { String MAGISK_PATH = InstallerInitializer.MAGISK_PATH; int MAGISK_VERSION_CODE; - boolean HAS_RAMDISK = InstallerInitializer.HAS_RAMDISK; + boolean HAS_RAMDISK; if (MAGISK_PATH != null && !forceCheck) return MAGISK_PATH; ArrayList output = new ArrayList<>(); if (!Shell.cmd("magisk -V", "magisk --path").to(output).exec().isSuccess()) { - if (output.size() != 0) { - HAS_RAMDISK = "false".equals(output.get(0)) || "true".equalsIgnoreCase(System.getProperty("ro.build.ab_update")); + // log the output of each command + if (output.size() > 0) { + for (String line : output) { + Timber.w("Could not run magisk: %s", line); + } + } else { + Timber.w("Could not run magisk"); } - InstallerInitializer.HAS_RAMDISK = HAS_RAMDISK; return null; } - MAGISK_PATH = output.size() < 2 ? "" : output.get(1); + if (output.size() != 2) { + return null; + } + HAS_RAMDISK = "true".equalsIgnoreCase(System.getProperty("ro.build.ab_update")); + InstallerInitializer.HAS_RAMDISK = HAS_RAMDISK; + MAGISK_PATH = output.get(1); Timber.i("Magisk runtime path: %s", MAGISK_PATH); MAGISK_VERSION_CODE = Integer.parseInt(output.get(0)); Timber.i("Magisk version code: %s", MAGISK_VERSION_CODE); diff --git a/app/src/main/res/layout/module_entry.xml b/app/src/main/res/layout/module_entry.xml index 264f306..424c279 100644 --- a/app/src/main/res/layout/module_entry.xml +++ b/app/src/main/res/layout/module_entry.xml @@ -14,9 +14,9 @@ + #C8C8C8 #FFBB86FC #FF6200EE #FF3700B3 diff --git a/app/src/main/res/values-v31/themes.xml b/app/src/main/res/values-v31/themes.xml index 75d49ac..f88236b 100644 --- a/app/src/main/res/values-v31/themes.xml +++ b/app/src/main/res/values-v31/themes.xml @@ -1,10 +1,10 @@ @@ -52,7 +54,7 @@ @color/system_accent2_700 @color/system_accent2_700 - @style/Widget.Material.Chip.Choice.Black + @style/Widget.Material3.Chip.Assist.Elevated @font/inter @font/inter @@ -60,6 +62,7 @@ true false true + @style/Theme.Design.NoActionBar