5

I have a Swift app that uses the Realm Object Server running remotely on a Linux server. Everything is working, including real-time sync.

Occasionally I want to inspect the contents of a local Realm file used by the iOS Simulator so I can do some debugging. When I browse here:

~/.../CoreSimulator/.../Documents/realm-object-server/<unique id>/

...and I try to open this file: realm%3A%2F%2F104%2E236%2E129%2E235%3A9080%2F%7E%2Fmyapp.realm

I get prompted with: Please enter a valid encryption key for this Realm file. enter image description here Where do I get this encryption key? I tried using the admin token from the server, but that doesn't appear to be working.

Also, can I turn off encryption everywhere? Or is it mandatory for any app using the Realm Object Server?

Clifton Labrum
  • 13,053
  • 9
  • 65
  • 128

4 Answers4

5

It is not possible to open the local version of a synced Realm file using the Browser (or anything else, for that matter). This is due to differing history types internally (but I won't go into that now). In order to inspect the contents of the Realm file, you have to open it using the previously defined syncURL. The browser will then download the file and show you the contents.

A few links on this topic:

teotwaki
  • 1,033
  • 7
  • 10
1

You may use old version of Realm Browser, please update it and check the result again.

Soheil Novinfard
  • 1,358
  • 1
  • 16
  • 43
0

Use Realm Studio instead which worked for me.

Here can download the file

刘俊利
  • 358
  • 4
  • 12
-2
byte[] key = new byte[64]; 
new SecureRandom().nextBytes(key); 
String encryptionKey = byteArrayToHexString(key); 
//encryptionKey is what you want byteArrayToHexString see
Log.d("test", "encryptionKey:"+encryptionKey);

byteArrayToHexString() method you can see:How to convert a byte array to a hex string in Java?

Community
  • 1
  • 1
  • Hi, could you please expand a little on this? Do you have a source, for example? – Fabio says Reinstate Monica Mar 16 '17 at 10:16
  • byte[] key = new byte[64]; new SecureRandom().nextBytes(key); String encryptionKey = byteArrayToHexString(key); Log.d("test","encryptionKey:"+encryptionKey);//encryptionKey is what you want byteArrayToHexString see http://stackoverflow.com/questions/9655181/how-to-convert-a-byte-array-to-a-hex-string-in-java – yanghong shen Mar 30 '17 at 08:10
  • 1
    Ok, please [edit] your answer and add it there. Comments are not a great place to add code, as they don't support formatting, and according to the site rules they could be deleted at any time. Thank you! – Fabio says Reinstate Monica Mar 30 '17 at 09:16