Skip to content

Commit b59a489

Browse files
committed
Rename file
1 parent d401650 commit b59a489

File tree

6 files changed

+324
-123
lines changed

6 files changed

+324
-123
lines changed

PluginCore/src/com/plugin/core/PluginContextTheme.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class PluginContextTheme extends PluginBaseContextWrapper {
2424
Resources mResources;
2525
private final ClassLoader mClassLoader;
2626

27-
private final PluginDescriptor mPluginDescriptor;
27+
protected final PluginDescriptor mPluginDescriptor;
2828

2929
public PluginContextTheme(PluginDescriptor pluginDescriptor, Context base, Resources resources, ClassLoader classLoader) {
3030
super(base);
@@ -115,7 +115,10 @@ private void initializeTheme() {
115115
public String getPackageName() {
116116
//如果是独立插件 返回插件本身的packageName
117117
//但是只返回插件本身的packageName可能会引起其他问题
118-
//例如1、会导致toast无法弹出,原因是toast弹出时会检查packageName是否时当前用户的
118+
//例如:
119+
//1、会导致toast无法弹出,原因是toast弹出时会检查packageName是否时当前用户的
120+
//2、会导致NotificationManager发送通知时crash、原因同上
121+
//还有其他等等
119122
//if (mPluginDescriptor.isStandalone()) {
120123
// return mPluginDescriptor.getPackageName();
121124
//} else {

PluginCore/src/com/plugin/core/PluginLoader.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@
3131
import com.plugin.core.manager.PluginCallback;
3232
import com.plugin.core.manager.PluginManager;
3333
import com.plugin.util.LogUtil;
34-
import com.plugin.util.ManifestParser;
3534
import com.plugin.util.FileUtil;
3635
import com.plugin.util.PackageVerifyer;
37-
import com.plugin.util.RefInvoker;
3836

3937
import dalvik.system.DexClassLoader;
4038

@@ -185,7 +183,7 @@ public static synchronized int installPlugin(String srcPluginFile) {
185183
}
186184

187185
// 第2步,解析Manifest,获得插件详情
188-
PluginDescriptor pluginDescriptor = ManifestParser.parseManifest(srcPluginFile);
186+
PluginDescriptor pluginDescriptor = PluginManifestParser.parseManifest(srcPluginFile);
189187
if (pluginDescriptor == null || TextUtils.isEmpty(pluginDescriptor.getPackageName())) {
190188
LogUtil.e("解析插件Manifest文件失败", srcPluginFile);
191189
new File(srcPluginFile).delete();

PluginCore/src/com/plugin/util/ManifestParser.java renamed to PluginCore/src/com/plugin/core/PluginManifestParser.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
package com.plugin.util;
1+
package com.plugin.core;
22

33
import android.app.Application;
44
import android.content.pm.ActivityInfo;
55

6+
import com.plugin.content.PluginActivityInfo;
7+
import com.plugin.content.PluginDescriptor;
8+
import com.plugin.content.PluginIntentFilter;
9+
import com.plugin.content.PluginProviderInfo;
10+
import com.plugin.util.LogUtil;
11+
import com.plugin.util.ManifestReader;
12+
13+
import org.xmlpull.v1.XmlPullParser;
14+
import org.xmlpull.v1.XmlPullParserException;
15+
import org.xmlpull.v1.XmlPullParserFactory;
16+
617
import java.io.File;
718
import java.io.IOException;
819
import java.io.StringReader;
@@ -11,17 +22,7 @@
1122
import java.util.zip.ZipEntry;
1223
import java.util.zip.ZipFile;
1324

14-
import org.xmlpull.v1.XmlPullParser;
15-
import org.xmlpull.v1.XmlPullParserException;
16-
import org.xmlpull.v1.XmlPullParserFactory;
17-
18-
import com.plugin.content.PluginActivityInfo;
19-
import com.plugin.content.PluginDescriptor;
20-
import com.plugin.content.PluginIntentFilter;
21-
import com.plugin.content.PluginProviderInfo;
22-
import com.plugin.core.PluginLoader;
23-
24-
public class ManifestParser {
25+
public class PluginManifestParser {
2526

2627
public static PluginDescriptor parseManifest(String pluginPath) {
2728

0 commit comments

Comments
 (0)