From dd58921356a755463b2ee896d4db329982828ce3 Mon Sep 17 00:00:00 2001 From: DASHU <385321165@qq.com> Date: Tue, 2 Dec 2025 12:00:40 +0800 Subject: [PATCH] delete remotesigninginfo when app was deleted --- lib/data/remote_signing_info_db.dart | 5 +++++ lib/provider/app_provider.dart | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/data/remote_signing_info_db.dart b/lib/data/remote_signing_info_db.dart index 06b5836..d8a74e8 100644 --- a/lib/data/remote_signing_info_db.dart +++ b/lib/data/remote_signing_info_db.dart @@ -73,4 +73,9 @@ class RemoteSigningInfoDB { "remote_signing_info", await _toJsonWithEncrypt(o, encryptKey), where: "id = ?", whereArgs: [o.id]); } + + static Future deleteByAppId(int appId, {DatabaseExecutor? db}) async { + db = await DB.getDB(db); + db.execute("delete from remote_signing_info where app_id = ?", [appId]); + } } diff --git a/lib/provider/app_provider.dart b/lib/provider/app_provider.dart index 76bf84f..5c1f79a 100644 --- a/lib/provider/app_provider.dart +++ b/lib/provider/app_provider.dart @@ -122,6 +122,14 @@ class AppProvider extends ChangeNotifier { Future deleteApp(App app) async { await AppDB.delete(app.id!); + if (app.appType == AppType.REMOTE) { + try { + RemoteSigningInfoDB.deleteByAppId(app.id!); + } catch (e) { + print(e.toString()); + } + } + try { await AuthLogDB.deleteByAppId(app.id!); } catch (e) {