Skip to content

Commit 9d20606

Browse files
release 2.3.5
Signed-off-by: androidacy-user <opensource@androidacy.com>
1 parent 1c47c44 commit 9d20606

3 files changed

Lines changed: 15 additions & 17 deletions

File tree

app/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ android {
4848
applicationId = "com.fox2code.mmm"
4949
minSdk = 26
5050
targetSdk = 34
51-
versionCode = 88
52-
versionName = "2.3.4"
51+
versionCode = 89
52+
versionName = "2.3.5"
5353
vectorDrawables {
5454
useSupportLibrary = true
5555
}
@@ -374,7 +374,7 @@ dependencies {
374374
// Chromium cronet from androidacy
375375
implementation("org.chromium.net:cronet-embedded:113.5672.61")
376376

377-
val libsuVersion = "5.1.0"
377+
val libsuVersion = "5.2.1"
378378
// The core module that provides APIs to a shell
379379
implementation("com.github.topjohnwu.libsu:core:${libsuVersion}")
380380

app/src/main/kotlin/com/fox2code/mmm/module/ActionButtonType.kt

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import android.text.Spanned
1111
import android.widget.TextView
1212
import android.widget.Toast
1313
import androidx.annotation.DrawableRes
14-
import com.fox2code.mmm.BuildConfig
1514
import com.fox2code.mmm.MainApplication
1615
import com.fox2code.mmm.MainApplication.Companion.INSTANCE
1716
import com.fox2code.mmm.MainApplication.Companion.isShowcaseMode
@@ -158,19 +157,6 @@ enum class ActionButtonType {
158157
.recordEvent("view_update_install", HashMap<String, Any>().apply {
159158
put("module", name ?: "null")
160159
})
161-
// if text is reinstall, we need to uninstall first - warn the user but don't proceed
162-
if (moduleHolder.moduleInfo != null && moduleHolder.repoModule == null && button.text == button.context.getString(R.string.reinstall)) {
163-
if (!BuildConfig.DEBUG) {
164-
val builder = MaterialAlertDialogBuilder(button.context)
165-
builder.setTitle(R.string.reinstall)
166-
.setMessage(R.string.reinstall_warning_v2)
167-
.setCancelable(true)
168-
// ok button that does nothing
169-
.setPositiveButton(R.string.ok, null)
170-
.show()
171-
return
172-
}
173-
}
174160
// prefer repomodule if possible
175161
var updateZipUrl = ""
176162
if (moduleHolder.repoModule != null && moduleHolder.repoModule!!.zipUrl != null) {
@@ -180,6 +166,16 @@ enum class ActionButtonType {
180166
if (updateZipUrl.isEmpty() && moduleHolder.moduleInfo != null && moduleHolder.moduleInfo!!.updateZipUrl != null) {
181167
updateZipUrl = moduleHolder.moduleInfo!!.updateZipUrl!!
182168
}
169+
// still empty? show dialog
170+
if (updateZipUrl.isEmpty()) {
171+
val materialAlertDialogBuilder = MaterialAlertDialogBuilder(button.context)
172+
materialAlertDialogBuilder.setTitle(R.string.invalid_update_url)
173+
materialAlertDialogBuilder.setMessage(R.string.invalid_update_url_message)
174+
materialAlertDialogBuilder.setPositiveButton(android.R.string.ok, null)
175+
materialAlertDialogBuilder.setIcon(R.drawable.ic_baseline_error_24)
176+
materialAlertDialogBuilder.show()
177+
return
178+
}
183179
// Androidacy manage the selection between download and install
184180
if (isAndroidacyLink(updateZipUrl)) {
185181
openUrlAndroidacy(

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,4 +427,6 @@
427427
<string name="update_failed">Could not check for updates</string>
428428
<string name="update_failed_description">Failed to check for updates. If this keeps happening, please ensure the app is not restricted from background usage.</string>
429429
<string name="install_from_storage_file_not_found">Could not find selected file. Please try again.</string>
430+
<string name="invalid_update_url">No update URL found</string>
431+
<string name="invalid_update_url_message">Could not determine a suitable URL to reinstall or update this module from. Please check with the source you got this module from.</string>
430432
</resources>

0 commit comments

Comments
 (0)