{ "id": "123696", "key": "TIMOB-15981", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15719", "description": "2013 Sprint 26", "name": "2013 Sprint 26", "archived": true, "released": true, "releaseDate": "2014-01-03" }, { "id": "15721", "description": "2013 Sprint 26 Core", "name": "2013 Sprint 26 Core", "archived": true, "released": true, "releaseDate": "2014-01-03" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-12-16T08:18:42.000+0000", "created": "2013-12-13T10:57:08.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android-manifest", "module_build", "overwrite", "qe-testadded" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2014-03-13T18:06:45.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "In SDK version 3.2.0, every build replaces the AndroidManifest.xml entries. Even if we delete any 'permission' in the manifest which we don't require for example:\r\n{code}\r\n\r\n\r\n\r\n{code}\r\nIt again shows in the AndroidManifest.xml.\r\n\r\n*Steps To Reproduce*\r\n\r\n1. Create a Titanium project and build it for android device.\r\n\r\n2. Copy the AndroidManifest.xml from build folder and paste it under /platform/android folder.\r\n\r\n3. Delete any permission let say {}.\r\n\r\n4. Again build the project and see that the deleted entry has regenerated again in the custom AndroidManifest.xml again. \r\n\r\n*Expected Behavior* : If we want to disable any of the permissions, we could do it by making custom androidManifest.xml as we did before SDK version 3.2.0\r\n\r\n*Note* : In 3.1.3, Custom AndoidManifest.xml is not being overwritten. Everything works fine as expected.", "attachment": [], "flagged": false, "summary": "Custom AndroidManifest.xml is being overwritten", "creator": { "name": "mpathak", "key": "mpathak", "displayName": "Meenakshi Pathak", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mpathak", "key": "mpathak", "displayName": "Meenakshi Pathak", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 3.2.0.v20131204220843, Android 4.1.2", "comment": { "comments": [ { "id": "284406", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5123\n3.2.x pull request: https://github.com/appcelerator/titanium_mobile/pull/5124", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2013-12-16T06:55:06.000+0000", "updated": "2013-12-16T06:55:06.000+0000" }, { "id": "284413", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In the new CLI, we add permissions that are needed for the code to run. If the CLI detects that a certain permission is needed, it will automatically be added, even if you omit it in your custom manifest. The custom android manifest also gets merged with a default one, and any custom manifest properties inside tiapp.xml. If there is a conflict, the value from tiapp.xml takes precedence.\n\nThere is a problem where the original custom manifest inside platform/android gets overwritten with the default one plus anything from the tiapp.xml. This should not happen, and the PRs mentioned should fix this issue.\n\nTo test that problem do the following:\n1. Build an android app once\n2. Copy the AndroidManifest from the build directory and place it in platform/android/AndroidManifest.xml\n3. Modify the custom manifest in step 2 to have \n{code}\n\n{code}\n4. Inside you tiapp.xml place the following in your android node:\n{code}\n \n \n \n \n \n{code}\n\nExpected:\nThe AndroidManifest inside the build directory should have android:minSdkVersion=\"10\" android:targetSdkVersion=\"10\" AND the custom AndroidManifest inside platform/android should remain UNCHANGED (with a value of android:minSdkVersion=\"11\" android:targetSdkVersion=\"11\"\n\nActual:\nThe custom android manifest in platform/android has android:minSdkVersion=\"10\" android:targetSdkVersion=\"10\"", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-16T08:18:32.000+0000", "updated": "2013-12-16T08:18:32.000+0000" }, { "id": "284428", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As per document:\n If there is a conflict between the custom manifest properties and the value from tiapp.xml, then tiapp.xml takes precedence.\n\nNow I followed the above mentioned step and got the same result.\n
I also tried with test app:\n\n{code}\nvar performAddressBookFunction = function(){\n\tvar win = Ti.UI.createWindow();\nvar table = Ti.UI.createTableView();\n\n// Repopulate contact data\nfunction reloadContacts() {\n var contacts = Ti.Contacts.getAllPeople();\n var data = [];\n for (var i = 0; i < contacts.length; i++) {\n var title = contacts[i].fullName;\n if (!title || title.length === 0) {\n title = \"(no name)\";\n }\n var row = Ti.UI.createTableViewRow({\n title: title\n });\n data.push(row);\n }\n table.data = data;\n}\n\nTi.Contacts.addEventListener('reload', function(e){\n alert('Reloading contacts. Your contacts were changed externally!');\n reloadContacts();\n});\n\n// initial call to populate contact data\nreloadContacts();\n\nwin.add(table);\nwin.open();\n};\nvar addressBookDisallowed = function(){Ti.API.info('Sorry not able to retrieve contacts');};\nif (Ti.Contacts.contactsAuthorization == Ti.Contacts.AUTHORIZATION_AUTHORIZED){\n performAddressBookFunction();\n} else if (Ti.Contacts.contactsAuthorization == Ti.Contacts.AUTHORIZATION_UNKNOWN){\n Ti.Contacts.requestAuthorization(function(e){\n if (e.success) {\n performAddressBookFunction();\n } else {\n \t\n addressBookDisallowed();\n }\n });\n} else {\n\t\n addressBookDisallowed();\n}\n{code}\n\nSteps to reproduce:\n1)Copy paste the code in app.js of new default classic app.\n2) Run the app.\n3) Copy the AndroidManifest from the build directory and place it in platform/android/AndroidManifest.xml\n4) Delete all the permissions from custom manifest file and run the app again.\n\nExpected Result:\n1) According to the CLI change app must run successfully but custom manifest file must not change.\n\nActual Result:\n1) App runs successfully but custom manifest file also changes. Automatically the removed permissions are added.\nThough the permissions are added from CLI as they are needed to run the code.\nBut then the custom manifest file must not change.\n\nSame code when ran with 3.1.3.GA and 3.1.2.GA using the custom manifest without \nadding any permissions then we get run time error with message permission denied.\n\nTested Environment:\n\nAppcelerator Studio: 3.2.0.201312151544\nSDK:3.2.0.v20131215211321\nalloy: 1.3.0-cr\nacs: 1.0.10\nnpm: 1.3.2\ntitanium: 3.2.0-cr3\ntitanium-code-processor: 1.1.0-cr2\nXcode:5.0.2\nOS: Mac OSX 10.9\nDevice: Google Nexus7(v4.3)", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-16T12:17:10.000+0000", "updated": "2013-12-16T12:17:10.000+0000" }, { "id": "284443", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Build failed. Please retry with SDK with SHA https://github.com/appcelerator/titanium_mobile/commit/2a93aca76a566c14e07ea0f42b6e349c9e2a93cb or later.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-16T15:33:17.000+0000", "updated": "2013-12-16T15:33:17.000+0000" }, { "id": "284634", "author": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix. The custom androidmanifest.xml in \"platform/android\" does not change after building the app.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppcel Studio : 3.2.0.201312151544\r\nTi SDK : 3.2.0.v20131216064236\r\nMac OSX : 10.8.5\r\nAlloy : 1.3.0-cr\t\r\nCLI - 3.2.0-cr3\r\nSamsung Galaxy S4 running android 4.2.2\r\n\r\n", "updateAuthor": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-17T00:40:17.000+0000", "updated": "2013-12-17T00:40:17.000+0000" }, { "id": "284794", "author": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tested and can still reproduce the issue. Here are my environment details:\n\nTitanium SDK version: 3.2.0.v20131216191854\nCLI version: 3.2.0-cr3\nTitanium Studio: 3.2.0.201312162209\nNexus 4, Android 4.4", "updateAuthor": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-17T18:23:17.000+0000", "updated": "2013-12-17T18:23:17.000+0000" }, { "id": "284799", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~btran], which issue were you able to reproduce? The original one in the ticket is not a bug, but a new feature with the CLI. It forces some of the permissions back if it detects that the app uses it.\n\nDoes the AndroidManifest.xml inside platform/android get modified? If so, could you provide more details on what you did.\n\nThanks.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-17T18:39:24.000+0000", "updated": "2013-12-17T18:39:24.000+0000" }, { "id": "284843", "author": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "body": "My mistake, I am no longer able to reproduce the problem", "updateAuthor": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-17T20:38:05.000+0000", "updated": "2013-12-17T20:38:05.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }