Tor Binary build for Android
Support for this project will be sunset by July 1st, 2022 in favor of a successor library kmp-tor-binary.
Installs the Tor executable file in your Android Application's
native library directory (/data/app/...
) with the file name libTor.so
.
Used primarily for the TorOnionProxyLibrary-Android project.
- In your Application module's
build.gradle
file, add the following to thedependencies
block:
implementation "io.matthewnelson.topl-android:tor-binary:0.4.6.5"
- In your Application module's
build.gradle
file, add the following to theandroid
block:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
- If your application's
minSdkVersion
is 23 or greater, add to theAndroidManifest.xml
, within theapplication
tag:
android:extractNativeLibs="true"
- Celebrate, nothing more is needed.
This would be the file if you need it in your app:
val torExecutable = File(context.applicationInfo.nativeLibraryDir, "libTor.so")
Binaries are reproducably built from The Tor Project's tor-browser-build.
See here for more information.
Clone the repo and initialize submodules:
git clone https://github.com/05nelsonm/TOPL-Android-TorBinary.git
cd TOPL-Android-TorBinary/
git submodule update --init
Install dependencies
# See tor-browser-build's README for needed dependencies and install them
cd external/tor-browser-build
nano README
Initialize tor-browser-build's rbm submodule
make submodule-update
# Change directories back to root project location
cd ../..
Run the build script
# From project's root directory
scripts/build_binaries.sh