realm-java icon indicating copy to clipboard operation
realm-java copied to clipboard

Trying to build 0.76.0 version with encryption fails

Open demonar opened this issue 11 years ago • 42 comments

When trying to build the version 0.76.0 of the library i get an error trying to download the core library:

http://static.realm.io/downloads/core/realm-core-android-0.86.0-encryption.tar.gz

The standard version is available, but the encrypted one isn't there.

demonar avatar Dec 20 '14 01:12 demonar

Hi, Sorry about that. We will make the encryption version available as well.

bmunkholm avatar Dec 22 '14 10:12 bmunkholm

Do you know when it's going to be available?, i'm stuck on this step to finish adding encryption to a project.

demonar avatar Dec 22 '14 21:12 demonar

Sorry for bothering again, do you know when is it going to be available?

demonar avatar Dec 23 '14 17:12 demonar

Sorry for the delay! We would like to test this properly, so it won't be until after Xmas, but it will be they first thing for sure.

bmunkholm avatar Dec 23 '14 18:12 bmunkholm

No worries, thanks for the heads up

demonar avatar Dec 23 '14 18:12 demonar

Hi @bmunkholm,

Happy holidays! I am working with @demonar on our project. You guys have done a great job so far with Realm and we are very impressed.

I understand that it is a very busy time and you are testing your products thoroughly, but I was wondering if you could send us the encrypted library in the current state. We fully understand that there might be a few bugs that still need to be squashed. This would be a tremendous help in pushing us past the finish line!

Thank you for your support and we look forward to using Realm in our future projects.

Pobomo avatar Dec 23 '14 20:12 Pobomo

@bmunkholm what happens if i change the core version to the previous one and still build the latest version?

demonar avatar Dec 23 '14 21:12 demonar

@bmunkholm i'm building 0.76.0 with this core:

http://static.realm.io/downloads/core/realm-core-android-0.84.0-encryption.tar.gz

This is the only version i could find of it, please let us know if there are newer versions we could use.

Thanks in advance.

demonar avatar Dec 23 '14 22:12 demonar

All are on holiday now. You can try the older version. I can't recall the delta or if there are API changes. But worth a try.

bmunkholm avatar Dec 23 '14 22:12 bmunkholm

Tried and failed with errors, also, the only available version is 0.72.0 which doesn't implement closeable

demonar avatar Dec 23 '14 22:12 demonar

we've been coding using 0.75.1, i think there should be a lot of changes if we do it.

demonar avatar Dec 23 '14 22:12 demonar

@bmunkholm thank you for the response, when will everyone be returning for the holidays?

Pobomo avatar Dec 23 '14 22:12 Pobomo

@bmunkholm one more question, is there any newer version than 0.84.0 on http://static.realm.io/downloads/core/ that has encryption enabled?

demonar avatar Dec 23 '14 22:12 demonar

I have create an unofficial, experimental version of our core library where encryption is enabled. You have to check out the branch ez-core-update in order to build it. Moreover, you must add encryption = true to your local.properties before building the jar file manually.

We are in the process of redoing parts on how RealmResults are working so I have disabled the methods to delete objects. You have to delete from your Realm instead of your RealmResults.

kneth avatar Dec 25 '14 13:12 kneth

@kneth thank you for creating this branch! We will check it out and let you know how it goes. Have a fantastic holiday season.

Pobomo avatar Dec 25 '14 13:12 Pobomo

To keep everyone posted, i created a build of our project and went good, we are going to test it without the encryption setup and after that i'll add it.

demonar avatar Dec 26 '14 17:12 demonar

@bmunkholm @kneth after some testing, we found that on devices running android 4.1.x we have an issue, i need to confirm is this happens on 4.2 and 4.3.

When using the encrypted DB we get an exception, this exception appears when accessing the DB on the UI thread, the app previously got the realm instance on 2 occasions from separate threads and worked, i verified that the encryption key was the same before sending this, below is the exception:

12-29 20:24:43.792 2044-2044/com.xxx.android W/System.err﹕ java.lang.RuntimeException: Unspecified exception. Invalid database in io_realm_internal_SharedGroup.cpp line 97 12-29 20:24:43.792 2044-2044/com.xxx.android W/System.err﹕ at io.realm.internal.SharedGroup.createNativeWithImplicitTransactions(Native Method) 12-29 20:24:43.792 2044-2044/com.xxx.android W/System.err﹕ at io.realm.internal.SharedGroup.(SharedGroup.java:55) 12-29 20:24:43.792 2044-2044/com.xxx.android W/System.err﹕ at io.realm.Realm.(Realm.java:151) 12-29 20:24:43.792 2044-2044/com.xxx.android W/System.err﹕ at io.realm.Realm.createAndValidate(Realm.java:484) 12-29 20:24:43.792 2044-2044/com.xxx.android W/System.err﹕ at io.realm.Realm.create(Realm.java:464) 12-29 20:24:43.792 2044-2044/com.xxx.android W/System.err﹕ at io.realm.Realm.getInstance(Realm.java:415) 12-29 20:24:43.792 2044-2044/com.xxx.android W/System.err﹕ at io.realm.Realm.getInstance(Realm.java:386)

After this we start getting infinite GC_EXPLICIT calls.

Please let us know if you can find a solution to this as we need to add support for this android version.

demonar avatar Dec 29 '14 23:12 demonar

This also happens on 4.4.x when loosing focus, another thing i found is that on the files folder there are 3 log files from the realm that have some unencrypted data, this shouldn't happen as we need to keep the data secured.

demonar avatar Dec 30 '14 03:12 demonar

Guys, is there any chance to get help on this today?, we really need to make this work, thanks.

demonar avatar Dec 30 '14 15:12 demonar

Any chance this is due to opening a previously unencrypted database with encryption now on?

bmunkholm avatar Dec 30 '14 23:12 bmunkholm