|
12 | 12 | import android.os.IBinder;
|
13 | 13 | import android.os.UserHandle;
|
14 | 14 |
|
| 15 | +import com.plugin.content.PluginDescriptor; |
15 | 16 | import com.plugin.core.annotation.AnnotationProcessor;
|
16 | 17 | import com.plugin.core.annotation.ComponentContainer;
|
17 | 18 | import com.plugin.core.viewfactory.PluginViewFactory;
|
@@ -55,28 +56,30 @@ public Activity newActivity(ClassLoader cl, String className, Intent intent) thr
|
55 | 56 |
|
56 | 57 | String action = intent.getAction();
|
57 | 58 | if (action != null && action.contains(PluginIntentResolver.CLASS_SEPARATOR)) {
|
58 |
| - |
59 | 59 | String[] targetClassName = action.split(PluginIntentResolver.CLASS_SEPARATOR);
|
| 60 | + String pluginClassName = targetClassName[0]; |
60 | 61 |
|
61 |
| - LogUtil.d(className, action, targetClassName[0]); |
62 |
| - |
63 |
| - String tempclassName = targetClassName[0]; |
64 |
| - Class clazz = PluginLoader.loadPluginClassByName(tempclassName); |
| 62 | + Class clazz = PluginLoader.loadPluginClassByName(pluginClassName); |
65 | 63 | if (clazz != null) {
|
66 |
| - className = tempclassName; |
| 64 | + className = pluginClassName; |
67 | 65 | cl = clazz.getClassLoader();
|
68 | 66 |
|
69 | 67 | intent.setExtrasClassLoader(cl);
|
70 |
| - |
71 |
| - //之前为了传递classNae,intent的action被修改过 这里再把Action还原到原始的Action |
72 | 68 | if (targetClassName.length >1) {
|
| 69 | + //之前为了传递classNae,intent的action被修改过 这里再把Action还原到原始的Action |
73 | 70 | intent.setAction(targetClassName[1]);
|
74 | 71 | } else {
|
75 | 72 | intent.setAction(null);
|
76 | 73 | }
|
77 | 74 | //添加一个标记符
|
78 | 75 | intent.addCategory(RELAUNCH_FLAG + className);
|
79 | 76 | }
|
| 77 | + } else if (PluginStubBinding.isExact(className, PluginDescriptor.ACTIVITY)) { |
| 78 | + //这个逻辑是为了支持外部app唤起配置了stub_exact的插件Activity |
| 79 | + Class clazz = PluginLoader.loadPluginClassByName(className); |
| 80 | + if (clazz != null) { |
| 81 | + cl = clazz.getClassLoader(); |
| 82 | + } |
80 | 83 | } else {
|
81 | 84 | //进入这个分支可能是因为activity重启了,比如横竖屏切换,由于上面的分支已经把Action还原到原始到Action了
|
82 | 85 | //这里只能通过之前添加的标记符来查找className
|
|
0 commit comments