Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
c20731c
Bump arti to 1.2.4
icota Jun 25, 2024
8501ee3
Merge pull request #43 from Foundation-Devices/bump-arti
icota Jun 25, 2024
17346f4
Bump package version to 0.0.4
icota Jun 25, 2024
e449ecb
Merge pull request #44 from Foundation-Devices/bump-pubspec-version
icota Jun 25, 2024
8df40ac
Add rust-toolchain
icota Aug 13, 2024
b8042c7
Bump version to 0.0.5
icota Aug 13, 2024
c8d2023
Merge pull request #45 from Foundation-Devices/add-toolchain-file
icota Aug 13, 2024
fbc07fb
Pin 'time' to specific version
icota Aug 13, 2024
8e770d4
Merge pull request #46 from Foundation-Devices/pin-time
icota Aug 13, 2024
6035db0
Relicense to MIT
icota Aug 21, 2024
5b31df8
Bump version and changelog
icota Aug 21, 2024
05f2d57
Merge pull request #47 from Foundation-Devices/mit-licence
icota Aug 30, 2024
f1f70f7
Bump Arti to 1.2.7
icota Sep 4, 2024
d6bb24b
Fix formatting
icota Sep 4, 2024
bce153f
Merge pull request #49 from Foundation-Devices/arti-1.2.7
icota Sep 4, 2024
db316b3
Bump version to 0.0.8
icota Sep 4, 2024
36ba849
Update Cargo.toml
sneurlax Sep 19, 2024
caf52f3
Merge pull request #52 from sneurlax/patch-1
icota Sep 20, 2024
e20a2c3
add bitcoin onion example
sneurlax Oct 4, 2024
dc3eb35
add monero onion example
sneurlax Oct 3, 2024
dab9767
ios fix
julian-CStack Jun 24, 2024
d014507
Merge pull request #53 from sneurlax/onion-example
icota Oct 7, 2024
153e17d
bump time version
InvertedX Mar 5, 2025
66c62b1
Merge pull request #56 from Foundation-Devices/bump_dep
icota Mar 5, 2025
a9e6dde
Bump tor
Mixslav Jun 2, 2025
8a8aa9c
Format
Mixslav Jun 4, 2025
ad79227
Bump version
icota Jun 8, 2025
440a2d2
Merge pull request #57 from Foundation-Devices/Tor-upgrade
icota Jun 9, 2025
e4029ce
improved example app
InvertedX Aug 19, 2025
f2c20a6
Use flutter 3.35
InvertedX Aug 19, 2025
f4f481e
Add 16K page size support for android
InvertedX Aug 19, 2025
c5e3d06
Merge remote-tracking branch 'origin/main' into support_16k_page_size
InvertedX Aug 19, 2025
8af60b2
use latest flutter on workflow
InvertedX Aug 19, 2025
fc2c94a
fix reuse license check on example project
InvertedX Aug 20, 2025
c089d8b
fix flutter lints
InvertedX Aug 20, 2025
2d00862
Merge pull request #60 from Foundation-Devices/support_16k_page_size
icota Aug 21, 2025
fc89ed3
bump arti to 1.7.0
InvertedX Nov 26, 2025
b92e2bc
Merge pull request #63 from Foundation-Devices/arti-v1.7.0
icota Nov 26, 2025
b2961ef
Fix GrapheneOS crashes
icota Feb 11, 2026
5b1fe5b
Merge pull request #54 from sneurlax/ios
icota Feb 11, 2026
a31b5ef
Merge pull request #64 from Foundation-Devices/ENV-2676-graphene-crashes
icota Feb 11, 2026
4664593
Bump version to 0.1.1
icota Feb 11, 2026
7d76b1a
Merge branch 'main' of github.com:Foundation-Devices/tor
icota Feb 11, 2026
e2fc133
Add flake.nix
icota Feb 11, 2026
9b8010c
Add flake.nix
icota Feb 11, 2026
6e7e7c0
Add licences
icota Feb 11, 2026
f247c80
Add .direnv to gitignore
icota Feb 19, 2026
6941a51
Migrate to FRB
icota Feb 19, 2026
0e2ca10
Regen cargokit and fix licencing
icota Feb 19, 2026
11931c7
Fix Rust formatting
icota Feb 19, 2026
907272a
analysis options: ignore cargokit
icota Feb 19, 2026
9ec0db7
Merge pull request #65 from Foundation-Devices/flake-nix
icota Feb 19, 2026
b970adf
Merge main
icota Feb 19, 2026
618eeea
Don't use separate package for Rust
icota Feb 19, 2026
e2270eb
Fix Linux build
icota Feb 19, 2026
3d7bf02
fix: use standard method to get random unused port
Cyrix126 May 27, 2026
36e1fa4
Merge pull request #67 from Cyrix126/main
icota May 27, 2026
b38a01b
Merge branch 'main' of github.com:Foundation-Devices/tor into frb-rew…
icota Jun 1, 2026
7c11f05
Remove unused dart:isolate and dart:math imports
icota Jun 1, 2026
2e44d8d
Merge pull request #66 from Foundation-Devices/frb-rewrite
icota Jun 1, 2026
cd065e0
Remove stale package attribute from AndroidManifest.xml
icota Jun 8, 2026
09513cf
Merge pull request #68 from Foundation-Devices/fix/android-manifest-s…
icota Jun 8, 2026
01c8889
Self-bootstrap RustLib in util.dart functions
icota Jun 8, 2026
68a5941
Merge pull request #69 from Foundation-Devices/fix/util-self-bootstra…
icota Jun 8, 2026
6ad953a
rename podspecs to match plugin name
dariyoo99 Jun 11, 2026
2036227
Merge pull request #70 from Foundation-Devices/fix-pod-install
icota Jun 11, 2026
6f9f599
[2.3] Fix tor init for ios
Mixslav Jun 16, 2026
57ccdaf
Merge pull request #71 from Foundation-Devices/env-2998-stuck-on-load…
icota Jun 16, 2026
f3617b0
feat: allow caller-configurable Tor data directory
sneurlax Jul 13, 2026
0c44ffb
fix: disable SSL for .onion domains in SOCKSSocket.connectTo
sneurlax Jul 13, 2026
1c246af
chore(macos): strip Rust static library from release builds
sneurlax Jul 13, 2026
83f4232
Merge cypherstack main into frb-migration
sneurlax Jul 15, 2026
66d37e6
chore: restore cypherstack plugin identity on FRB tree
sneurlax Jul 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
#
# SPDX-License-Identifier: MIT

use flake
1 change: 1 addition & 0 deletions .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/home/icota/.pub-cache/hosted/pub.dev/path_provider_foundation-2.5.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"rust_lib_tor","path":"/home/icota/Code/tor/rust_builder/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"path_provider_android","path":"/home/icota/.pub-cache/hosted/pub.dev/path_provider_android-2.2.22/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"rust_lib_tor","path":"/home/icota/Code/tor/rust_builder/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"path_provider_foundation","path":"/home/icota/.pub-cache/hosted/pub.dev/path_provider_foundation-2.5.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"rust_lib_tor","path":"/home/icota/Code/tor/rust_builder/","native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"path_provider_linux","path":"/home/icota/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"rust_lib_tor","path":"/home/icota/Code/tor/rust_builder/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"path_provider_windows","path":"/home/icota/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"rust_lib_tor","path":"/home/icota/Code/tor/rust_builder/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"rust_lib_tor","dependencies":[]}],"date_created":"2026-02-19 09:24:05.451601","version":"3.35.7","swift_package_manager_enabled":{"ios":false,"macos":false}}
49 changes: 49 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SPDX-FileCopyrightText: 2022 Foundation Devices Inc.
#
# SPDX-License-Identifier: MIT

name: Check

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy

- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.35.1'

- name: Install dependencies
run: flutter pub get

- name: Verify Dart formatting
run: dart format --output=none --set-exit-if-changed .

- name: Verify Rust formatting
run: cargo fmt --manifest-path rust/Cargo.toml --all -- --check

- name: Run Rust tests
run: cargo test --manifest-path rust/Cargo.toml

- name: Analyze Dart project source
run: flutter analyze

# - name: Run Dart tests
# run: flutter test
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
#
# SPDX-License-Identifier: MIT

# Miscellaneous
*.class
*.log
Expand Down Expand Up @@ -30,5 +34,7 @@ migrate_working_dir/
build/

rust/target/.rustc_info.json
rust/target/debug/
rust/target/CACHEDIR.TAG
rust/target/debug

# direnv
.direnv/
56 changes: 56 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: tor_ffi_plugin
Upstream-Contact: Igor Cota <igor@foundationdevices.com>
Source: https://github.com/cypherstack/tor

Files: cargokit/*
Copyright: 2022 Matej Knopp
License: MIT

Files: lib/generated*
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: lib/src/rust/*
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: rust/src/frb_generated.rs
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: .flutter-plugins-dependencies
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: example/linux/flutter/generated*
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: example/macos/Flutter/Generated*
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: example/windows/flutter/generated*
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: example/android/*
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: rust/target/*
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: CHANGELOG.md
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: flake.lock
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: android/.gradle/*
Copyright: 2024 Foundation Devices Inc.
License: MIT
40 changes: 39 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
<!--
SPDX-FileCopyrightText: 2024 Foundation Devices Inc.

SPDX-License-Identifier: MIT
-->

## 0.0.9

* Bumped arti to version 1.4.3

## 0.0.8

* Bumped arti to version 1.2.7

## 0.0.7

* Relicensed to MIT

## 0.0.6

* Pinned 'time' to a specific version

## 0.0.5

* Added rust-toolchain file

## 0.0.4

* Bumped arti to version 1.2.4

## 0.0.3

* Added functions to stop and restart the proxy.

## 0.0.2

* Fixed the Windows build.

## 0.0.1

* TODO: Describe initial release.
* Initial release.
3 changes: 3 additions & 0 deletions LICENSE.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 Foundation Devices Inc.

SPDX-License-Identifier: MIT
9 changes: 9 additions & 0 deletions LICENSES/MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2024 Foundation Devices Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!--
SPDX-FileCopyrightText: 2022-2023 Foundation Devices Inc.
SPDX-FileCopyrightText: 2024 Foundation Devices Inc.

SPDX-License-Identifier: GPL-3.0-or-later
SPDX-License-Identifier: MIT
-->

# tor
Expand All @@ -12,7 +13,7 @@ SPDX-License-Identifier: GPL-3.0-or-later

### [Install rust](https://www.rust-lang.org/tools/install)

Use `rustup`, not `homebrew`. Install toolchain 1.74.
Use `rustup`, not `homebrew`.

### Install cargo ndk

Expand All @@ -31,11 +32,10 @@ git subtree pull --prefix cargokit https://github.com/irondash/cargokit.git main

## Development

To generate `tor_ffi_plugin.h` C bindings for Rust, `cbindgen --config cbindgen.toml --crate tor-ffi --output target/tor_ffi_plugin.h` or `cargo build` in `native/tor-ffi` to produce headers according to `build.rs`.
To generate `tor_bindings_generated.dart` Dart bindings for C, `flutter pub run ffigen --config ffigen.yaml`. You will probably need to manually edit the `Tor` class to be `final`.
To (re)generate Dart bindings run `just generate`

## Example app

`flutter run` in `example` to run the example app

See `example/lib/main.dart` for usage. Must run the build script for your platform first.
See `example/lib/main.dart` for usage.
12 changes: 10 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# SPDX-FileCopyrightText: 2022 Foundation Devices Inc.
# SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
#
# SPDX-License-Identifier: MIT

include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
analyzer:
exclude:
- 'lib/generated*'
- 'lib/src/rust/**'
- 'cargokit/**'
4 changes: 4 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2024 Foundation Devices Inc
#
# SPDX-License-Identifier: MIT

*.iml
.gradle
/local.properties
Expand Down
59 changes: 21 additions & 38 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,77 +1,60 @@
// SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
//
// SPDX-License-Identifier: MIT

// The Android Gradle Plugin builds the native code with the Android NDK.

group 'com.cypherstack.tor_ffi_plugin'
version '1.0'

buildscript {
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
}

dependencies {
classpath("com.android.tools.build:gradle:8.1.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
// The Android Gradle Plugin knows how to build native code with the NDK.
classpath 'com.android.tools.build:gradle:7.3.0'
}
}

allprojects {
rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
if (project.android.hasProperty("namespace")) {
namespace 'com.cypherstack.tor_ffi_plugin'
}

compileSdk = 34
// Bumping the plugin compileSdkVersion requires all clients of this plugin
// to bump the version in their app.
compileSdkVersion 33

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
// Use the NDK version
// declared in /android/app/build.gradle file of the Flutter project.
// Replace it with a version number if this plugin requires a specfic NDK version.
// (e.g. ndkVersion "23.1.7779620")
ndkVersion android.ndkVersion

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

sourceSets {
main.java.srcDirs += "src/main/kotlin"
test.java.srcDirs += "src/test/kotlin"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
minSdk = 21
}

dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.mockito:mockito-core:5.0.0")
}

testOptions {
unitTests.all {
useJUnitPlatform()

testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen {false}
showStandardStreams = true
}
}
minSdkVersion 19
}
}

apply from: "../cargokit/gradle/plugin.gradle"

cargokit {
manifestDir = "../rust"
libname = "tor_ffi_plugin"
}
libname = "rust_lib_tor"
}
4 changes: 4 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
// SPDX-FileCopyrightText: 2024 Foundation Devices Inc
//
// SPDX-License-Identifier: MIT

rootProject.name = 'tor_ffi_plugin'
9 changes: 7 additions & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cypherstack.tor_ffi_plugin">
<!--
SPDX-FileCopyrightText: 2024 Foundation Devices Inc

SPDX-License-Identifier: MIT
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
26 changes: 0 additions & 26 deletions cargokit/.github/workflows/check_and_lint.yml

This file was deleted.

Loading
Loading