Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Highlighted
New Developer
Posts: 31
Registered: ‎09-20-2013
My Device: Z10
My Carrier: NA
Accepted Solution

Accessing a WebWorks application built database through a Java application

Hi all,

 

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.

Rob

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Accessing a WebWorks application built database through a Java application

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 !?

https://github.com/blackberry/WebWorks/blob/master/framework/src/js/html5_init.js#L586

 

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)

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Developer
Posts: 31
Registered: ‎09-20-2013
My Device: Z10
My Carrier: NA

Re: Accessing a WebWorks application built database through a Java application

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.