-
Notifications
You must be signed in to change notification settings - Fork 568
Using Content Provider #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello sonalm, You can use custom ContentProviders, you only need to extend the android.content.ContentProvider will using the android-database-sqlcipher SQLiteDatabase in the implementation. We have a simple example of one that you can see here: Can you take a look at this and compare with what you have? Can you share your stacktrace? |
We are also reworking our NoteCipher sample to use a ContentProvider, based on the Android SDK's latest NotePad sample. The new version is here: https://github.com/guardianproject/notepadbot/tree/v2 specifically: https://github.com/guardianproject/notepadbot/blob/v2/src/info/guardianproject/notecipher/NoteCipherProvider.java still figuring out the best way to pass the key/passcode to the content provider however! |
Hi sonalm, Were you able to use a ContentProvider with any of the above? |
Once the DB has been opened, does it still need the password for each call to getReadable/writeable database? It looks like according to the implementation (https://github.com/sqlcipher/android-database-sqlcipher/blob/master/src/info/guardianproject/database/sqlcipher/SQLiteOpenHelper.java) it doesn't. My question is why not just keep the singleton pattern when using a content provider and just pass null to each of the get read/write database methods? If it's open it'll work otherwise it will do the same thing it does now. This way you don't have to cache the password. I may be missing something about how content providers work, but in the case of a password protected provider it can't be accessed by another app w/o the user opening the protected app and entering the password anyway. So, it's safe to assume the DB is open if we're granting access to another app (i.e. launching a view intent). Also, I've read on Oracle's site that storing passwords as strings is bad form since they are immutable. They recommend char[] and using Arrays.fill(array, ' ' ) to zero them out. Apparently, string = null is not sufficient and system.gc cannot be relied on to move fast enough. They were general Java guide lines, maybe Android is different? |
How can we use contentProvider with the package? when i m trying it, it says unable to get the MyContentProvider.
The text was updated successfully, but these errors were encountered: