Don't try to url decode for android apps

This commit is contained in:
greenart7c3
2025-02-14 06:23:19 -03:00
parent ab52dd22b6
commit daceba5e6a
2 changed files with 7 additions and 3 deletions
@@ -69,7 +69,11 @@ data class BunkerMetadata(
}
object IntentUtils {
fun decodeData(data: String, replace: Boolean = true): String {
fun decodeData(data: String, replace: Boolean = true, decodeData: Boolean = true): String {
if (!decodeData) {
if (!replace) return data.replace("nostrsigner:", "")
return data.replace("nostrsigner:", "").replace("+", "%2b")
}
if (!replace) return URLDecoder.decode(data.replace("nostrsigner:", ""), "utf-8")
return URLDecoder.decode(data.replace("nostrsigner:", "").replace("+", "%2b"), "utf-8")
}
@@ -296,7 +300,7 @@ object IntentUtils {
val data =
try {
decodeData(intent.data?.toString() ?: "", packageName == null)
decodeData(intent.data?.toString() ?: "", packageName == null, packageName == null)
} catch (e: Exception) {
intent.data?.toString()?.replace("nostrsigner:", "") ?: ""
}
+1 -1
View File
@@ -22,7 +22,7 @@ zxingAndroidEmbedded = "4.3.0"
okhttp = "5.0.0-alpha.14"
kotlin = "2.1.10"
workRuntimeKtx = "2.10.0"
agp = "8.8.0"
agp = "8.8.1"
ktlint = "12.1.2"
ksp = "2.1.10-1.0.29"
coil = "3.0.4"