mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
* Refactor sharedPreferences to only save the AccountId * Update TeamId -> AccountId to match naming elsewhere * Update JWT -> Token to avoid confusion; this token is **not** a valid JWT and should be treated as an opaque token * Update FFI `connect` to accept an optional file descriptor (int32) as a first argument. This seemed to be the most straightforward way to pass it to the tunnel stack. Retrieving it via callback is another option, but retrieving return vars with the `jni` was more complex. We could have used a similar approach that we did in the Apple client (enumerating all fd's in the `new()` function until we found ours) but this approach is [explicitly documented/recommended](https://developer.android.com/reference/android/net/VpnService.Builder#establish()) by the Android docs so I figured it's not likely to break. Additionally, there was a thread safety bug in the recent JNI callback implementation that consistently crashed the VM with `JNI DETECTED ERROR IN APPLICATION: use of invalid jobject...`. The fix was to use `GlobalRef` which has the explicit purpose of outliving the `JNIEnv` lifetime so that no `static` lifetimes need to be used. --------- Signed-off-by: Jamil <jamilbk@users.noreply.github.com> Co-authored-by: Pratik Velani <pratikvelani@gmail.com> Co-authored-by: Gabi <gabrielalejandro7@gmail.com>