Skip to content

Encrypted SQLite DB for Android#597

Closed
afiller wants to merge 11 commits into
Nozbe:masterfrom
afiller:features/encrypted-android-db-pull-request
Closed

Encrypted SQLite DB for Android#597
afiller wants to merge 11 commits into
Nozbe:masterfrom
afiller:features/encrypted-android-db-pull-request

Conversation

@afiller

@afiller afiller commented Dec 20, 2019

Copy link
Copy Markdown

Hi, as promised in #51 hereby I provide a pull request for encrypted databases on android. It's tested (ci:check and in a test project) and working. Nevertheless I want to address some things:

  1. It works with or without password, but in all of the cases it's using another SQLite implementation for android. In my tests it works perfect, but I wanted to tell you.

  2. The new library requires to be mentioned in the licenses, see https://www.zetetic.net/sqlcipher/open-source/

I did not change documentation at all. It's up to you where to mention this.

  1. The password can be simply set in the SQLiteAdapter:
new SQLiteAdapter({
      schema: defaultSchema,
      dbName: 'myDB',
      password: 'ABC123!'
    })

If none is given the DB is not encrypted. Quite easy and backwards compatible.

  1. I adjusted the iOS methods accordingly to be the same as in Android. The parameter password is given there as well, but simply not used. I think this makes sense for possible future changes also there.

Feel free to change what you want. :) I hope it's a valuable contribution and I would look forward to be mentioned in the contributors section - but of course that's not a "must".

Best regards,

Andreas

…uest

* features/encryption-for-android:
  should provide option to work without password as well -> tested and working
…db-pull-request

* features/pull-request:
  should provide option to work without password as well -> tested and working
  cleanup
  fix
  cleanup
  adjusted bridge
  adjusted build-script
  adjusted for iOS
  password cleanup
  intermediate state
@afiller afiller changed the title Features/encrypted android db pull request Encrypted SQLite DB for Android Dec 20, 2019
@alexandrethsilva

Copy link
Copy Markdown

hi @afiller is there any update on this here? anything I could help with? right now it seems to be only a pending conflict res, but maybe there was some back channeling I'm not aware of :)

@Overtorment

Copy link
Copy Markdown

@afiller any progress on this?

@falquinho

Copy link
Copy Markdown

@afiller Hey, good evening. I'm here to ask for some guidance if you're able to help. My project requires database encryption(late requisite, else I would not have used Watermelon) so i'm trying to port you patch to Watermelon 0.17.1.
It has some differences in the NativeBridgeType and NativeDispatcher. I've changed their functions signatures where needed to take an extra string for the password, but i keep getting the run-time error DatabaseBridge.initialize got 5 arguments but requires 6. It doesn't make sense to me, its args are 5: tag, schema, password, schemaVersion and callback.
Can you help make this patch? Can someone point me what I'm missing?

@radex

radex commented Mar 24, 2021

Copy link
Copy Markdown
Collaborator

Closed in favor of #907 . Thank you for your work!

@radex radex closed this Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants