From 7d99d7686ae78dbc584d2f8b95e5a8f2db1a0010 Mon Sep 17 00:00:00 2001 From: shifujun Date: Fri, 25 Feb 2022 16:10:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(core.loader):=20=E4=BB=8E=E5=AE=BF?= =?UTF-8?q?=E4=B8=BB=E5=A4=8D=E5=88=B6PackageInfo.permission=E5=88=B0?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 不返回插件Manifest中注册的权限,因为它们也不会生效。 #824 --- .../core/loader/managers/PluginPackageManagerImpl.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/projects/sdk/core/loader/src/main/kotlin/com/tencent/shadow/core/loader/managers/PluginPackageManagerImpl.kt b/projects/sdk/core/loader/src/main/kotlin/com/tencent/shadow/core/loader/managers/PluginPackageManagerImpl.kt index d9167f840..513153088 100644 --- a/projects/sdk/core/loader/src/main/kotlin/com/tencent/shadow/core/loader/managers/PluginPackageManagerImpl.kt +++ b/projects/sdk/core/loader/src/main/kotlin/com/tencent/shadow/core/loader/managers/PluginPackageManagerImpl.kt @@ -38,16 +38,19 @@ internal class PluginPackageManagerImpl( hostPackageManager.getApplicationInfo(packageName, flags) } - override fun getPackageInfo(packageName: String, flags: Int): PackageInfo? = - if (packageName.isPlugin()) { + override fun getPackageInfo(packageName: String, flags: Int): PackageInfo? { + val hostPackageInfo = hostPackageManager.getPackageInfo(packageName, flags) + return if (packageName.isPlugin()) { val packageInfo = hostPackageManager.getPackageArchiveInfo(pluginArchiveFilePath, flags) if (packageInfo != null) { packageInfo.applicationInfo = getPluginApplicationInfo(flags) + packageInfo.permissions = hostPackageInfo.permissions } packageInfo } else { - hostPackageManager.getPackageInfo(packageName, flags) + hostPackageInfo } + } override fun getActivityInfo(component: ComponentName, flags: Int): ActivityInfo? = getComponentInfo(