Skip to content

Foundation-Devices/tor flutter_rust_bridge migration + Cypher Stack tor fixes/features#32

Draft
sneurlax wants to merge 73 commits into
mainfrom
frb-migration
Draft

Foundation-Devices/tor flutter_rust_bridge migration + Cypher Stack tor fixes/features#32
sneurlax wants to merge 73 commits into
mainfrom
frb-migration

Conversation

@sneurlax

Copy link
Copy Markdown
Member

The frb-migration branch and this PR migrate to the upstream Foundation-Devices/tor, which has migrated from cargokit to flutter_rust_bridge, plus the fixes and features which now distinguish cypherstack/tor from the upstream

icota and others added 30 commits June 25, 2024 12:11
…-pubspec-version

Bump package version to 0.0.4
Add onion-service-client flag, enabling onion use.
- sync lib/socks_socket.dart with cypherstack/tor
- pin socks5_proxy to working version

fix linter: attribute, license

remove typo in comment from example

removing the copyright notice was an oversight, sorry; because you mentioned you're OK with attributing this to Cypher Stack since I wrote it, I've attributed it thusly

dart format -o write .

comment updates
icota and others added 30 commits February 11, 2026 12:20
fix: use standard method to get random unused port
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The manifest carried package="com.flutter_rust_bridge.rust_lib_backup"
from when the android stub was scaffolded off the backup package. AGP 8+
rejects the package attribute entirely (namespace must come from
build.gradle), and the value was wrong anyway — android/build.gradle:33
already sets namespace 'com.flutter_rust_bridge.rust_lib_tor'.

Without this, downstream consumers fail :tor:processDebugManifest with:
  Incorrect package="com.flutter_rust_bridge.rust_lib_backup" found in
  source AndroidManifest.xml

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…android-manifest-stale-package

Remove stale package attribute from AndroidManifest.xml
getNofileLimit and setNofileLimit are utility wrappers that don't depend
on the Tor singleton — callers reasonably expect to invoke them without
first calling Tor.init(). With the FRB rewrite they became async rust
calls, so calling them before Tor.init() now throws
"flutter_rust_bridge has not been initialized".

Extract the RustLib init guard into a shared ensureRustLibInit() helper
in src/rust_lib_init.dart and use it from both Tor (init / start) and
the util.dart functions. The helper checks the public
RustLib.instance.initialized getter rather than a private bool, so the
two call sites can no longer drift out of sync (which would have caused
"Should not initialize flutter_rust_bridge twice" if util ran first).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…util-self-bootstrap-rustlib

util: self-bootstrap RustLib in getNofileLimit/setNofileLimit
…pod-install

Rename podspecs to match plugin name
…2998-stuck-on-loading-screen-on-release-candidate-testflight

[2.3] Fix tor init for ios
Add an optional dataDirPath parameter to Tor.start() and Tor.enable().
When provided, the tor_state and tor_cache directories are created under
that path; otherwise the application support directory is used as before.

This lets embedders place Tor state in an app-specific location rather
than being tied to getApplicationSupportDirectory().
Onion services are already end-to-end encrypted by the Tor protocol, so
attempting a TLS handshake on top of a .onion connection is unnecessary
and fails against services that do not present a certificate. Skip the
SSL upgrade automatically when the target domain ends with .onion.
Add DEAD_CODE_STRIPPING and Release-only STRIP settings to the macOS
podspec so the large statically linked Rust library is stripped from
release products, reducing the shipped binary size.
Adopt Foundation-Devices' flutter_rust_bridge tree wholesale (license,
bridge architecture, build files, and example app all move to the FRB
version). cypherstack's ffigen tree is superseded; its package identity
and namespace are re-applied in the following commit. This records main
as an ancestor so the migration PR merges cleanly.
Keep Cypher Stack's package identity after adopting Foundation-Devices'
flutter_rust_bridge tree:

- Dart package name tor -> tor_ffi_plugin (pubspec, example dependency
  and imports)
- iOS/macOS podspecs renamed to tor_ffi_plugin.podspec with matching
  s.name so Flutter resolves the pod by the plugin name
- Android group and namespace -> com.cypherstack.tor_ffi_plugin, and fix
  the stale rootProject.name (was rust_lib_backup)
- REUSE dep5 Upstream-Name and Source point at cypherstack
- Drop the orphaned macos/rust_lib_backup.podspec.license sidecar

The internal Rust crate / native library stays rust_lib_tor since it is
an implementation detail not exposed to consumers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants