{ "id": "149926", "key": "TIMOB-19262", "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": "16925", "description": "WatchKit Support--all going into 5.0 now", "name": "Release 5.0.0", "archived": true, "released": true, "releaseDate": "2015-09-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-08-19T09:13:46.000+0000", "created": "2015-07-28T17:39:03.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "database", "sqlite" ], "versions": [], "issuelinks": [ { "id": "49626", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "148978", "key": "TIMOB-19206", "fields": { "summary": "Android: Encrypted Database: Not being able to read installed database", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "48565", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "140497", "key": "MOD-2076", "fields": { "summary": "iOS: Rebuild Encrypted Database for 64-bit support", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-31T22:16:53.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h6.Issue Description\r\nJust picked up the latest version of the encrypted DB module from the dashboard (1.1.4) and upgraded our app. However the module is unable to access the DB. We get the error : \r\n(SQLite #26: file is encrypted or is not a database) \r\n\r\nh6.Expected behavior\r\nThe new version of the module should be able to open the older DB with same secret. \r\n\r\nh6.Steps to Replicate: \r\n1. Grab sample code and throw it to app.js \r\n2. Run the app with the DB module version 1.0.0 - Alert is shown - Fetched : 1 \r\n3. Change the version of module to 1.1.4 in tiapp.xml \r\n4. Run the app again - Error is seen - The DB cannot be accessed \r\n\r\nh6.Test Case\r\n{code}\r\nvar dbobj = require(\"appcelerator.encrypteddatabase\");\r\nvar instance = null;\r\n\r\nfunction init() {\r\n\tdbobj.setPassword('secret');\r\n\tTi.API.info(\"Opening DB...\");\r\n\tinstance = dbobj.open('test.db');\t\t\r\n}\r\n\r\nfunction setup() {\r\n\tinstance.execute(\"CREATE TABLE IF NOT EXISTS testtable(id integer PRIMARY KEY);\");\r\n\tinstance.execute(\"INSERT OR IGNORE INTO testtable(id) VALUES (1);\");\r\n}\r\n\r\nfunction fetch() {\r\n\tvar rowValue = null;\r\n\tvar rowHandle = instance.execute(\"SELECT * FROM testtable;\");\r\n\tif (rowHandle.isValidRow()) {\r\n\t\trowValue = rowHandle.fieldByName('id');\r\n\t}\r\n\talert(\"Fetched Data: \" + rowValue);\r\n}\r\n\r\n\r\ninit();\r\nsetup();\r\nfetch();\r\n{code}\r\n\r\nh6.Logs\r\n{code}\r\n-- Start simulator log -------------------------------------------------------\r\n[INFO] Application started\r\n[INFO] AppcDevPushTest/1.0 (4.0.0.9239ff9)\r\n[INFO] Opening DB...\r\n[ERROR] A SQLite database error occurred on database '/Users/egomez/Library/Developer/CoreSimulator/Devices/7144027B-9501-4AD8-B17E-D6797EF0BCE6/data/Containers/Data/Application/0ADB425C-2E78-4247-A1AB-CE977A6450FF/Library/Private Documents/test.db.sql': Error Domain=com.plausiblelabs.EncPLDatabase Code=3 \"An error occured parsing the provided SQL statement.\" UserInfo=0x78e644e0 {com.plausiblelabs.EncPLDatabase.error.vendor.code=26, com.plausiblelabs.EncPLDatabase.error.vendor.string=file is encrypted or is not a database, NSLocalizedDescription=An error occured parsing the provided SQL statement., com.plausiblelabs.EncPLDatabase.error.query.string=CREATE TABLE IF NOT EXISTS testtable(id integer PRIMARY KEY);} (SQLite #26: file is encrypted or is not a database) (query: 'CREATE TABLE IF NOT EXISTS testtable(id integer PRIMARY KEY);')\r\n[ERROR] Script Error {\r\n[ERROR] column = 21;\r\n[ERROR] line = 8;\r\n[ERROR] message = \"invalid SQL statement\";\r\n[ERROR] nativeLocation = \"-[AppceleratorEncrypteddatabaseDBProxy execute:] (AppceleratorEncrypteddatabaseDBProxy.m:128)\";\r\n[ERROR] nativeReason = \"Error Domain=com.plausiblelabs.EncPLDatabase Code=3 \\\"An error occured parsing the provided SQL statement.\\\" UserInfo=0x78e644e0 {com.plausiblelabs.EncPLDatabase.error.vendor.code=26, com.plausiblelabs.EncPLDatabase.error.vendor.string=file is encrypted or is not a database, NSLocalizedDescription=An error occured parsing the provided SQL statement., com.plausiblelabs.EncPLDatabase.error.query.string=CREATE TABLE IF NOT EXISTS testtable(id integer PRIMARY KEY);}\";\r\n[ERROR] sourceURL = \"file:///Users/egomez/Library/Developer/CoreSimulator/Devices/7144027B-9501-4AD8-B17E-D6797EF0BCE6/data/Containers/Bundle/Application/2B0B25BF-3F5D-45A0-9C77-A9D120F654F1/AppcDevPushTest.app/app.js\";\r\n[ERROR] stack = \"[native code]\\nsetup@file:///Users/egomez/Library/Developer/CoreSimulator/Devices/7144027B-9501-4AD8-B17E-D6797EF0BCE6/data/Containers/Bundle/Application/2B0B25BF-3F5D-45A0-9C77-A9D120F654F1/AppcDevPushTest.app/app.js:8:21\\nglobal code@file:///Users/egomez/Library/Developer/CoreSimulator/Devices/7144027B-9501-4AD8-B17E-D6797EF0BCE6/data/Containers/Bundle/Application/2B0B25BF-3F5D-45A0-9C77-A9D120F654F1/AppcDevPushTest.app/app.js:27:6\";\r\n[ERROR] } \r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Encrypted Database Module: SQLite #26: file is encrypted or is not a database", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Encrypted Database 1.1.4\r\nTiSDK 4.0.0.GA & 4.1.0.GA\r\niOS 8", "closedSprints": [ { "id": 464, "state": "closed", "name": "2015 Sprint 17 SDK", "startDate": "2015-08-15T00:30:59.243Z", "endDate": "2015-08-29T00:30:00.000Z", "completeDate": "2015-08-31T08:10:47.969Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "360026", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~ewieber], That's odd. Mine works fine on 8.4. Also tried using titanium cli and appc cli.\r\nTi SDK 4.1.0.GA and 4.1.1\r\ntitanium CLI 4.1.4\r\nAppc CLI 4.2.0-51\r\n[~egomez], yours worked too right?\r\nNevertheless, I replaced the module zip file with a new built. Check it out again?", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-08-17T07:24:46.000+0000", "updated": "2015-08-17T07:24:46.000+0000" }, { "id": "360127", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Latest zip works for me, same setup as [~cng]. Waiting for [~ewieber] to test before merging.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-08-17T23:33:29.000+0000", "updated": "2015-08-17T23:33:29.000+0000" }, { "id": "360211", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Tried again, using:\r\n\r\nMacOS 10.11\r\nStudio 4.2.0.201508062204\r\nTi SDK 4.1.1.v20150816214206\r\nAppc NPM 4.1.0-2\r\nAppc CLI 4.1.3-2\r\nTi CLI 4.0.1\r\nAlloy 1.6.2\r\nNode v0.10.37\r\nJava 1.7.0_45\r\npreproduction\r\nXcode 6.4 (6E35b)\r\n\r\nI now get the {{Fetched Data: 1}} alert with the 1.2.0 module, on iOS 8.4 sims and iOS 8.1 devices.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-08-18T17:23:10.000+0000", "updated": "2015-08-18T17:23:10.000+0000" }, { "id": "360286", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "yay. Thanks [~ewieber], merge it now [~hansknoechel].", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-08-19T01:55:54.000+0000", "updated": "2015-08-19T01:55:54.000+0000" }, { "id": "368371", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~cng] can you please work with [~pkclark] to publish this?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-29T23:34:48.000+0000", "updated": "2015-10-29T23:34:48.000+0000" }, { "id": "368386", "author": { "name": "pclark", "key": "pkclark", "displayName": "Patrick Clark", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~cng] just need the file and version info to drop into the manifest and get out on S3. Shoot me the file in an APPTS ticket AYC.", "updateAuthor": { "name": "pclark", "key": "pkclark", "displayName": "Patrick Clark", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-30T01:47:29.000+0000", "updated": "2015-10-30T01:47:29.000+0000" }, { "id": "416576", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed, if there are any problems, please file a new ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-31T22:16:53.000+0000", "updated": "2017-03-31T22:16:53.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }