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

Vanitas Vitae vanitasvitae at riseup.net
Fri May 27 09:52:31 EDT 2016


I think I found my mistake. I accidentally used port 0 instead of 8118.
Now it seems to work.
I still get logcat output that sais
"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"
but when I load "https://check.torproject.org", the site indicates that
I'm using tor.

What definitely doesn't work is to reset the proxy. I get

"V/OrbotHelpher: java.lang.NoSuchFieldException: mLoadedApk
                                                                                
at java.lang.Class.getField(Class.java:891)
                                                                                
at
info.guardianproject.netcipher.web.WebkitProxy.setKitKatProxy(WebkitProxy.java:278)
                                                                                
at
info.guardianproject.netcipher.web.WebkitProxy.resetKitKatProxy(WebkitProxy.java:261)
                                                                                
at
info.guardianproject.netcipher.web.WebkitProxy.resetProxy(WebkitProxy.java:648)
                                                                                
at
com.github.dfa.diaspora_android.activity.MainActivity$override.resetProxy(MainActivity.java:1195)
                                                                                
at
com.github.dfa.diaspora_android.activity.MainActivity$override.access$dispatch(MainActivity.java)
                                                                                
at
com.github.dfa.diaspora_android.activity.MainActivity.resetProxy(MainActivity.java:0)
                                                                                
at java.lang.reflect.Method.invoke(Native Method)
                                                                                
at
com.android.tools.fd.runtime.AndroidInstantRuntime.invokeProtectedMethod(AndroidInstantRuntime.java:143)
                                                                                
at
com.github.dfa.diaspora_android.activity.MainActivity$override.onNavigationItemSelected(MainActivity.java:1109)
                                                                                
at
com.github.dfa.diaspora_android.activity.MainActivity$override.access$dispatch(MainActivity.java)
                                                                                
at
com.github.dfa.diaspora_android.activity.MainActivity.onNavigationItemSelected(MainActivity.java:0)
                                                                                
at
android.support.design.widget.NavigationView$1.onMenuItemSelected(NavigationView.java:151)
                                                                                
at
android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:811)
                                                                                
at
android.support.v7.view.menu.SubMenuBuilder.dispatchMenuItemSelected(SubMenuBuilder.java:84)
                                                                                
at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
                                                                                
at
android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:958)
                                                                                
at
android.support.design.internal.NavigationMenuPresenter$1.onClick(NavigationMenuPresenter.java:318)
                                                                                
at android.view.View.performClick(View.java:5198)
                                                                                
at android.view.View$PerformClick.run(View.java:21147)
                                                                                
at android.os.Handler.handleCallback(Handler.java:739)
                                                                                
at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                
at android.os.Looper.loop(Looper.java:148)
                                                                                
at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                
at java.lang.reflect.Method.invoke(Native Method)
                                                                                
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)"

and the app still tries to use tor.
I use this code to reset the proxy:
"WebkitProxy.resetProxy(MainActivity.class.getName(),
this.getApplicationContext());"

Am 27.05.2016 um 15:09 schrieb Nathan of Guardian:
> This is the commit that Orweb is built against:
> https://github.com/guardianproject/NetCipher/blob/98f830938a26e798d993e7b5d086fc57da7d3ec7/libnetcipher/src/info/guardianproject/onionkit/web/WebkitProxy.java
>
>
>
> On Fri, May 27, 2016, at 05:28 AM, VanitasVitae wrote:
>> I just installed Orweb and tested it with some onion addresses. Orweb
>> seems to work fine.
>>
>> Am 27. Mai 2016 11:11:27 MESZ, schrieb Hans-Christoph Steiner
>> <hans at guardianproject.info>:
>>> Sounds like we should set a maxSdkVersion on Orweb then.  Does it not
>>> work with android-23?
>>>
>>> .hc
>>>
>>> Vanitas Vitae:
>>>> Okay, thank you for the quick response :)
>>>>
>>>> It's a shame that Google has not yet added an option to set a proxy
>>> to
>>>> the WebView itself.
>>>>
>>>> Vanitas
>>>>
>>>> Am 26.05.2016 um 19:17 schrieb Nathan of Guardian:
>>>>> On Thu, May 26, 2016, at 12:44 PM, Vanitas Vitae wrote:
>>>>>> 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?
>>>>> You aren't missing anything yet. I think we just haven't updated the
>>>>> code to support WebView on Android 6. Each major OS changes the
>>> method
>>>>> for proxying, and in some cases makes it impossible. 
>>>>>
>>>>> This is why we have moved to Orfox, building on Firefox/Gecko code,
>>>>> instead of Android's WebView.
>>>>>
>>>>> That said, we are doing some work on a project that needs this, as
>>> well,
>>>>> so if anyone has the code to add Marshmallow support, then I would
>>> be
>>>>> happy to integrate it into NetCipher.
>>>>>
>>>> _______________________________________________
>>>> List info: https://lists.mayfirst.org/mailman/listinfo/guardian-dev
>>>> To unsubscribe, email:  guardian-dev-unsubscribe at lists.mayfirst.org
>>>>
>>> -- 
>>> PGP fingerprint: EE66 20C7 136B 0D2C 456C  0A4D E9E2 8DEA 00AA 5556
>>> https://pgp.mit.edu/pks/lookup?op=vindex&search=0xE9E28DEA00AA5556
>>> _______________________________________________
>>> List info: https://lists.mayfirst.org/mailman/listinfo/guardian-dev
>>> To unsubscribe, email:  guardian-dev-unsubscribe at lists.mayfirst.org
>> -- 
>> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
>> gesendet.
>> _______________________________________________
>> List info: https://lists.mayfirst.org/mailman/listinfo/guardian-dev
>> To unsubscribe, email:  guardian-dev-unsubscribe at lists.mayfirst.org
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mayfirst.org/pipermail/guardian-dev/attachments/20160527/772ad657/attachment.html>


More information about the guardian-dev mailing list