Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16088] Android: Remove lines from Android manifest that are autogenerated

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-01-03T19:38:42.000+0000
Affected Version/sRelease 3.2.0
Fix Version/s2013 Sprint 26, 2013 Sprint 26 Core, Release 3.2.1, Release 3.3.0
ComponentsAndroid
Labelsmodule_build, qe-testadded
ReporterRadamantis Torres-Lechuga
AssigneeChris Barber
Created2013-12-26T21:29:45.000+0000
Updated2014-03-07T01:44:06.000+0000

Description

Comments

  1. Ingo Muschenetz 2013-12-26

    I'm not 100% sure what you mean by new functionality described in TIMOB-15981. You just want to remove those lines from the auto generated manifest, yes?
  2. Radamantis Torres-Lechuga 2013-12-26

    Yes, if the customer remove those lines from the custom Android Manifest, somehow, after build the project the lines are there again
  3. Allen Yeung 2013-12-28

    Added a config to disable the auto-merging behavior called 'android.skipCustomManifestMerge'. To test: 1. On the command, set the property to true: 'ti config android.skipCustomManifestMerge true' 2. Create a project with a custom manifest inside platform/android 3. Build the project 4. Verify that the android manifest inside the build directory is the exact same as the custom manifest Master PR: https://github.com/appcelerator/titanium_mobile/pull/5169 3_2_X PR: https://github.com/appcelerator/titanium_mobile/pull/5170
  4. Chris Barber 2013-12-28

    WRITE_EXTERNAL_STORAGE is apart of the required permissions. This has been the default behavior for nearly 4 years. Maybe these required permissions are handled differently in Titanium 3.1 and older when a custom AndroidManifest.xml is present? As far as the "org.appcelerator.titanium.analytics.TiAnalyticsService" service, it is trivial to detect if analytics is enabled and if not, don't add that line. That is a bug. I don't see why adding a "android.skipCustomManifestMerge" is the correct way to solve this. I propose we close PR 5169 and 5170 and properly fix the bug with the TiAnalyticsService being added when analytics is not enabled.
  5. Ingo Muschenetz 2013-12-28

    Could you add an attribute into the manifest XML indicating this section is not to be altered?
  6. Chris Barber 2013-12-28

    To fix this ticket, here's what we're going to do: 1. Only add the TiAnalyticsService to the AndroidManifest.xml if and only if analytics are enabled in the tiapp.xml 2. Only add the WRITE_EXTERNAL_STORAGE permission to the AndroidManifest.xml if and only if the deploy type is development OR debugging is enabled 3. Create a CLI plugin hook when the AndroidManifest.xml is being assembled that allows a plugin to modify the AndroidManifest XML DOM after the merging has occurred and before the file is written. It will be possible for a plugin to force the custom AndroidManifest.xml without any of the merged settings from the default AndroidManifest.xml or tiapp.xml.
  7. Chris Barber 2013-12-30

    Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5172 3.2.x pull request: https://github.com/appcelerator/titanium_mobile/pull/5173
  8. Allen Yeung 2014-01-03

    To test: 1. Create a project with a custom manifest inside platform/android (make sure you omit the tag). 2. Build the app, and verify that the tag mentioned above does not exist in the android manifest under the build directory. 3. Type 'ti config android.mergeCustomAndroidManifest true' to enable manifest merging 4. Clean and build the project again 5. Verify that the external storage tag exists in the android manifest under the build directory.
  9. Allen Yeung 2014-01-03

    Follow up PR Master: https://github.com/appcelerator/titanium_mobile/pull/5185 3_2_X: https://github.com/appcelerator/titanium_mobile/pull/5186
  10. Priya Agarwal 2014-01-07

    Observations: Steps followed as mentioned above: 1. Create a project with a custom manifest inside platform/android (make sure you omit the tag). 2. Build the app, and verify that the tag mentioned above does not exist in the android manifest under the build directory. 
3. Type 'ti config android.mergeCustomAndroidManifest true' to enable manifest merging
 4. Clean and build the project again 
5. Verify that the external storage tag exists in the android manifest under the build directory. Test Environment: Appc-Studio: 3.2.1.201401061716 acs:1.0.11 alloy:1.3.1-beta npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.1.0 OSX: Maverick 10.9 using both sdk build:3.2.1.v20140106195644 and 3.3.0.v20140106195650 with ti config android.mergeCustomAndroidManifest true Above omitted lines gets merged with android manifest under the build directory. and with ti config android.mergeCustomAndroidManifest false Above omitted lines does not gets merged with android manifest under the build directory.
  11. Wilson Luu 2014-01-09

    Closing ticket as fixed. While following Allen's test steps and created a custom AndroidManifest.xml file that did not have these tags:
        <service android:name="org.appcelerator.titanium.analytics.TiAnalyticsService" android:exported="false"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        
    verified the following: 1. After building app to an Android device, verified the above tags do not appear in /build/android/AndroidManifest.xml 2. With *ti config android.mergeCustomAndroidManifest true*, verified TiAnalyticsService tag and WRITE_EXTERNAL_STORAGE tag appear in /build/android/AndroidManifest.xml 3. With *ti config android.mergeCustomAndroidManifest false*, verified TiAnalyticsService tag and WRITE_EXTERNAL_STORAGE tag *do not* appear in /build/android/AndroidManifest.xml *Also*, verified if analytics is set to false in the tiapp.xml (e.g. false), TiAnalyticsService tag does not appear in /build/android/AndroidManifest.xml Tested on: Appcelerator Studio, build: 3.2.1.201401071645 SDK build: 3.2.1.v20140106195644, 3.3.0.v20140106195650 CLI: 3.2.1-beta Alloy: 1.3.1-beta2 Device: Droid 3 (2.3.4), Samsung Galaxy S4 (4.2.2)

JSON Source