mirror of
https://github.com/haorendashu/nowser.git
synced 2025-12-17 09:54:19 +01:00
add getCallingPackageUnchecked if get code fail
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user