Repository: cloudflare/boringtun (language: rust)

Issue:
android build is broken again due to recent changes
In a133f1df70e09052f3fabdcd50cba98d299b0e51 a new argument was added to new_tunnel for the preshared_key, but the usage in src/jni.rs was not updated.

https://github.com/cloudflare/boringtun/blob/a133f1df70e09052f3fabdcd50cba98d299b0e51/src/jni.rs#L148-L155


Discussion / hints:
I'm actually getting other errors also :(. Example:

```
error[E0603]: module `x25519` is private
  --> src/jni.rs:13:20
   |
13 | use crate::crypto::x25519::X25519SecretKey;
   |                    ^^^^^^ private module
```
@saurik would you be willing to open a PR for this?

Fix patch:
diff --git a/src/jni.rs b/src/jni.rs
index a5823ce7..959a6193 100644
--- a/src/jni.rs
+++ b/src/jni.rs
@@ -132,6 +132,7 @@ pub unsafe extern "C" fn create_new_tunnel(
     _class: JClass,
     arg_secret_key: JString,
     arg_public_key: JString,
+    arg_preshared_key: JString,
     keep_alive: jshort,
     index: jint,
 ) -> jlong {
@@ -145,13 +146,17 @@ pub unsafe extern "C" fn create_new_tunnel(
         Err(_) => return 0,
     };
 
+    let preshared_key = match env.get_string_utf_chars(arg_preshared_key) {
+        Ok(v) => v,
+        Err(_) => return 0,
+    };
+
     let tunnel = new_tunnel(
         secret_key,
         public_key,
+        preshared_key,
         keep_alive as u16,
         index as u32,
-        Some(log_print),
-        3,
     );
 
     if tunnel.is_null() {


Test patch: