This is a fork of 05nelsonm/kmp-tor-resource, maintained for Sparrow Wallet. It
packages pre-compiled tor for the JVM, to be used with kmp-tor. All credit for the project
goes to its author, Matthew Nelson.
How it differs from upstream:
- JVM only, for the five platforms Sparrow ships on (below). The Android, iOS, Kotlin/Native and
JavaScript/npm publications, and the
noexecvariant, are not built. - GPL only:
toris built with--enable-gpl. There is no non-GPL variant. - Published as
com.sparrowwallet, tracking currenttor. The package, class and JPMS module names are unchanged, so it's a drop-in replacement for theio.matthewnelson.kmp-torartifacts. - Build toolchains are built from the build-env Dockerfiles in this repo and pinned by digest (build-env/digests).
- Code signing: the macOS binaries are signed with Sparrow's Developer ID and notarized; the Windows binaries are signed with Craig Raw's code signing certificate.
Tor and its dependencies are compiled from source using the following versions
| git tag | |
|---|---|
| libevent | release-2.1.12-stable |
| openssl | openssl-3.5.9 |
| tor | tor-0.4.9.16 |
| xz | v5.8.4 |
| zlib | v1.3.2 |
NOTE: All macOS and Windows compilations are code signed so they work out of the box.
More details about how things are compiled can be found HERE
| aarch64 | x86_64 | Minimum | |
|---|---|---|---|
| Windows | ✔ | ||
| macOS | ✔ | ✔ | 11 (aarch64), 10.9 (x86_64) |
| Linux (libc) | ✔ | ✔ | glibc 2.23 |
// build.gradle.kts
dependencies {
implementation("com.sparrowwallet:resource-exec-tor-gpl:409.16.0")
}resource-exec-tor-gpl provides ResourceLoaderTorExec, and depends on resource-lib-tor-gpl and
resource-geoip. Pass it into TorRuntime.Environment.Builder when using kmp-tor:
val env = TorRuntime.Environment.Builder(myWorkDir, myCacheDir, ResourceLoaderTorExec::getOrCreate)Don't mix these with upstream's io.matthewnelson.kmp-tor:resource-* artifacts. They contain the same JPMS
modules, which conflict. Check with gradle dependencies that nothing still pulls them in.
The jars contain the tor compilations for all five platforms. To ship only the one for the host, use the
gradle-filterjar-plugin with filterGroup("com.sparrowwallet"), filtering the resource-exec-tor
and resource-lib-tor artifacts (the prefix also matches -gpl). Keep /<host>/<arch>/ and, on Windows,
/mingw/tor.exe.local.
The build tooling is licensed under the Apache License 2.0. The published resource-exec-tor-gpl and
resource-lib-tor-gpl artifacts contain tor built with --enable-gpl, and are licensed under the
GNU General Public License, Version 3.0.