You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-7Lines changed: 27 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@
4
4
5
5
## Supported targets
6
6
7
-
-`aarch64-apple-ios`
8
-
-`aarch64-apple-ios-sim`
9
-
-`x86_64-apple-ios`
10
-
-`aarch64-linux-android`
11
-
-`armv7-linux-androideabi`
12
-
-`i686-linux-android`
13
-
-`x86_64-linux-android`
7
+
-`aarch64-apple-ios`
8
+
-`aarch64-apple-ios-sim`
9
+
-`x86_64-apple-ios`
10
+
-`aarch64-linux-android`
11
+
-`armv7-linux-androideabi`
12
+
-`i686-linux-android`
13
+
-`x86_64-linux-android`
14
14
15
15
## iOS
16
16
@@ -24,6 +24,26 @@ Beneath these bindings it fully relies on `KeyStore`. During key generation, bas
24
24
25
25
> NOTE: there still needs to be some additional research done into the exact garantuees that `setUserPresenceRequired` provides. If it means TEE, it is all good.
26
26
27
+
### Additional setup
28
+
29
+
Due to time constraints, currently some additional setup is required for Android to fully work. This has to do with accessing the JVM pointer from Rust. If something like [android_activity](https://github.com/rust-mobile/android-activity) is used, take a look at the [android example](./examples/android/src/lib.rs). If this library is used from a React Native context, or native Android app, include the following in your project:
30
+
31
+
```java
32
+
packageid.animo;
33
+
34
+
publicclassSecureEnvironment {
35
+
static {
36
+
System.loadLibrary("secure_env");
37
+
}
38
+
39
+
40
+
publicstaticnativevoidset_env();
41
+
}
42
+
43
+
```
44
+
45
+
Afterwards, you can call `SecureEnvironment.set_env` before making any calls to the library. Afterwards everything should be set up properly.
/// Android glue code that is called with the pointer to the current activity.
17
-
/// With this pointer we can initialize the jvm which is required for JNI.
18
-
///
19
-
/// Code is a modified version of: [android-activity/src/native_activity/glue.rs](https://github.com/rust-mobile/android-activity/blob/0d299300f4120821ae1fcaaf0276129c512c2c96/android-activity/src/native_activity/glue.rs#L829)
20
-
#[cfg(not(feature = "android_testing"))]
27
+
// Entry point that can be used to set the pointer to the jvm. It has to be called manually from a
0 commit comments