Privoxy for Android

This release targets all Android devices that use an ARM7 processor or newer. Practically-speaking that means it should run on all Android devices released since 2011 or so. It has been tested only on devices running point releases of Android 4 & 5, but a priori I see no reason why it should not run on earlier Android versions. If you find it working for you, please post on the ijbswa-users@sourceforge.net mailing list, reporting your device name and Android version.


Installation Instructions

1. Extract the zip to /sdcard/. The zip contains the dirs etc,usr,var and a script named 'privoxy.start'.
2. Install Connectbot (from F-Droid or the Play Store at your preference). Connectbot is a terminal client we will use to start Privoxy locally without requiring root.
3. Start Connectbot and create a new connection, choosing the type "local" instead of "ssh", and naming it "privoxy".
4. Connect and then disconnect this new connection.
5. Long press on the connection name to open the context menu and choose "Edit Host". In this menu select "post-login automation" and enter "sh /sdcard/privoxy.start" followed by a newline.
6. To configure your Android device to use Privoxy, proxy configuration is achieved per-network as follows:
- for mobile data, you configure proxy settings in the mobile network APN (Android Settings -> "mobile networks" → "APNs").
- for wifi, long press on each wifi connection you use, scroll and tick 'advanced settings' then select 'manual' for proxy type.
- in both cases, the proxy server address is 127.0.0.1 and the port is 8118.
7. Choose your preferred DNS configuration (detailed in the section below).


Altering DNS configuration

For reasons detailed in the Background section below, this installer ships with the file /sdcard/etc/resolv.conf in order to support DNS resolution. You will need to edit this file and uncomment at least one of the server entries.

As a rule, the more 'privacy-oriented' the DNS server, the less performant they are. If you find page loading is significantly slowed with privoxy running, the installer also supplies a binary of the µnscd DNS caching tool. If you want to enable its use, simply uncomment the three lines that are prefixed with ### in privoxy.start, then stop and restart the connection in ConnectBot.


Starting Privoxy

Privoxy cannot start when your device boots up since it is managed by ConnectBot. You must therefore use the following procedure at each device boot:

1. Open ConnectBot and tap the Privoxy connection you created.
2. Whilst cellular data connections will work fine directly, for any wi-fi networks that you have configured to use Privoxy that auto-connect when your phone starts you will need to manually disconnect and reconnect each one.




Background to this release

This Privoxy release is a cross-compilation from the Gentoo privoxy package. In order to work on Android's proprietary version of linux, a variety of changes were required to Privoxy's dependent libraries, including adjusting the pathnames of some system files, either because they do not exist on Android (e.g. resolv.conf) or because of the need to install this release on the /sdcard partition.

The process is described here: https://wiki.gentoo.org/wiki/Cross_build_environment#Example:_Use_a_statically_linked_privoxy_on_Android

This process is partially automated by the create-zip script found here, per released version:

http://mattenklicker.de/zeug/privoxy/


Finally, the curious amongst you will wonder how Privoxy can be executed at all from the /sdcard partition, given Android's security model. The secret sauce is in the 'privoxy.start' script, which copies the binary to Connectbot's directory prior to execution.

