mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-06 19:33:01 +00:00
try to decode event
This commit is contained in:
@@ -9,7 +9,12 @@ import java.net.URLDecoder
|
||||
object IntentUtils {
|
||||
fun getIntentData(intent: Intent): IntentData? {
|
||||
if (intent.data != null) {
|
||||
val data = URLDecoder.decode(intent.data?.toString()?.replace("+", "%2b") ?: "", "utf-8").replace("nostrsigner:", "")
|
||||
val data = try {
|
||||
URLDecoder.decode(intent.data?.toString()?.replace("+", "%2b") ?: "", "utf-8").replace("nostrsigner:", "")
|
||||
} catch (e: Exception) {
|
||||
intent.data?.toString()?.replace("nostrsigner:", "") ?: ""
|
||||
}
|
||||
|
||||
val type = when (intent.extras?.getString("type")) {
|
||||
"sign_event" -> SignerType.SIGN_EVENT
|
||||
"nip04_encrypt" -> SignerType.NIP04_ENCRYPT
|
||||
|
||||
Reference in New Issue
Block a user