Skip to content

Commit

Permalink
Remove uses-sdk from AndroidManifest.xml
Browse files Browse the repository at this point in the history
since uses-sdk values are now superseded by Gradle files

resolves apache#629
  • Loading branch information
Christopher J. Brody committed Feb 10, 2019
1 parent a6f30b6 commit 7452920
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
1 change: 0 additions & 1 deletion bin/lib/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ exports.create = function (project_path, config, options, events) {

var manifest = new AndroidManifest(path.join(project_template_dir, 'AndroidManifest.xml'));
manifest.setPackageId(package_name)
.setTargetSdkVersion(target_api.split('-')[1])
.getActivity().setName(safe_activity_name);

var manifest_path = path.join(app_path, 'AndroidManifest.xml');
Expand Down
25 changes: 0 additions & 25 deletions bin/templates/cordova/lib/AndroidManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,6 @@ AndroidManifest.prototype.getActivity = function () {
};
};

['minSdkVersion', 'maxSdkVersion', 'targetSdkVersion'].forEach(function (sdkPrefName) {
// Copy variable reference to avoid closure issues
var prefName = sdkPrefName;

AndroidManifest.prototype['get' + capitalize(prefName)] = function () {
var usesSdk = this.doc.getroot().find('./uses-sdk');
return usesSdk && usesSdk.attrib['android:' + prefName];
};

AndroidManifest.prototype['set' + capitalize(prefName)] = function (prefValue) {
var usesSdk = this.doc.getroot().find('./uses-sdk');

if (!usesSdk && prefValue) { // if there is no required uses-sdk element, we should create it first
usesSdk = new et.Element('uses-sdk');
this.doc.getroot().append(usesSdk);
}

if (prefValue) {
usesSdk.attrib['android:' + prefName] = prefValue;
}

return this;
};
});

AndroidManifest.prototype.getDebuggable = function () {
return this.doc.getroot().find('./application').attrib['android:debuggable'] === 'true';
};
Expand Down
3 changes: 0 additions & 3 deletions bin/templates/cordova/lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,6 @@ function updateProjectAccordingTo (platformConfig, locations) {
manifest.setVersionName(platformConfig.version())
.setVersionCode(platformConfig.android_versionCode() || default_versionCode(platformConfig.version()))
.setPackageId(androidPkgName)
.setMinSdkVersion(platformConfig.getPreference('android-minSdkVersion', 'android'))
.setMaxSdkVersion(platformConfig.getPreference('android-maxSdkVersion', 'android'))
.setTargetSdkVersion(platformConfig.getPreference('android-targetSdkVersion', 'android'))
.write();

// Java file paths shouldn't be hard coded
Expand Down

0 comments on commit 7452920

Please sign in to comment.