@@ -221,32 +221,13 @@ public static Context getDefaultPluginContext(@SuppressWarnings("rawtypes") Clas
221
221
* @return
222
222
*/
223
223
public static Context getNewPluginContext (@ SuppressWarnings ("rawtypes" ) Class clazz ) {
224
-
225
224
Context pluginContext = getDefaultPluginContext (clazz );
226
- //为了使5.0支持主题, 这里做api版本区分
227
- if (Build .VERSION .SDK_INT >= 14 && Build .VERSION .SDK_INT <= 20 ) {
228
-
229
- if (pluginContext != null ) {
230
- pluginContext = PluginCreator .createPluginApplicationContext (sApplication ,
231
- pluginContext .getResources (), (DexClassLoader )pluginContext .getClassLoader ());
232
- pluginContext .setTheme (sApplication .getApplicationContext ().getApplicationInfo ().theme );
233
- }
234
-
235
- return pluginContext ;
236
-
237
- } else {
238
- PluginDescriptor pd = getPluginDescriptorByClassName (clazz .getName ());
239
-
240
- Resources resFor5 = PluginCreator .createPluginResourceFor5 (sApplication , pd .getInstalledPath ());
241
-
242
- if (pluginContext != null ) {
243
- pluginContext = PluginCreator .createPluginApplicationContext (sApplication ,
244
- resFor5 , (DexClassLoader )pluginContext .getClassLoader ());
245
- pluginContext .setTheme (sApplication .getApplicationContext ().getApplicationInfo ().theme );
246
- }
247
- return pluginContext ;
225
+ if (pluginContext != null ) {
226
+ pluginContext = PluginCreator .createPluginApplicationContext (sApplication ,
227
+ pluginContext .getResources (), (DexClassLoader )pluginContext .getClassLoader ());
228
+ pluginContext .setTheme (sApplication .getApplicationContext ().getApplicationInfo ().theme );
248
229
}
249
-
230
+ return pluginContext ;
250
231
}
251
232
252
233
/**
@@ -358,7 +339,7 @@ public static PluginDescriptor getPluginDescriptorByPluginId(String pluginId) {
358
339
return null ;
359
340
}
360
341
361
- private static PluginDescriptor getPluginDescriptorByClassName (String clazzName ) {
342
+ public static PluginDescriptor getPluginDescriptorByClassName (String clazzName ) {
362
343
Iterator <PluginDescriptor > itr = sInstalledPlugins .values ().iterator ();
363
344
while (itr .hasNext ()) {
364
345
PluginDescriptor descriptor = itr .next ();
0 commit comments