@@ -49,7 +49,7 @@ public static DexClassLoader createPluginClassLoader(String absolutePluginApkPat
49
49
* @return
50
50
*/
51
51
public static Resources createPluginResource (Application application , String absolutePluginApkPath ,
52
- boolean isStandalone ) {
52
+ boolean isStandalone , String [] dependencies ) {
53
53
try {
54
54
55
55
// 插件运行时可能会通过getActivityInfo等
@@ -60,7 +60,7 @@ public static Resources createPluginResource(Application application, String abs
60
60
isStandalone = false ;
61
61
62
62
String [] assetPaths = buildAssetPath (isStandalone , application .getApplicationInfo ().sourceDir ,
63
- absolutePluginApkPath );
63
+ absolutePluginApkPath , dependencies );
64
64
AssetManager assetMgr = AssetManager .class .newInstance ();
65
65
RefInvoker .invokeMethod (assetMgr , AssetManager .class .getName (), "addAssetPaths" ,
66
66
new Class [] { String [].class }, new Object [] { assetPaths });
@@ -76,7 +76,7 @@ public static Resources createPluginResource(Application application, String abs
76
76
return null ;
77
77
}
78
78
79
- private static String [] buildAssetPath (boolean isStandalone , String app , String plugin ) {
79
+ private static String [] buildAssetPath (boolean isStandalone , String app , String plugin , String [] dependencies ) {
80
80
String [] assetPaths = new String [isStandalone ? 1 : 2 ];
81
81
82
82
// if (!isStandalone) {
@@ -95,6 +95,9 @@ private static String[] buildAssetPath(boolean isStandalone, String app, String
95
95
// LogUtil.d("create Plugin Resource from: ", assetPaths[0]);
96
96
// }
97
97
98
+
99
+ //若需支持插件间资源依赖,这里需要遍历添加dependencies
100
+
98
101
if (!isStandalone ) {
99
102
// 不可更改顺序否则不能兼容4.x,如华为P7-Android4.4.2
100
103
assetPaths [0 ] = plugin ;
0 commit comments