Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24459] Android: Can’t remove unused permissions from AndroidManifest.xml using Ti SDK 6.x

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-04-14T10:02:31.000+0000
Affected Version/sRelease 6.0.2
Fix Version/sRelease 6.1.0
ComponentsAndroid
Labelsandroid-manifest, module_build, qe-6.1.0, regression
ReporterDirlei Dionísio
AssigneeGary Mathews
Created2017-03-07T01:00:59.000+0000
Updated2018-02-09T01:26:04.000+0000

Description

In an Alloy project I have a custom AndroidManifest.xml at app/platform/android without any tags . In app/controllers/index.js I have this only line:
alert('hello world!');
On tiapp.xml I have:
<analytics>false</analytics>
and
    <android xmlns:android="http://schemas.android.com/apk/res/android">
        <abi>armeabi-v7a</abi>
    </android>
When I build with SDK 5.5.1 the resulted AndroidManifest.xml at build/android folder has no tags as expected. But when a build using any SDK >= 6.0, the resulted AndroidManifest.xml at build/android folder has this unused permissions:
	<uses-permission android:name="android.permission.INTERNET"/>
	<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
	<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
	<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
	<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
When I build for distribution, the three “ACCESS_” are removed from the manifest. It will be very appreciated if we can choose one of two options, maybe whith a special tag in tiapp.xml: 1) Having only permissions needed automatically added to final AndroidManifest.xml or 2) Indicating that we want to replace completely the final AndroidManifest.xml But none of them are possible using SDKs 6.x.

Comments

  1. Gary Mathews 2017-03-13

    master: https://github.com/appcelerator/titanium_mobile/pull/8881
  2. Josh Longton 2017-03-29

    {noformat} Mac OS Version : 10.12.3 Appc CLI : 6.1.0 Appc NPM : 4.2.9-1 Node : v4.6.0 Device: Nexus 5x(6.0.1) Pixel XL(7.1.2) Emulator: (6.0), (4.4.2) {noformat} Using above env passed FR. After merge, the changes are present in SDK 6.1.0.v20170328172120. *Closing*
  3. Eric Merriman 2017-04-13

    [~gmathews] can you also back port this to 6.0.4 and set the FixVersion when complete?

JSON Source