02-05-2014 05:11 PM
My Java application needs to access a database that was created by a WebWorks built application. From what I see WebWorks applications encrypt their databases using the code signing keys automatically. When I first tried to read the database it said that it was encrypted, as in IOException: Headers are encrypted. Since then I have installed the same code signing keys in my Eclipse IDE and have signed the java application with the same keys used by the WebWorks application. I still seem to get an IOException error, but this time it does not state the exact error.
Quite simply I need to use the same database created in the WebWorks application in my Java application. Is this possible if I am using the same code signing keys for both applications? Or does WebWorks use a totally different algorithm to encrypt database data as compared to Eclipse and therefore impossible to use the same database?
Thanks all for your help.
Solved! Go to Solution.
02-10-2014 10:27 AM
Yes, the DB is encrypted by default using the identity of the application (code signing keys and I believe in combination with the name of the app)
As well, the type of SQLite DB that is created from within a WebWorks app is different than that created from a Java app, which may be a conflict at play here.
Would you believe that it is a Google Gears DB !?
Yup, to provide legacy support to the BBOS 5.0 devices, which didn't have WebKit as the web rendering engine, Gears is the 'shim' in place here.
For the above reasons, I don't think its going to be possible for you to achieve what you're trying with SQLite DB. To share data between apps on BBOS, you would need to leverage another channel (e.g. encrypt data and save it to file system, or use your own remote web service + DB)
02-10-2014 06:28 PM
Thanks for the reply Adam. It finally answers related questions I have been posting on the various forums here and brings closure to a big problem we were having.
Just before your reply we decided to use a basic text file for intercommunication where I basically pass the data that I would have updated in the database using the background app to the UI which will do all the database processing. It's not as efficient as we wanted but the minor loss in performance means that at least it will work! This though creates a problem with having important data unencrypted and open for all to see.
So in relation to your point about encrypting, does the api used for webworks encryption use the same form of encryption as the api used for java encryption, based on using the code signing keys? I have been looking for which type of encryption is used for both since last week but cannot find what I am looking for as of yet.
Thanks for your time.