[guardian-dev] How to use orbot proxy in a WebView?

Vanitas Vitae vanitasvitae at riseup.net
Thu May 26 12:44:43 EDT 2016


Is it possible to set the proxy of a WebView in Android 6? I tried it
using this code, but it does not work:

webView.getContext().getApplicationContext(), webView, "", port);

In this example, app_class is the app's name string followed by the name
of the Application class (eg. "com.example.app.Application") and port is
the port orbot listens for.

When I run this code from within my MainActivity I get the following
logcat output and the webview cannot establish any connection:

com.example.app E/ProxyChangeListener: Using no proxy configuration due
to exception:java.lang.NullPointerException: Attempt to invoke virtual
method 'java.lang.Object android.os.Bundle.get(java.lang.String)' on a
null object reference

I checked the NetCipher code and it seems like there is no explicit
method for setting the code in Android versions > lollipop. Is this not
yet supported? I tried the same code on an emulator with Lollipop, but
it still does not work.
What am I missing?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mayfirst.org/pipermail/guardian-dev/attachments/20160526/4b4e15fe/attachment.html>

More information about the guardian-dev mailing list