mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
CB-5481 Fix for Cordova trying to get config.xml from the wrong namespace
This commit is contained in:
parent
e646a0840d
commit
28c10dba09
@ -68,10 +68,15 @@ public class Config {
|
||||
return;
|
||||
}
|
||||
|
||||
// First checking the class namespace for config.xml
|
||||
int id = action.getResources().getIdentifier("config", "xml", action.getClass().getPackage().getName());
|
||||
if (id == 0) {
|
||||
LOG.i("CordovaLog", "config.xml missing. Ignoring...");
|
||||
return;
|
||||
// If we couldn't find config.xml there, we'll look in the namespace from AndroidManifest.xml
|
||||
id = action.getResources().getIdentifier("config", "xml", action.getPackageName());
|
||||
if (id == 0) {
|
||||
LOG.i("CordovaLog", "config.xml missing. Ignoring...");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Add implicitly allowed URLs
|
||||
|
@ -110,11 +110,16 @@ public class PluginManager {
|
||||
* Load plugins from res/xml/config.xml
|
||||
*/
|
||||
public void loadPlugins() {
|
||||
// First checking the class namespace for config.xml
|
||||
int id = this.ctx.getActivity().getResources().getIdentifier("config", "xml", this.ctx.getActivity().getClass().getPackage().getName());
|
||||
if (id == 0) {
|
||||
this.pluginConfigurationMissing();
|
||||
//We have the error, we need to exit without crashing!
|
||||
return;
|
||||
// If we couldn't find config.xml there, we'll look in the namespace from AndroidManifest.xml
|
||||
id = this.ctx.getActivity().getResources().getIdentifier("config", "xml", this.ctx.getActivity().getPackageName());
|
||||
if (id == 0) {
|
||||
this.pluginConfigurationMissing();
|
||||
//We have the error, we need to exit without crashing!
|
||||
return;
|
||||
}
|
||||
}
|
||||
XmlResourceParser xml = this.ctx.getActivity().getResources().getXml(id);
|
||||
int eventType = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user