Skip to content

ABI: Move tunnel hooks to native app#1820

Merged
keeshux merged 13 commits into
masterfrom
refactoring/native-tunnel-hooks
May 19, 2026
Merged

ABI: Move tunnel hooks to native app#1820
keeshux merged 13 commits into
masterfrom
refactoring/native-tunnel-hooks

Conversation

@keeshux

@keeshux keeshux commented May 19, 2026

Copy link
Copy Markdown
Member

Passing a native tunnel object to the Swift ABI is trivial in Swift, but it gets convoluted with non-Swift languages because of all the C/JNI machinery.

Instead:

  • In AppABI.onSaveProfile(), rather than performing tunnel operations, emit a new ProfileEvent called ShouldReconnect
  • Observe the event in TunnelObservable, and reconnect the profile if necessary

This demands trivial duplication of the native tunnel logic, as it must react to profile events at the app layer. However, this is infinitely easier than adding fragile C/JNI bindings to let Swift control the tunnel directly with Kotlin/JNI or C++.

@keeshux keeshux self-assigned this May 19, 2026
@keeshux keeshux added refactoring Improves software architecture Android Related to the Android app Cross Related to non-Swift apps labels May 19, 2026
@keeshux keeshux added this to the 3.9.0 milestone May 19, 2026
@keeshux keeshux merged commit 8c8c3d0 into master May 19, 2026
2 checks passed
@keeshux keeshux deleted the refactoring/native-tunnel-hooks branch May 19, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android Related to the Android app Cross Related to non-Swift apps refactoring Improves software architecture

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant