Tor Mobile Dev Guide
  • 🧅Welcome to Onion Mobile Devs!
  • The History of Tor
  • The Tor Protocol
  • Tor ("C Tor") vs Arti: What?!
  • Mobile Concepts
    • Mobile Apps with Tor
    • Possible Ways to Tor Your App
    • Limitations of Mobile Devices
    • Mobile Users in the OnionVerse
  • Tor on Android
    • All The Onions on Android
    • Tor-Android library
    • Pluggable Transports for Android
    • NetCipher with Orbot (Legacy)
    • TorServices
    • Arti Mobile on Android
  • Tor on iOS
    • All The Onions on Apples
    • Tor.Framework for iOS
    • Pluggable Transports for iOS
    • IPtProxyUI
    • OrbotKit
    • TorManager
    • Arti and Onionmasq on iOS
  • Help and Community
    • Community Case Studies
    • Developer Story: Arti Integration Journey
    • Where to get help
Powered by GitBook
On this page
Edit on GitHub
  1. Tor on Android

Arti Mobile on Android

Using Tor's new Rust-based runtime in your Android app

PreviousTorServicesNextAll The Onions on Apples

Last updated 1 year ago

is the current project for building and using the Arti (Tor in Rust) project within your mobile app. The repository is available at:

To build for Android

  • install Rust and Android Studio. Make sure you can run an Hello World with both.

  • go in the common folder and run make android.

  • take a coffee, or two.

  • open the android folder in Android Studio or use gradle to build your app as usual.

Sample Project for Android

There is a that demonstrates how easy it can be to use Arti within your Android app.

Once you have built and imported the Arti library into your project, all that you do to initialize it using default ports, all that you need to do is:

Arti.init(this);

From there, you can easily proxy any HTTP connection over Arti's built-in SOCKs proxy port

Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(proxyHost, proxyPort));

HttpURLConnection connection = null;
URL url = new URL(targetURL);
connection = (HttpURLConnection)url.openConnection(proxy);
connection.setRequestMethod("GET");

You can also use the ProxyConfig class to enable WebView proxying, as well

ProxyConfig proxyConfig = new ProxyConfig.Builder()
           .addProxyRule("127.0.0.1:8118") //http proxy for tor
          .addDirect().build();

ProxyController.getInstance().setProxyOverride(proxyConfig, new Executor() {
            @Override
            public void execute(Runnable command) {
                //do nothing
            }
        }, new Runnable() {
            @Override
            public void run() {

            }
        });
Arti-Mobile-Ex
https://gitlab.com/guardianproject/arti-mobile-ex
sample Android Studio project