From 9d20606df760367994a543d2aef7cb044d215843 Mon Sep 17 00:00:00 2001 From: androidacy-user Date: Mon, 6 Nov 2023 21:43:29 -0500 Subject: [PATCH] release 2.3.5 Signed-off-by: androidacy-user --- app/build.gradle.kts | 6 ++--- .../fox2code/mmm/module/ActionButtonType.kt | 24 ++++++++----------- app/src/main/res/values/strings.xml | 2 ++ 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1fef6987..d16a5121 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -48,8 +48,8 @@ android { applicationId = "com.fox2code.mmm" minSdk = 26 targetSdk = 34 - versionCode = 88 - versionName = "2.3.4" + versionCode = 89 + versionName = "2.3.5" vectorDrawables { useSupportLibrary = true } @@ -374,7 +374,7 @@ dependencies { // Chromium cronet from androidacy implementation("org.chromium.net:cronet-embedded:113.5672.61") - val libsuVersion = "5.1.0" + val libsuVersion = "5.2.1" // The core module that provides APIs to a shell implementation("com.github.topjohnwu.libsu:core:${libsuVersion}") diff --git a/app/src/main/kotlin/com/fox2code/mmm/module/ActionButtonType.kt b/app/src/main/kotlin/com/fox2code/mmm/module/ActionButtonType.kt index 2761254f..9d07b710 100644 --- a/app/src/main/kotlin/com/fox2code/mmm/module/ActionButtonType.kt +++ b/app/src/main/kotlin/com/fox2code/mmm/module/ActionButtonType.kt @@ -11,7 +11,6 @@ import android.text.Spanned import android.widget.TextView import android.widget.Toast import androidx.annotation.DrawableRes -import com.fox2code.mmm.BuildConfig import com.fox2code.mmm.MainApplication import com.fox2code.mmm.MainApplication.Companion.INSTANCE import com.fox2code.mmm.MainApplication.Companion.isShowcaseMode @@ -158,19 +157,6 @@ enum class ActionButtonType { .recordEvent("view_update_install", HashMap().apply { put("module", name ?: "null") }) - // if text is reinstall, we need to uninstall first - warn the user but don't proceed - if (moduleHolder.moduleInfo != null && moduleHolder.repoModule == null && button.text == button.context.getString(R.string.reinstall)) { - if (!BuildConfig.DEBUG) { - val builder = MaterialAlertDialogBuilder(button.context) - builder.setTitle(R.string.reinstall) - .setMessage(R.string.reinstall_warning_v2) - .setCancelable(true) - // ok button that does nothing - .setPositiveButton(R.string.ok, null) - .show() - return - } - } // prefer repomodule if possible var updateZipUrl = "" if (moduleHolder.repoModule != null && moduleHolder.repoModule!!.zipUrl != null) { @@ -180,6 +166,16 @@ enum class ActionButtonType { if (updateZipUrl.isEmpty() && moduleHolder.moduleInfo != null && moduleHolder.moduleInfo!!.updateZipUrl != null) { updateZipUrl = moduleHolder.moduleInfo!!.updateZipUrl!! } + // still empty? show dialog + if (updateZipUrl.isEmpty()) { + val materialAlertDialogBuilder = MaterialAlertDialogBuilder(button.context) + materialAlertDialogBuilder.setTitle(R.string.invalid_update_url) + materialAlertDialogBuilder.setMessage(R.string.invalid_update_url_message) + materialAlertDialogBuilder.setPositiveButton(android.R.string.ok, null) + materialAlertDialogBuilder.setIcon(R.drawable.ic_baseline_error_24) + materialAlertDialogBuilder.show() + return + } // Androidacy manage the selection between download and install if (isAndroidacyLink(updateZipUrl)) { openUrlAndroidacy( diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a3049ed4..40c2354c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -427,4 +427,6 @@ Could not check for updates Failed to check for updates. If this keeps happening, please ensure the app is not restricted from background usage. Could not find selected file. Please try again. + No update URL found + Could not determine a suitable URL to reinstall or update this module from. Please check with the source you got this module from.