mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
fix: url to download driver
This commit is contained in:
@@ -11,6 +11,7 @@ import androidx.activity.result.ActivityResultCallback
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import com.kunzisoft.keepass.BuildConfig
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.legacy.DatabaseModeActivity
|
||||
import com.kunzisoft.keepass.database.element.Database
|
||||
@@ -157,7 +158,11 @@ class HardwareKeyActivity: DatabaseModeActivity(){
|
||||
context.getString(R.string.error_driver_required, hardwareKey.toString())
|
||||
)
|
||||
.setPositiveButton(R.string.download) { _, _ ->
|
||||
UriUtil.openExternalApp(context, context.getString(R.string.key_driver_app_id))
|
||||
UriUtil.openExternalApp(
|
||||
context,
|
||||
context.getString(R.string.key_driver_app_id),
|
||||
context.getString(R.string.key_driver_url)
|
||||
)
|
||||
}
|
||||
.setNegativeButton(android.R.string.cancel) { _, _ -> }
|
||||
.setOnDismissListener(onDialogDismissed)
|
||||
|
||||
@@ -28,10 +28,12 @@ import android.os.Build
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.documentfile.provider.DocumentFile
|
||||
import com.kunzisoft.keepass.BuildConfig
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.app.database.FileDatabaseHistoryAction
|
||||
import com.kunzisoft.keepass.education.Education
|
||||
import java.io.*
|
||||
import java.net.URL
|
||||
import java.util.*
|
||||
|
||||
|
||||
@@ -289,21 +291,35 @@ object UriUtil {
|
||||
return false
|
||||
}
|
||||
|
||||
fun openExternalApp(context: Context, packageName: String) {
|
||||
fun openExternalApp(context: Context, packageName: String, sourcesURL: String? = null) {
|
||||
var launchIntent: Intent? = null
|
||||
try {
|
||||
launchIntent = context.packageManager.getLaunchIntentForPackage(packageName)?.apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
}
|
||||
} catch (ignored: Exception) {
|
||||
}
|
||||
} catch (ignored: Exception) { }
|
||||
try {
|
||||
if (launchIntent == null) {
|
||||
// TODO F-Droid
|
||||
context.startActivity(
|
||||
Intent(Intent.ACTION_VIEW)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.setData(Uri.parse(context.getString(R.string.play_store_url, packageName)))
|
||||
.setData(
|
||||
Uri.parse(
|
||||
if (sourcesURL != null
|
||||
&& !BuildConfig.CLOSED_STORE
|
||||
) {
|
||||
sourcesURL
|
||||
} else {
|
||||
context.getString(
|
||||
if (BuildConfig.CLOSED_STORE)
|
||||
R.string.play_store_url
|
||||
else
|
||||
R.string.f_droid_url,
|
||||
packageName
|
||||
)
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
} else {
|
||||
context.startActivity(launchIntent)
|
||||
|
||||
@@ -31,8 +31,10 @@
|
||||
<string name="app_name_part3" translatable="false">Pro</string>
|
||||
|
||||
<string name="play_store_url" translatable="false">https://play.google.com/store/apps/details?id=%1$s</string>
|
||||
<string name="f_droid_url" translatable="false">https://f-droid.org/en/packages/%1$s</string>
|
||||
<string name="keepro_app_id" translatable="false">com.kunzisoft.keepass.pro</string>
|
||||
<string name="key_driver_app_id" translatable="false">com.kunzisoft.hardware.key</string>
|
||||
<string name="key_driver_url" translatable="false">https://gitlab.com/kunzisoft/android-hardware-key-driver/-/releases/</string>
|
||||
<string name="contribution_url" translatable="false">https://www.keepassdx.com/#donation</string>
|
||||
<string name="homepage_url" translatable="false">https://www.keepassdx.com</string>
|
||||
<string name="external_icon_url" translatable="false">https://www.keepassdx.com/#icons</string>
|
||||
|
||||
Reference in New Issue
Block a user