mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// First checking the class namespace for config.xml
|
||||||
int id = action.getResources().getIdentifier("config", "xml", action.getClass().getPackage().getName());
|
int id = action.getResources().getIdentifier("config", "xml", action.getClass().getPackage().getName());
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
LOG.i("CordovaLog", "config.xml missing. Ignoring...");
|
// If we couldn't find config.xml there, we'll look in the namespace from AndroidManifest.xml
|
||||||
return;
|
id = action.getResources().getIdentifier("config", "xml", action.getPackageName());
|
||||||
|
if (id == 0) {
|
||||||
|
LOG.i("CordovaLog", "config.xml missing. Ignoring...");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add implicitly allowed URLs
|
// Add implicitly allowed URLs
|
||||||
|
@ -110,11 +110,16 @@ public class PluginManager {
|
|||||||
* Load plugins from res/xml/config.xml
|
* Load plugins from res/xml/config.xml
|
||||||
*/
|
*/
|
||||||
public void loadPlugins() {
|
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());
|
int id = this.ctx.getActivity().getResources().getIdentifier("config", "xml", this.ctx.getActivity().getClass().getPackage().getName());
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
this.pluginConfigurationMissing();
|
// If we couldn't find config.xml there, we'll look in the namespace from AndroidManifest.xml
|
||||||
//We have the error, we need to exit without crashing!
|
id = this.ctx.getActivity().getResources().getIdentifier("config", "xml", this.ctx.getActivity().getPackageName());
|
||||||
return;
|
if (id == 0) {
|
||||||
|
this.pluginConfigurationMissing();
|
||||||
|
//We have the error, we need to exit without crashing!
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
XmlResourceParser xml = this.ctx.getActivity().getResources().getXml(id);
|
XmlResourceParser xml = this.ctx.getActivity().getResources().getXml(id);
|
||||||
int eventType = -1;
|
int eventType = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user