-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
插件获取不到插件manifest声明的权限列表 #824
Comments
请问这个问题怎么解决? @shifujun |
你们可能是刚接触Android插件框架这个领域。目前还没有技术能使插件Manifest中注册的权限生效。 Android系统不允许动态更新Manifest中的内容。所以所有的插件框架都是在解耦代码逻辑和Manifest的关系,使插件在固定的Manifest下尽可能动态更新其他的部分。 |
但是我在宿主中Manifest注册了所需要的权限,还是会报权限null的问题。 @shifujun |
报错日志: |
不返回插件Manifest中注册的权限,因为它们也不会生效。 Tencent#824
getPackageInfo获取宿主的权限,可以先试一下这样修改:shifujun@ca32b3e 我还没有测试。 |
其实就是要这样的实现,上面没有表述太清楚,插件中的权限宿主中也会声明。 |
插件跟宿主运行在主进程,在插件manifest文件声明了一些权限(有permission和uses-permission),但在插件调用如下getPermissions获取的权限列表为空,宿主和插件包名一样,包名传的没问题。请问插件是不支持获取权限列表吗?
PluginApp extends Application() {
override void onCreate() {
super.onCreate();
PluginContext.setAppContext(this);
}
}
public PermissionInfo[] getPermissions(String packageName){
return PluginContext.getAppContext().getPackageManager().getPackageInfo(
packageName, 4096).permissions;//requestedPermissions获取也为null
}
The text was updated successfully, but these errors were encountered: