Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Commit

Permalink
feat(): Add support for cordova-android 7.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Miguel Besada Vidal committed Apr 6, 2018
1 parent cf2ee43 commit 823e704
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions hooks/lib/android/manifestWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ function writePreferences(cordovaContext, pluginPreferences) {
var cleanManifest;
var updatedManifest;

/**
* Cordova-Android 7.0+ FIX
*
* cordova-android 7.0+ changes the path to AndroidManifest
* So if manifestSource/manifestData is empty (or undefined) we assume is cordova-android 7.0+
* @see http://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html
*/
if (!manifestSource) {
pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'app', 'src', 'main', 'AndroidManifest.xml');
manifestSource = xmlHelper.readXmlAsJson(pathToManifest);
}

// remove old intent-filters
cleanManifest = removeOldOptions(manifestSource);

Expand Down

0 comments on commit 823e704

Please sign in to comment.