[APP] Autoproxy for android Http(s), Socks, Proxy.pac Ntlm [24.Aug.13]

Moronig

Senior Member
Dec 2, 2010
419
206
63
Curitiba
Autoproxy creates a transparent/intercepting proxy running on your phone, and redirects web traffic through it, so other apps don't have to be aware there is a proxy. All outgoing traffic is captured, formatted and transmitted through your network's proxy. That means it works with other browsers, gmail and maps. The core of this app is the redsocks proxy redirector, and cntlm. It now works with proxy.pac files.

WARNING: Your phone must be rooted and have an iptables binary with nat support.

Download links at the bottom, scroll down to see

This app is based on the TransProxy app by daveba (link).

I have modified it, and added to the basic funcionality. Please try it and let me know what you think.
Bug reports/suggestions are welcome. (keep in mind this is the first app I release!)

What's new:

Version 0.75 beta[24.Aug.2013]:
  • I ain`t dead!
  • Several bugfixes
  • Updated holo layout
  • Option to check if proxy is at specified address before connection
  • Expanded notification shows sent bytes through proxy (Android > 4.1)
  • option on notification to disconnect (Android > 4.1)
  • Lite version now auto-connects as well (no need to open app)
  • Get newest beta from XDA or directly from Play Store. Must join G+ Community
  • Logs now saved to sdcard

Please report bugs, they will be fixed as soon as possible

Version 0.57 [02.Dez.2011]:
  • Added Thai translation
  • Fixed SQlite errors caused by multiple simultaneous access to the database

Version 0.56 [28.Nov.2011]:
  • Added compatibility to Honeycomb (Android 3.x)
  • Added compatibility to Ice Cream Sandwhich (Android 4.0)
  • Fixed a bug that prevented app from running on Donut (Android 1.6)
  • Added polish translation (thanks Devastator)

Version 0.54 [23.Nov.2011]:
This version and the future ones will be available on the market. Check it out here.
  • Fixed a bug where app would crash if you changed notification options while connected
  • Fixed a bug where it would falsely show as connected if superuser permission given to redsocks, but not to iptables.
  • Updated german and french translations. Thanks elec.ted and Atomusk
  • Added lite version (free, ad-supported) in market.

Version 0.53 [22.Nov.2011]:
  • Fixed a bug where authentication info was not saved
  • Changed package name, you should uninstall the old version before installing this one.

Version 0.5 [21.Nov.2011]:
  • Forward custom ports (Note: your proxy must allow connection through the ports)
  • Added support for proxy.pac files
  • Added support for not proxying connections to a host (for use with connectbot)
  • Connections to local network now go directly (not through proxy)
  • Added connection progress info
  • Fixed a bug where autoproxy would not disconnect when it had FC during connection
  • Logging is now turned off by default
  • Connection now done in background thread
  • Now available in spanish! (thanks stefano.pazzaglia)
  • Now available in italian! (thanks stefano.pazzaglia)
  • Now available in german! (thanks pulverJohnny)
If you wish to see autoproxy in your language, you can help here.

Version 0.33 [14.Nov.2011]:
  • Added localization in french (thanks to mobilis2009)! If you wish to see autoproxy in your language, you can help here.
  • Fixed reconnection bug. Autoproxy will ask for root permissions a lot less now.
  • Streamlined native command execution. Connect/disconnect faster.
  • More stable when autoconnecting to proxy on mobile networks. (Thanks adsl17910 for help testing this)

Version 0.3 [11.Nov.2011]:
  • Added localization in portuguese! If you wish to see autoproxy in your language, you can help here.
  • Minor bugfixes

Version 0.289 [10.Nov.2011]:
  • Added option to always show notification icon, even when disconnected
  • Fixed error "Failed to start proxy.sh (…) bind Address already in use)
  • Fixed error that made Autoproxy ask for root permissions on every network state change
  • Fixed error where autoproxy was connected, but the disconnect button was not enabled
  • Changed command to stop redsocks: manually creating symlink for killall no longer necessary
  • Added another redirect method, will now work for people that had an error "No chain/target/match"
  • Updated redsocks binary (reduced app size)
  • Stops the service when you close the app (by pressing the back key) to save memory. Will not affect functionality
  • Minor UI tweaks

Version 0.27 [4.Nov.2011]:
  • Made it backward compatible with Android 1.6 Donut (api 4)
  • Attempted fix for error "Failed to start proxy.sh (…) bind Address already in use)
  • Moved log files to app-logs folder, under the app path, so that android doesn't auto-delete it.
  • Minor UI changes

Version 0.25 [31.May.2011]:
  • Fixed issue: Error when starting proxy :log_preopen(file:/data/data/net.moronigranja.tproxy/files/../cache/redsocks.log,...): No such file or directory
  • Added limit to cache files, cache will be limited to 1Mb

Version 0.24 [31.May.2011]:
  • Fixed issue: Sometimes doesn't reconnect proxy when rebooting phone
  • Fixed issue: Iptables fails when a hostname is used if the dns lookup returns more than one ip address
  • Added option to disable log
  • Improved log information, to help issue resolution.
  • Added new redsocks binary, with better buffer support

Version 0.2 [19.May.2011]:
  • Fixed FC issues
  • Added SSID/mobile network field in network list
  • Added log option to redsocks (see updated faq)
  • Back button from network list now returns to preferences

Version 0.1 [17.May.2011]:
  • http, https, socks4, socks5, http(s) with ntlm auth supported
  • Multiple proxy settings supported
  • Auto connect to proxy. It will detect your network settings, and connect you automatically when the network is detected (Wifi and Mobile networks)
  • Recognizes a network even through Access Points (APs) with different names
  • ntlm support (not tested with Microsoft ISA or forefront) testers needed!
  • Notifications when proxy is turned on (can be disabled in settings)
  • New, shiny icon.


Known issues:

Planned updates:

  • Support for manually setting Wifi network
  • Apply changes to a connected proxy automatically
  • Allow selection of apps to go through proxy
  • WPAD support (proxy auto-detect)
  • x86 support (on alpha, coming soon!)

Screenshots:




If you want to help translate Autoproxy to your language, you can help at http://www.getlocalization.com/Autoproxy/

Autoproxy is now on the android market, SlideMe Store, Amazon appstore and getjar(lite only). It's $2.95. For all those who have helped in finding bugs, making suggestions or translating, I'll give you a refund on the market if you email me about it.







Lite Version:



 

Attachments

Last edited:

Moronig

Senior Member
Dec 2, 2010
419
206
63
Curitiba
FAQ/Troubleshooting

Q. The proxy is not starting automatically when I connect to my network, what do I do?
A. The proxy will auto-start when it detects the network that you were connected to when the setting was created. If you were not connected to the right network at the time, you must connect manually to the proxy once. Then the app will remember to autostart when connected to that network from now on. It should show "Associated with 1 networks" (1 or more) in the proxy info.

Q. The proxy is turning on when I'm connected to another network, what goes?
A. Perhaps you were connected to this network when you added your proxy settings? If you open the app and click on disconnect, it will know not to autostart the proxy for this network again. You just need to manually start the proxy

Q. How do I root my phone?
A. There are several ways to do it. Search this forum. I personally used z4root, and I've heard good things about Universal 1-click root.

Q. Is this compatible with my phone?
A. If you have root access, and iptables with nat, it should be. I haven't tested it on anything below android 2.1, though, so report if it works for you.

Q. The app says iptables binary was not found in my rom, what can I do?
A. Maybe your rom does have it, but it's on another path. So try this:
go to a shell (either on your phone or adb)
Type: su (your phone must be rooted)
Type: iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to 8123
Type: iptables -L -n -t nat
If that doesn't work, then you don't have iptables on you rom. Check out this post or PM me and I will try to assist you with this problem.

Q. Market is not working, it hangs at 'Starting Download'. Is there a way around that?
A. Sorry, but I can't help you there. This is often caused by port 5228, used by market to authenticate, being blocked by your proxy. Apparently this causes issues with gtalk as well. You'd have to redirect through somewhere else, using VPN or an SSH tunnel.

Q. I'm getting an error "Failed to start proxy.sh (…) bind Address already in use" when my phone wakes from sleep.
A. This problem was most likely caused by some roms not having killall linked. (Thanks @Misato-chan). Update to version 0.27 or later to fix it.

Q. It's not working for me!
A. Let's try and fix it, post your problem with at least the following:
Problem description
Phone make/model
Android version
Version of the app you're running
Error messages(if any)
Logs: redsocks.log and tproxy.log (can be found on /data/data/net.moronigranja.tproxy/app-logs)
Warning Will contain some private information (eg: ip address of sites you tried to access) so you may email them to me instead of posting here (moronigranja at ymail dot com)
Type of proxy
 
Last edited:

wallla

Senior Member
Jun 13, 2010
100
12
0
Thank you a lot. I will try it for sure.


One little "bug" I've already discovered:
In preferences, click on "View Networks", then go back via the hardware-back-button. Normally I would expect to get back to the preferences-screen, but instead I land on the main activity.
 

ryteng

Member
Nov 7, 2009
7
1
0
Hi Moronig,
Good Job!! Finally your version work for me!! Thank you very much!
Perhaps previous version by daveba might work, I followed your guide in http://forum.xda-developers.com/showthread.php?t=766569&page=76 Post #752. with your version and the magic happen! You should include the iptables issues in your FAQ since many phone doesnt come with it.

BTW, I am testing with China tablet M701 Telechip TCC8902 base. Gingerbread 2.3.1. Browser work, will continue to test Market.

Keep up the good job!

Cheers!
 

Moronig

Senior Member
Dec 2, 2010
419
206
63
Curitiba
Thank you a lot. I will try it for sure.


One little "bug" I've already discovered:
In preferences, click on "View Networks", then go back via the hardware-back-button. Normally I would expect to get back to the preferences-screen, but instead I land on the main activity.
Thanks walla. I will take a look, it will be fixed on the next release.

Hi Moronig,
Good Job!! Finally your version work for me!! Thank you very much!
Perhaps previous version by daveba might work, I followed your guide in http://forum.xda-developers.com/showthread.php?t=766569&page=76 Post #752. with your version and the magic happen! You should include the iptables issues in your FAQ since many phone doesnt come with it.

BTW, I am testing with China tablet M701 Telechip TCC8902 base. Gingerbread 2.3.1. Browser work, will continue to test Market.

Keep up the good job!

Cheers!
Good idea, I will do that.
 
  • Like
Reactions: TheOne741

Valantur

Senior Member
Aug 19, 2010
101
31
28
Thanks for taking this project forward.

One small request that I'd like to make is to include a way for assigning proxies depending on the SSID of the network. That feature would allow me to configure different proxies for different networks beforehand, and also is less traumatic if the network changes the ip address and gateway that assigns to each connection.

Thanks!!
 

XZQ't

Senior Member
Jan 14, 2010
142
17
0
It's not working for me. Here's the information.

Problem description : internet not working - all apps
Phone make/model : Samsung Galaxy S II , rooted, kernel version XWKE1
Android version : 2.3.3
Version of the app you're running : 0.1
Error messages :



Logcat trace : http://pastebin.com/BYf3PvcZ
Type of proxy : http without authentication
 
Last edited:

ryteng

Member
Nov 7, 2009
7
1
0
Moronig,
Can you provide earlier version of iptable (v1.4.5)?

Current version is not working on my second tablet..

Tablet Model : Hiapad freescale IMX515
Android version : Froyo 2.2
Kernel version: 2.6.31
iptable version: 1.4.7
 

Moronig

Senior Member
Dec 2, 2010
419
206
63
Curitiba
Moronig,
Can you provide earlier version of iptable (v1.4.5)?

Current version is not working on my second tablet..

Tablet Model : Hiapad freescale IMX515
Android version : Froyo 2.2
Kernel version: 2.6.31
iptable version: 1.4.7
I don't have version 1.4.5, my version is 1.3.7, but I'll attach it. Can you send me a copy of yours for testing?
 

Attachments

  • Like
Reactions: TheOne741

XZQ't

Senior Member
Jan 14, 2010
142
17
0
Refer to my previous post , I've tried Auto Proxy with my Nexus One running CM7 (2.3.3) . It works perfectly.

So the reason why Auto Proxy doesn't work with Samsung Galaxy S II (which use same android version as Nexus One) should be model specific.

Hope this help ..
 

n710c

Member
Aug 30, 2008
6
1
0
It was force close at first time when I turn off my 3G network (I set my proxy on when 3G network on) but it works fine after. hope no to see fc again :)

Thanks for the great work.
 

Milraun

Member
Jan 26, 2011
9
1
0
No success for me too. :(

I'm running Elelinux 2.3 on my Hero GSM.

Here are the logs of connecting to the proxy.

Code:
D/tproxy  ( 3739): Updating wireless network info for proxy...
I/tproxy  ( 3739): Received start id 17: Intent { cmp=net.moronigranja.tproxy/.ProxyService (has extras) }
I/tproxy  ( 3739): Proxy is being started...
V/tproxy  ( 3739): proxy.sh start /data/data/net.moronigranja.tproxy/files type=http host=192.168.254.1 port=8000 auth=false user= p
ass=*****
V/tproxy  ( 3739): Proxy was started.
D/su      ( 3853): 10100 net.moronigranja.tproxy executing 0 /system/bin/sh using shell /system/bin/sh : sh
V/tproxy  ( 3739): Successfully ran redirect.sh start
V/tproxy  ( 3739): Successfully ran redirect.sh start http
I/PROFILE (  215): Group: Gmail containing : net.moronigranja.tproxy : false
I/PROFILE (  215): Group: Phone containing : net.moronigranja.tproxy : false
I/PROFILE (  215): Group: Calendar containing : net.moronigranja.tproxy : false
I/PROFILE (  215): Group: Email containing : net.moronigranja.tproxy : false
I/PROFILE (  215): Group: SMS containing : net.moronigranja.tproxy : false
V/NotificationService(  215): Pkg: net.moronigranja.tproxy group: Anderes
D/tproxy  ( 3739): updating connected proxy information
iptables version is v1.3.7

How can I analyse the problem further ?

Thx in advance

Milraun
 

Moronig

Senior Member
Dec 2, 2010
419
206
63
Curitiba
Thanks for taking this project forward.

One small request that I'd like to make is to include a way for assigning proxies depending on the SSID of the network. That feature would allow me to configure different proxies for different networks beforehand, and also is less traumatic if the network changes the ip address and gateway that assigns to each connection.

Thanks!!
Valantur, I'm adding that to the TODO list, should be out soon.

No success for me too. :(

I'm running Elelinux 2.3 on my Hero GSM.

Here are the logs of connecting to the proxy.

...

iptables version is v1.3.7

How can I analyse the problem further ?

Thx in advance

Milraun
Milraun, install the latest version, and send me the logs (see the FAQ) or just take a look at them, especially redsocks.log to see what is going on.
 
  • Like
Reactions: TheOne741