Only accept bunker requests inside the content provider

This commit is contained in:
greenart7c3
2025-12-18 08:14:07 -03:00
parent ecbb89e872
commit 0b14673776
2 changed files with 2 additions and 1 deletions
@@ -378,6 +378,7 @@ class SignerProvider : ContentProvider() {
}
"content://$appId.GET_PUBLIC_KEY" -> {
if (selection != "Amber") return null // only accept content provider when it's a bunker request
val npub = if (projection != null && projection.isNotEmpty()) IntentUtils.parsePubKey(projection[0]) else null
val account = if (npub != null) {
LocalPreferences.loadFromEncryptedStorageSync(context!!, npub)
@@ -302,7 +302,7 @@ class EventNotificationConsumer(private val applicationContext: Context) {
applicationContext.contentResolver.query(
"content://${BuildConfig.APPLICATION_ID}.$type".toUri(),
projection,
null,
"Amber",
null,
event.pubKey,
)