Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 0.1.0

* Build the Rust core with Flutter native assets instead of cargokit.
Requires Flutter 3.47.2 or later, `rustup` on the build machine, and
NDK 27 or later for Android.
* Remove `NotSupportedPlatform`; `Tor.throwRustException` no longer takes
a bindings argument.
* Fix `Tor.start` never detecting a failed `tor_start`.

## 0.0.1

* TODO: Describe initial release.
23 changes: 6 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,19 @@ 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`. The toolchain and cross-compilation targets pinned in `rust/rust-toolchain.toml` are installed automatically on first build.

### Install cargo ndk
### Building

```sh
cargo install cargo-ndk
```

### Cargokit

[Cargokit](https://github.com/irondash/cargokit) handles building, just `flutter run` it or run it in Android Studio or VS Code (untested).

To update Cargokit in the future, use:
```sh
git subtree pull --prefix cargokit https://github.com/irondash/cargokit.git main --squash
```
The Rust library is built and bundled by Flutter's native assets support (see `hook/build.dart`), so just `flutter run` or build as usual. Requires Flutter 3.47.2 or later; Android builds need NDK 27 or later.

## 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 generate `tor_ffi_plugin.h` C bindings for Rust, `cargo build` in `rust` to produce headers according to `build.rs`.
To generate `tor_ffi_plugin_bindings_generated.dart` Dart bindings for C, `dart run ffigen --config ffigen.yaml`.

## 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.
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
analyzer:
exclude:
- build/**
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
Expand Down
9 changes: 0 additions & 9 deletions android/.gitignore

This file was deleted.

77 changes: 0 additions & 77 deletions android/build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion android/settings.gradle

This file was deleted.

3 changes: 0 additions & 3 deletions android/src/main/AndroidManifest.xml

This file was deleted.

26 changes: 0 additions & 26 deletions cargokit/.github/workflows/check_and_lint.yml

This file was deleted.

86 changes: 0 additions & 86 deletions cargokit/.github/workflows/test_example_plugin_build.yml

This file was deleted.

4 changes: 0 additions & 4 deletions cargokit/.gitignore

This file was deleted.

39 changes: 0 additions & 39 deletions cargokit/LICENSE

This file was deleted.

8 changes: 0 additions & 8 deletions cargokit/README

This file was deleted.

58 changes: 0 additions & 58 deletions cargokit/build_pod.sh

This file was deleted.

2 changes: 0 additions & 2 deletions cargokit/build_tool/README.md

This file was deleted.

Loading