Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

1. 不要提交无意义改动。
1. 除非是提交复现问题的测试用例,请确保`gradlew testSdk`构建成功(需要连接Android设备)
1. 测试机需要至少有API 28,API 19两种机器,以保证ART和Dalvik虚拟机都能正常工作。
1. 尽量原子化的提交,配有较为清晰的提交信息。

我们会根据大家的PR再调整PR的要求的。
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@

package com.tencent.shadow.core.loader.managers

import android.annotation.TargetApi
import android.content.ComponentName
import android.content.pm.*
import android.os.Build
import com.tencent.shadow.core.runtime.PluginPackageManager

internal class PluginPackageManagerImpl(private val hostPackageManager: PackageManager,
Expand All @@ -42,14 +40,6 @@ internal class PluginPackageManagerImpl(private val hostPackageManager: PackageM
hostPackageManager.getPackageInfo(packageName, flags)
}

@TargetApi(Build.VERSION_CODES.O)
override fun getPackageInfo(versionedPackage: VersionedPackage?, flags: Int): PackageInfo? =
if (packageInfo.applicationInfo.packageName == versionedPackage?.packageName) {
packageInfo
} else {
hostPackageManager.getPackageInfo(versionedPackage, flags)
}

override fun getActivityInfo(component: ComponentName, flags: Int): ActivityInfo {
if (component.packageName == packageInfo.applicationInfo.packageName) {
val pluginActivityInfo = allPluginPackageInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static PackageInfo getPackageInfo(ClassLoader classLoaderOfInvokeCode, St
@TargetApi(Build.VERSION_CODES.O)
public static PackageInfo getPackageInfo(ClassLoader classLoaderOfInvokeCode, VersionedPackage versionedPackage,
int flags) throws PackageManager.NameNotFoundException{
return getPluginPackageManager(classLoaderOfInvokeCode).getPackageInfo(versionedPackage, flags);
return getPluginPackageManager(classLoaderOfInvokeCode).getPackageInfo(versionedPackage.getPackageName(), flags);
}

public static ProviderInfo resolveContentProvider(ClassLoader classLoaderOfInvokeCode, String name, int flags) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.ProviderInfo;
import android.content.pm.VersionedPackage;

public interface PluginPackageManager {
ApplicationInfo getApplicationInfo(String packageName, int flags);
Expand All @@ -14,7 +13,5 @@ public interface PluginPackageManager {

PackageInfo getPackageInfo(String packageName, int flags);

PackageInfo getPackageInfo(VersionedPackage versionedPackage, int flags);

ProviderInfo resolveContentProvider(String name, int flags);
}