Skip to content

Commit

Permalink
Amend check for cordova-android 7
Browse files Browse the repository at this point in the history
  • Loading branch information
ReallySmallSoftware committed Apr 6, 2018
1 parent 4676bfc commit b3b7a93
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ AndroidManifest.xml is automatically updated to use the new MainActivity.
Based on cordova-android-fragments (https://github.com/rajivnarayana/CordovaFragments)

# History
## 0.0.6
- Fix stupid cordova-android 7 detection

## 0.0.5
- Attempt to avoid crash only seen on Galaxy J1 Ace (5.1.1)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-android-fragmentactivity",
"version": "0.0.5",
"version": "0.0.6",
"description": "An android plugin that provides a replacement activity to the default activity to start a cordova application with MainActivity as a Fragment Activity. Useful when you want to add native views on top of cordova webview.",
"cordova": {
"id": "cordova-plugin-android-fragmentactivity",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-android-fragmentactivity" version="0.0.5">
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-android-fragmentactivity" version="0.0.6">

<name>Cordova Android FragmentActivity Plugin</name>
<description>An android plugin that provides a replacement activity to the default activity to start a cordova application with MainActivity as a Fragment Activity. Useful when you want to add native views on top of cordova webview.</description>
Expand Down
16 changes: 8 additions & 8 deletions scripts/lib/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ module.exports = {
return null;
}

var androidPath = context.opts.projectRoot + '/platforms/android';
var androidPath = context.opts.projectRoot + '/platforms/android/app/src/main';

if (!fs.existsSync(androidPath)) {
androidPath = context.opts.projectRoot + '/platforms/android/app/src/main';
androidPath = context.opts.projectRoot + '/platforms/android';

if (!fs.existsSync(androidPath)) {
console.log("Unable to detect type of cordova-android application structure");
throw new Error("Unable to detect type of cordova-android application structure");
} else {
console.log("Detected cordova-android 7 application structure");
console.log("Detected pre cordova-android 7 application structure");
}
} else {
console.log("Detected pre cordova-android 7 application structure");
console.log("Detected cordova-android 7 application structure");
}

return androidPath;
Expand All @@ -43,19 +43,19 @@ module.exports = {
return null;
}

var androidPath = context.opts.projectRoot + '/platforms/android/src';
var androidPath = context.opts.projectRoot + '/platforms/android/app/src/main/java';

if (!fs.existsSync(androidPath)) {
androidPath = context.opts.projectRoot + '/platforms/android/app/src/main/java';
androidPath = context.opts.projectRoot + '/platforms/android/src';

if (!fs.existsSync(androidPath)) {
console.log("Unable to detect type of cordova-android application structure");
throw new Error("Unable to detect type of cordova-android application structure");
} else {
console.log("Detected cordova-android 7 application structure");
console.log("Detected pre cordova-android 7 application structure");
}
} else {
console.log("Detected pre cordova-android 7 application structure");
console.log("Detected cordova-android 7 application structure");
}

return androidPath;
Expand Down

0 comments on commit b3b7a93

Please sign in to comment.