Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions app/src/main/kotlin/app/aaps/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,18 @@ class MainActivity : DaggerAppCompatActivityWithResult() {
.setMessage(messageSpanned)
.setPositiveButton(rh.gs(app.aaps.core.ui.R.string.ok), null)
.setNeutralButton(rh.gs(app.aaps.core.ui.R.string.cta_dont_kill_my_app_info)) { _, _ ->
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://dontkillmyapp.com/" + Build.MANUFACTURER.lowercase().replace(" ", "-"))
)
)
}
val knownVendors = setOf(
"samsung", "huawei", "xiaomi", "oneplus", "oppo", "vivo",
"realme", "meizu", "asus", "lenovo", "sony", "lg",
"google", "nokia", "honor", "blackview", "wiko"
)
val mfr = Build.MANUFACTURER.lowercase().replace(" ", "-")
val url = if (mfr in knownVendors)
"https://dontkillmyapp.com/$mfr?app=AAPS"
else
"https://dontkillmyapp.com/?app=AAPS"
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
}
.create().apply {
show()
findViewById<TextView>(android.R.id.message)?.movementMethod = LinkMovementMethod.getInstance()
Expand Down Expand Up @@ -539,4 +544,4 @@ class MainActivity : DaggerAppCompatActivityWithResult() {
}
}

}
}