android content query add reject colum

This commit is contained in:
DASHU
2025-06-03 18:02:02 +08:00
parent bbc8dee210
commit b9d41594d4
6 changed files with 48 additions and 23 deletions

View File

@@ -254,7 +254,7 @@ class _WebViewComponent extends State<WebViewComponent>
}
checkPermission(context, AppType.WEB, code, AuthType.GET_PUBLIC_KEY,
(app) {
(app, rejectType) {
nip07Reject(resultId, "Forbid");
}, (app, signer) {
print("confirm get pubkey");
@@ -283,7 +283,7 @@ class _WebViewComponent extends State<WebViewComponent>
var eventKind = eventObj["kind"];
if (eventKind is int) {
checkPermission(context, AppType.WEB, code, AuthType.SIGN_EVENT,
eventKind: eventKind, authDetail: content, (app) {
eventKind: eventKind, authDetail: content, (app, rejectType) {
nip07Reject(resultId, "Forbid");
}, (app, signer) async {
var tags = eventObj["tags"];
@@ -321,7 +321,8 @@ class _WebViewComponent extends State<WebViewComponent>
return;
}
checkPermission(context, AppType.WEB, code, AuthType.GET_RELAYS, (app) {
checkPermission(context, AppType.WEB, code, AuthType.GET_RELAYS,
(app, rejectType) {
nip07Reject(resultId, "Forbid");
}, (app, signer) {
// TODO handle getRelays
@@ -359,7 +360,7 @@ class _WebViewComponent extends State<WebViewComponent>
}
checkPermission(context, AppType.WEB, code, AuthType.NIP04_ENCRYPT,
(app) {
(app, rejectType) {
nip07Reject(resultId, "Forbid");
}, (app, signer) async {
var resultStr = await signer.encrypt(pubkey, plaintext);
@@ -391,7 +392,7 @@ class _WebViewComponent extends State<WebViewComponent>
}
checkPermission(context, AppType.WEB, code, AuthType.NIP04_DECRYPT,
(app) {
(app, rejectType) {
nip07Reject(resultId, "Forbid");
}, (app, signer) async {
var app = appProvider.getApp(AppType.WEB, code);
@@ -426,7 +427,7 @@ class _WebViewComponent extends State<WebViewComponent>
}
checkPermission(context, AppType.WEB, code, AuthType.NIP44_ENCRYPT,
(app) {
(app, rejectType) {
nip07Reject(resultId, "Forbid");
}, (app, signer) async {
var resultStr = await signer.nip44Encrypt(pubkey, plaintext);
@@ -458,7 +459,7 @@ class _WebViewComponent extends State<WebViewComponent>
}
checkPermission(context, AppType.WEB, code, AuthType.NIP44_DECRYPT,
(app) {
(app, rejectType) {
nip07Reject(resultId, "Forbid");
}, (app, signer) async {
var resultStr = await signer.nip44Decrypt(pubkey, ciphertext);