{ "id": "167118", "key": "MOD-2332", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10034", "key": "MOD", "name": "Appcelerator Modules", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20086", "name": "Ti.EncryptedDatabase 3.0.0", "archived": false, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-02-11T16:38:06.000+0000", "created": "2017-04-14T21:53:43.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-06T17:49:28.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": "13609", "name": "Encrypted SQLite DB" } ], "description": "* update the SQLCipher library \r\n* handle blobs\r\n* fix loadLibs error:\r\n\r\nPR: https://github.com/appcelerator-modules/appcelerator.encrypteddatabase/pull/20\r\n\r\n{noformat}\r\n\r\n[WARN] W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File android.content.Context.getFilesDir()' on a null object reference\r\n[WARN] W/System.err: at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:169)\r\n[WARN] W/System.err: at appcelerator.encrypteddatabase.EncrypteddatabaseModule.open(EncrypteddatabaseModule.java:64)\r\n[WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)\r\n[WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:57)\r\n[WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:43)\r\n[WARN] W/System.err: at ti.modules.titanium.TitaniumModule$Timer.run(TitaniumModule.java:147)\r\n[WARN] W/System.err: at android.os.Handler.handleCallback(Handler.java:739)\r\n[WARN] W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)\r\n[WARN] W/System.err: at android.os.Looper.loop(Looper.java:158)\r\n[WARN] W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7231)\r\n[WARN] W/System.err: at java.lang.reflect.Method.invoke(Native Method)\r\n[WARN] W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)\r\n[WARN] W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)\r\n\r\n{noformat}\r\n", "attachment": [], "flagged": false, "summary": "Android: EncryptedDatabase - Fix \"loadLibs\" error, update SQLCipher to 3.5.7, handle Ti.Blob", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "417448", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Remove old files according to:\r\n\r\n{quote}If your previous usage of SQLCipher for Android was packaged as a zip archive that included 3 .so files per platform (i.e., libdatabase_sqlcipher.so, libsqlcipher_android.so, and libstlport_shared.so), you should remove all of those. Our new packaging will only include one .so file (i.e., libsqlcipher.so) for each native platform. In addition to the different native libraries, you should also remove the ICU zip file (i.e., icudt46l.zip) previously included within the assets directory of your application.{quote}\r\n\r\n\r\nTest code will follow!", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-14T21:58:57.000+0000", "updated": "2017-04-14T21:59:29.000+0000" }, { "id": "417458", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Thanks for submitting the request. Our engineers will look into it. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-04-15T08:11:37.000+0000", "updated": "2017-04-15T08:11:37.000+0000" }, { "id": "417462", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "*Testcase:*\r\n\r\n{code:java}\r\nvar dbobj = require(\"appcelerator.encrypteddatabase\");\r\nvar instance = null;\r\nvar dataTofetch = null;\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: \"#fff\"\r\n});\r\nvar img = Ti.UI.createImageView({\r\n\twidth: 100,\r\n\theight: 100\r\n});\r\nwin.add(img);\r\nvar blob = Ti.UI.createView({\r\n\twidth: 100,\r\n\theight: 100,\r\n\tbackgroundColor: \"red\"\r\n}).toImage();\r\n\r\nfunction init() {\r\n\tdbobj.setPassword('secret');\r\n\tTi.API.info(\"Opening DB...\");\r\n\tinstance = dbobj.open('test.db');\r\n}\r\n\r\nfunction setup() {\r\n\tinstance.execute(\"CREATE TABLE IF NOT EXISTS testtable(id integer PRIMARY KEY, image BLOB);\");\r\n\tinstance.execute(\"INSERT OR IGNORE INTO testtable(id,image) VALUES (?,?)\", 1, blob);\r\n}\r\n\r\nfunction insert() {\r\n\tvar dataToInsertHandle = instance.execute(\"SELECT id FROM testtable ORDER BY id DESC LIMIT 1;\");\r\n\tvar dataToInsert = null;\r\n\tif (dataToInsertHandle.isValidRow()) {\r\n\t\tdataToInsert = (dataToInsertHandle.fieldByName('id') + 1);\r\n\t\tdataTofetch = dataToInsert;\r\n\t}\r\n\tinstance.execute(\"INSERT OR IGNORE INTO testtable(id,image) VALUES (?,?)\", dataToInsert, blob);\r\n}\r\n\r\nfunction fetch() {\r\n\tvar rowValue = null;\r\n\tvar rowHandle = instance.execute(\"SELECT * FROM testtable WHERE id=\" + dataTofetch + \";\");\r\n\tif (rowHandle.isValidRow()) {\r\n\t\tconsole.log(rowHandle.fieldByName('id'));\r\n\t\tconsole.log(typeof rowHandle.fieldByName('image'));\r\n\t\timg.image = rowHandle.fieldByName('image');\r\n\t}\r\n}\r\ninit();\r\nsetup();\r\ninsert();\r\nfetch();\r\nwin.open();\r\n{code}\r\n\r\n*Output:*\r\n\r\nCurrent version 2.0.2:\r\n* typeof rowHandle.fieldByName('image') is \"String\" (before it was always applying toString to all elements, even blobs); \r\n* no red square is displayed (Could not open stream to get bitmap)\r\n\r\nPatched version 2.0.3: \r\n* typeof is object\r\n* red square is displayed", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-04-16T08:48:44.000+0000", "updated": "2017-04-16T08:48:44.000+0000" }, { "id": "417537", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested the above on an Android 7.0 device. It works.\r\n\r\nI've also tested loading an image file to a blob and verified that I could save/load it to/from database successfully.\r\n\r\n{code}\r\nvar blob = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, \"assets/images/AppcLogo.png\").read();\r\n{code}", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-17T23:15:31.000+0000", "updated": "2017-04-17T23:15:31.000+0000" }, { "id": "432146", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel] [~lchoudhary] I included these changes into version {{3.0.0}} of the module.", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-14T06:12:24.000+0000", "updated": "2017-12-14T06:12:24.000+0000" }, { "id": "440179", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:49:28.000+0000", "updated": "2018-08-06T17:49:28.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }