[TIMOB-25889] Android: Emulator builds should not add additional permissions
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-01-27T22:30:28.000+0000 |
Affected Version/s | Release 6.0.0 |
Fix Version/s | Release 9.0.0 |
Components | Android |
Labels | android, engSchedule, geolocation, manifest, permissions, tiapp |
Reporter | Rene Pot |
Assignee | Joshua Quick |
Created | 2018-03-20T16:35:17.000+0000 |
Updated | 2020-01-27T22:30:28.000+0000 |
Description
*Summary:*
When building with deployment type "development" (ie: for the Android emulator), the Titanium build system adds the following permissions to the "AndroidManifest.xml" file, even if they're not defined in the "tiapp.xml" file.
*
android.permission.ACCESS_COARSE_LOCATION
* android.permission.ACCESS_FINE_LOCATION
* android.permission.ACCESS_MOCK_LOCATION
The above behavior was intentional and was intended for fast incremental builds with LiveView and the emulator. However, this behavior has been known to cause confusion.
*To-Do:*
In Titanium 9.0.0, we should remove the above behavior. The build system should produce a consistent "AndroidManifest.xml" for all deployment types (ie: "test", "development", and "production").
*Note:*
Titanium should still include its default permissions listed below.
* android.permission.INTERNET
* android.permission.ACCESS_WIFI_STATE
* android.permission.ACCESS_NETWORK_STATE
* android.permission.WRITE_EXTERNAL_STORAGE
If you don't want the above default permissions injected, then you can set the following in your "tiapp.xml" file to override this behavior.
<ti:app xmlns:ti="http://ti.appcelerator.org">
<override-permissions>true</override-permissions>
</ti:app>
Attachments
File | Date | Size |
---|---|---|
AndroidManifest.xml | 2018-03-20T16:34:02.000+0000 | 2234 |
This is not a bug. A location permission will be automatically injected if:
You use the "Ti.Geolocation" API.
You include a module that injects/requires this permission.
When building with deploy-type "development". _(The default when building for the emulator.)_
I suspect #3 is happening to you above. Try building for a real device or for deploy-type "test". Or do a release/production build. As long as your app is not doing #1 and #2 above, the generated "AndroidManifest.xml" won't contain the location permissions.[~jquick] yep that indeed appears to be happening. It is not happening when I run the command you provided. Is there any reason for it to happen on dev builds though? I'll point the person who reported the issue to this ticket, asking if he can also reproduce what I can now. Thanks for checking it
To be honest, I don't know what the reasoning there is for this. And I agree that it's a bit confusing. The deploy-type of "development" and "test" is something that was inherited from the iOS build system where a simulator build *+is+* completely different than a mobile test build. On Android, it doesn't have to be this way (an APK is universal), but it was made this way to be consistent.
The user confirmed it is fixed also when doing the command provided. So unless this is unwanted to happen for development builds this ticket can be resolved
This task was completed by ticket [TIMOB-19300] for Titanium 9.0.0.