From a5cd1daaa76b3928e7df16f4dd92510a69678b32 Mon Sep 17 00:00:00 2001 From: androidacy-user Date: Thu, 15 Dec 2022 11:48:54 -0500 Subject: [PATCH] Tweaks, fixes, and kittens Signed-off-by: androidacy-user --- app/build.gradle | 21 +++++++------------ .../mmm/androidacy/AndroidacyUtil.java | 6 +++--- .../mmm/settings/SettingsActivity.java | 6 +----- app/src/main/res/layout/setup_box.xml | 2 +- app/src/main/res/values-night-v31/strings.xml | 5 ----- app/src/main/res/values-night/strings.xml | 5 ----- 6 files changed, 12 insertions(+), 33 deletions(-) delete mode 100644 app/src/main/res/values-night-v31/strings.xml delete mode 100644 app/src/main/res/values-night/strings.xml diff --git a/app/build.gradle b/app/build.gradle index 8014b3c..9998ac5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,13 +15,11 @@ android { Properties properties = new Properties() if (project.rootProject.file('local.properties').exists()) { properties.load(project.rootProject.file('local.properties').newDataInputStream()) - // AndroidStudio generate local.properties, only set values if file is defined. - if (properties.hasProperty('keystore.file')) { - storeFile file(properties.getProperty('keystore.file')) - storePassword properties.getProperty('keystore.password') - keyAlias 'key0' - keyPassword properties.getProperty('keystore.password') - } + // FFS DO NOT CHANGE THIS, IT WILL BREAK THE BUILD + storeFile file(properties.getProperty('keystore.file')) + storePassword properties.getProperty('keystore.password') + keyAlias 'key0' + keyPassword properties.getProperty('keystore.password') } } } @@ -30,8 +28,8 @@ android { applicationId "com.fox2code.mmm" minSdk 23 targetSdk 33 - versionCode 61 - versionName "1.0.1" + versionCode 62 + versionName "1.0.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" signingConfig signingConfigs.release } @@ -89,9 +87,7 @@ android { } buildConfigField "String", "SENTRY_TOKEN", '"' + properties.getProperty("auth." + "token") + '"' } else { - buildConfigField "String", "SENTRY_TOKEN", '""' - } // Get the androidacy client ID from the androidacy.properties Properties properties = new Properties() @@ -289,9 +285,6 @@ dependencies { // Test testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.4' - - // Add okhttp logging interceptor if debug build - debugImplementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.10' } if (hasSentryConfig) { diff --git a/app/src/main/java/com/fox2code/mmm/androidacy/AndroidacyUtil.java b/app/src/main/java/com/fox2code/mmm/androidacy/AndroidacyUtil.java index c146343..1a4636b 100644 --- a/app/src/main/java/com/fox2code/mmm/androidacy/AndroidacyUtil.java +++ b/app/src/main/java/com/fox2code/mmm/androidacy/AndroidacyUtil.java @@ -22,8 +22,8 @@ public class AndroidacyUtil { int i; // Check both string and Uri to mitigate parse exploit return url.startsWith("https://") && (i = url.indexOf("/", 8)) != -1 && - url.substring(8, i).endsWith(".androidacy.com") && - uri.getHost().endsWith(".androidacy.com"); + url.substring(8, i).endsWith("api.androidacy.com") && + uri.getHost().endsWith("api.androidacy.com"); } public static boolean isAndroidacyFileUrl(@Nullable String url) { @@ -68,7 +68,7 @@ public class AndroidacyUtil { // URL decode moduleId = Uri.decode(moduleId); // Strip non alphanumeric - moduleId = moduleId.replaceAll("[^a-zA-Z0-9]", ""); + moduleId = moduleId.replaceAll("[^a-zA-Z\\d]", ""); return moduleId; } if (BuildConfig.DEBUG) { diff --git a/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java b/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java index 907e635..342b2b1 100644 --- a/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java +++ b/app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java @@ -959,11 +959,7 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity { if (!homepage.isEmpty()) { preference.setVisible(true); preference.setOnPreferenceClickListener(p -> { - if (homepage.startsWith("https://www.androidacy.com/")) { - IntentHelper.openUrlAndroidacy(getFoxActivity(this), homepage, true); - } else { - IntentHelper.openUrl(getFoxActivity(this), homepage); - } + IntentHelper.openUrl(getFoxActivity(this), homepage); return true; }); ((LongClickablePreference) preference).setOnPreferenceLongClickListener(p -> { diff --git a/app/src/main/res/layout/setup_box.xml b/app/src/main/res/layout/setup_box.xml index f3626ea..d808cd6 100644 --- a/app/src/main/res/layout/setup_box.xml +++ b/app/src/main/res/layout/setup_box.xml @@ -1,5 +1,5 @@ - + - - If you disable this, the developer will not get automatic bug reports, and this may make troubleshooting harder - Androidacy API Key - \ No newline at end of file diff --git a/app/src/main/res/values-night/strings.xml b/app/src/main/res/values-night/strings.xml deleted file mode 100644 index 1258a33..0000000 --- a/app/src/main/res/values-night/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - If you disable this, the developer will not get automatic bug reports, and this may make troubleshooting harder - Androidacy API Key - \ No newline at end of file