add getCallingPackageUnchecked if get code fail

This commit is contained in:
DASHU
2025-04-25 03:22:59 +08:00
parent 90040de313
commit 2f82ed4a81

View File

@@ -89,11 +89,15 @@ class AndroidSignerContentResolverProvider extends AndroidContentProvider
int appType = AppType.ANDROID_APP; int appType = AppType.ANDROID_APP;
var code = await getCallingPackage(); var code = await getCallingPackage();
if (StringUtil.isBlank(code)) { if (StringUtil.isBlank(code)) {
if (currentUser != null) { code = await getCallingPackageUnchecked();
// code is null, but currentUser is not null, try to find currentUser depend on currentUser print("getCallingPackage null && getCallingPackageUnchecked $code");
var app = appProvider.getAppByUser(appType, currentUser); if (StringUtil.isBlank(code)) {
if (app != null) { if (currentUser != null) {
code = app.code; // code is null, but currentUser is not null, try to find currentUser depend on currentUser
var app = appProvider.getAppByUser(appType, currentUser);
if (app != null) {
code = app.code;
}
} }
} }
} }