Crash on app update - built with different machine

Hi all,

Having a bit of a weird issue where my app is crashing after building an update with a new machine. If I build on the same machine and update there are no issues, the code is exactly the same (it’s in a repo) so I can’t figure out what would be causing this…

`07-19 15:09:22.207: E/AndroidRuntime(27799): FATAL EXCEPTION: main
07-19 15:09:22.207: E/AndroidRuntime(27799): Process: com.excointouch.mobilize.vec10737, PID: 27799
07-19 15:09:22.207: E/AndroidRuntime(27799): java.lang.RuntimeException: Unable to create application com.excointouch.mobilize.vec10737.vec10737Application: net.sqlcipher.database.SQLiteException: file is encrypted or is not a database
07-19 15:09:22.207: E/AndroidRuntime(27799): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4650)
07-19 15:09:22.207: E/AndroidRuntime(27799): at android.app.ActivityThread.access$1500(ActivityThread.java:157)
07-19 15:09:22.207: E/AndroidRuntime(27799): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1434)
07-19 15:09:22.207: E/AndroidRuntime(27799): at android.os.Handler.dispatchMessage(Handler.java:110)
07-19 15:09:22.207: E/AndroidRuntime(27799): at android.os.Looper.loop(Looper.java:193)
07-19 15:09:22.207: E/AndroidRuntime(27799): at android.app.ActivityThread.main(ActivityThread.java:5398)
07-19 15:09:22.207: E/AndroidRuntime(27799): at java.lang.reflect.Method.invokeNative(Native Method)
07-19 15:09:22.207: E/AndroidRuntime(27799): at java.lang.reflect.Method.invoke(Method.java:515)
07-19 15:09:22.207: E/AndroidRuntime(27799): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:940)
07-19 15:09:22.207: E/AndroidRuntime(27799): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
07-19 15:09:22.207: E/AndroidRuntime(27799): at dalvik.system.NativeStart.main(Native Method)
07-19 15:09:22.207: E/AndroidRuntime(27799): Caused by: net.sqlcipher.database.SQLiteException: file is encrypted or is not a database
07-19 15:09:22.207: E/AndroidRuntime(27799): at net.sqlcipher.database.SQLiteDatabase.native_setLocale(Native Method)
07-19 15:09:22.207: E/AndroidRuntime(27799): at net.sqlcipher.database.SQLiteDatabase.setLocale(SQLiteDatabase.java:2102)
07-19 15:09:22.207: E/AndroidRuntime(27799): at net.sqlcipher.database.SQLiteDatabase.(SQLiteDatabase.java:1968)
07-19 15:09:22.207: E/AndroidRuntime(27799): at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:901)
07-19 15:09:22.207: E/AndroidRuntime(27799): at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:948)
07-19 15:09:22.207: E/AndroidRuntime(27799): at net.sqlcipher.database.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:195)
07-19 15:09:22.207: E/AndroidRuntime(27799): at com.excointouch.mobilize.excocore.objects.Subject.load(Subject.java:304)
07-19 15:09:22.207: E/AndroidRuntime(27799): at com.excointouch.mobilize.excocore.objects.Subject.(Subject.java:73)
07-19 15:09:22.207: E/AndroidRuntime(27799): at com.excointouch.mobilize.excocore.MyApplication.getSubject(MyApplication.java:86)
07-19 15:09:22.207: E/AndroidRuntime(27799): at com.excointouch.mobilize.vec10737.vec10737Application.onCreate(vec10737Application.java:38)
07-19 15:09:22.207: E/AndroidRuntime(27799): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
07-19 15:09:22.207: E/AndroidRuntime(27799): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4647)
07-19 15:09:22.207: E/AndroidRuntime(27799): … 10 more

Thanks!
`

Hi @Emu76

Can you pull the database off the device and attempt to open it via the SQLCipher command line shell?

Thanks for the response, we decompiled and discovered the original app has a corrupted encryption key!

Hello @Emu76

Thank you for getting back to us, we are glad to hear you identified the issue. I would like to point out that we recommend against hard coding the encryption key within the application as it is trivial to decrypt an application in order to retrieve it.