{ "id": "128029", "key": "TIMOB-16678", "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": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-09-19T21:35:25.000+0000", "created": "2014-03-22T11:15:46.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "file", "parity", "read" ], "versions": [ { "id": "15922", "description": "2014 Sprint 03", "name": "2014 Sprint 03", "archived": true, "released": true, "releaseDate": "2014-02-14" } ], "issuelinks": [ { "id": "36039", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "63110", "key": "TIMOB-2478", "fields": { "summary": "Tooling: Allow Excluding JS files from Compilation", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "36038", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "128030", "key": "AC-1003", "fields": { "summary": "Android: Empty value when reading a resource directory js file", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "57978", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "174522", "key": "TIMOB-27646", "fields": { "summary": "iOS: Ti.Filesystem.File.getDirectoryListing() doesn't return encrypted JS files", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-12-09T19:11:20.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": "*Summary:*\r\n{{File.read()}} is unable to read encrypted assets such as {{.js}} files. This only happens when doing a device build or production build. It can only read {{.js}} files from the \"Resources\" directory when building for the Android Emulator (aka: \"development\" build) since {{.js}} files are not encrypted in this case.\r\n\r\niOS is able to successfully read encrypted assets such as {{.js}}.\r\n\r\n*Steps to Reproduce:*\r\n# Create a Titanium app with the below code for it's \"app.js\".\r\n# Build and run on the Android emulator.\r\n# Notice that the alert dialog displays the \"app.js\" code. (This is good.)\r\n# Build and run on a physical Android device.\r\n# Notice that the alert dialog on startup is empty. (This is bad. Failed to read \"app.js\".)\r\n\r\n{code:javascript}\r\nvar file = Ti.Filesystem.getFile(\"app.js\");\r\nalert(file.read().text);\r\n{code}\r\n\r\n*Expected Result:*\r\nAndroid should be able to read encrypted {{.js}} files just like iOS.\r\n\r\n----\r\n*Original description from Alejandro:*\r\nYou have a .js file at Resources/lib named library.js with content:\r\n{code:javascript}\r\nvar a = \"hello world\";\r\n{code}\r\n\r\nif you try read the file like a text plain file\r\n{code:javascript}\r\nvar value = Ti.Filesystem.getFile(Ti.Filesystem.getResourcesDirectory(), \"lib/library.js\").read().toString();\r\n{code}\r\n\r\nvalue should be {{var a = \\\"hello world\\\";}}, but value is empty -> \"\".\r\nif you change library.js to library.lib or other extension is fine.\r\n", "attachment": [], "flagged": false, "summary": "Android: File.read() of JS files under Resources directory returns empty string for device/production builds", "creator": { "name": "afcarrera", "key": "afcarrera", "displayName": "Alejandro F. Carrera", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "afcarrera", "key": "afcarrera", "displayName": "Alejandro F. Carrera", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1073, "state": "closed", "name": "2018 Sprint 19 SDK", "startDate": "2018-09-09T21:02:56.422Z", "endDate": "2018-09-23T21:02:00.000Z", "completeDate": "2018-09-23T22:28:10.932Z", "originBoardId": 114 }, { "id": 1058, "state": "closed", "name": "2018 Sprint 16 SDK", "startDate": "2018-07-29T22:26:06.486Z", "endDate": "2018-08-12T22:26:00.000Z", "completeDate": "2018-08-13T17:38:16.757Z", "originBoardId": 114 }, { "id": 1065, "state": "closed", "name": "2016 Sprint 17 SDK", "startDate": "2018-08-13T17:39:36.846Z", "endDate": "2018-08-27T17:39:00.000Z", "completeDate": "2018-08-29T16:10:57.013Z", "originBoardId": 114 }, { "id": 1053, "state": "closed", "name": "2018 Sprint 15 SDK", "startDate": "2018-07-15T21:52:05.453Z", "endDate": "2018-07-29T21:52:00.000Z", "completeDate": "2018-07-29T22:25:11.723Z", "originBoardId": 114 }, { "id": 1070, "state": "closed", "name": "2018 Sprint 18 SDK", "startDate": "2018-08-26T16:14:35.297Z", "endDate": "2018-09-09T16:14:00.000Z", "completeDate": "2018-09-11T20:59:21.495Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "298526", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Resolving this ticket as a duplicate of TIMOB-2478.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-25T04:42:14.000+0000", "updated": "2014-03-25T04:42:14.000+0000" }, { "id": "415108", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate and links to the related ticket have been provided above.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T22:18:09.000+0000", "updated": "2017-03-22T22:18:09.000+0000" }, { "id": "439287", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening since this is a legit issue.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-07-18T02:53:53.000+0000", "updated": "2018-07-18T02:53:53.000+0000" }, { "id": "439290", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10112", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-07-18T04:51:37.000+0000", "updated": "2018-07-18T04:51:37.000+0000" }, { "id": "439291", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The diff can be found here...\r\nhttps://github.com/appcelerator/titanium_mobile/pull/10112/commits/aa83bf58d393c74a5fbef8ee3d4feeff4b7a06fa\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-07-18T04:52:30.000+0000", "updated": "2018-07-18T04:52:30.000+0000" }, { "id": "441666", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\n\r\n{{File.read()}} can successfully read encrypted {{.js}} files from Resources directory when built for device.\r\n\r\nStudio Ver: 5.1.1.201809051655\r\nSDK Ver: 7.5.0 local build\r\nOS Ver: 10.13.5\r\nXcode Ver: Xcode 9.4.1\r\nAppc NPM: 4.2.13\r\nAppc CLI: 7.0.6\r\nDaemon Ver: 1.1.3\r\nTi CLI Ver: 5.1.1\r\nAlloy Ver: 1.13.2\r\nNode Ver: 8.9.1\r\nNPM Ver: 5.5.1\r\nJava Ver: 10.0.2\r\nDevices: ⇨ google Nexus 5 (Android 6.0.1)\r\n ⇨ google Nexus 6P (Android 8.1.0)\r\nEmulator: ⇨ Android 4.1.2, Android 8.1\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-18T22:17:07.000+0000", "updated": "2018-09-18T22:17:07.000+0000" }, { "id": "441821", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-19T21:35:21.000+0000", "updated": "2018-09-19T21:35:21.000+0000" }, { "id": "442410", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix on SDK 7.5.0.v20181004095510. Works fine. Closing.\r\n{code}\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.13.6\r\n Architecture = 64bit\r\nNode.js\r\n Node.js Version = 8.9.1\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\nTitanium SDK\r\n SDK Version =7.5.0.v20181004095510\r\nDevice\t\t\t =Oneplus 5T Android 8\r\n\t\t\t\t\tPixel android 6 emulator \r\n{code}", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-10-08T17:11:04.000+0000", "updated": "2018-10-08T17:11:04.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }