Skip to content

Commit 910c848

Browse files
committed
getIdentifier
1 parent 9e64b0f commit 910c848

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,16 @@ public int getIdentifier(String name, String defType, String defPackage) {
124124
// 判断是否在真的在宿主中
125125
Class rClass = null;
126126
try {
127-
rClass = this.getClass().getClassLoader().loadClass(packageName + ".R$" + type);
127+
String className = packageName + ".R$" + type;
128+
rClass = this.getClass().getClassLoader().loadClass(className);
128129
Field field = rClass.getDeclaredField(entry);
129-
if (field == null) {//不在宿主中,换成插件的
130+
if (field == null) {
131+
//不在宿主中,换成插件的
130132
packageName = mPluginDescriptor.getPackageName();
131133
}
132134
} catch (Exception e) {
135+
//不在宿主中,换成插件的
136+
packageName = mPluginDescriptor.getPackageName();
133137
}
134138
}
135139
return super.getIdentifier(entry, type, packageName);

0 commit comments

Comments
 (0)