android的浏览器(chrome lite)支持设置代理服务器 ProxySetting 1.0 Set proxy for android web browser

1,409 views
Skip to first unread message

Max贝立.NoGFW审查

unread,
Aug 1, 2010, 8:01:26 AM8/1/10
to nogfw
 
Android内置浏览器设置代理服务器的方法
目前浏览器是没有设置代理的ui界面的,但是浏览器的设置是放在内置的sqlite数据库中,所以可以直接操作数据库来更改代理设置。
  • 连接上android内部shell(用adb shell或者安装个Terminal Emulator,这步这里不教,自己搞定)
  • 输入以下命令:
    sqlite3 /data/data/com.google.android.providers.settings/databases/settings.db
  • 出现sqlite>提示符后,再输入以下命令:
    sqlite> INSERT INTO system VALUES(99,’http_proxy', 'proxy:port');
    sqlite>.exit
    注意第一行命令后面的分号和第二行命令前面的点号。
这样就完成了设置了,当然,只支持http代理,而且这个东西也不是很方便。我再琢磨一下,如果需要写个小程序自动切换。

Configure a Wifi Proxy on Android.

http://handheld.softpedia.com/get/Network/ProxySetting-79209.shtml

ProxySetting is a simple application for Google's Android platform that allows users to specify an HTTP Proxy address to use when connected to a Wifi network.

At the time of writing Android only allows HTTP traffic to be directed at a proxy when using a Mobile network. It is likely that Android will be updated in the future to support the use of Proxies on Wifi networks, but for now this application aims to solve the problem.

Limitations

ProxySetting only allows the browser to work behind a proxy, because the browser checks for a configured proxy in the database and uses that proxy if the phone is on a mobile network, but the other apps don't do this.

The ProxySetting app updates the relevant information in the database and then sends a notification to the browser that the phone is using a mobile network (even though it's actually on wifi). So the browser thinks it's on a mobile network and updates it's proxy information, requests are then sent over wifi to the proxy.

The other apps seem to ignore the proxy settings (possibly they're not using HTTP and the proxy settings are specific to HTTP).

 

Set proxy for android web browser

There is no UI for proxy settings for android web browser. But the android web browser will read the proxy settings in its settings database.
Here is the instructions to enable the proxy in the android web browser.

  1. > adb shell
  2. # sqlite3 /data/data/com.google.android.providers.settings/databases/settings.db
  3. sqlite> INSERT INTO system VALUES(99,’http_proxy', 'proxy:port');
  4. sqlite>.exit
You can talk to settings.db for more information.
  1. sqlite> SELECT * FROM system;
  2. sqlite> .tables
  3. sqlite> .databases
  4. sqlite> .schema table_name
  5. sqlite> more SQL expression to talk to the tables
Don't forget the ';' at the end of the SQL expression.

Posted by rtm at 7:33 PM

Labels: Android sqlite3 and database

12 comments:

Ale said...

This is exactly what i was looking for! Thank you. One question: according to you, is it possible to make sqlite queries from a java application?

January 31, 2008 7:11 AM
rtm said...

I didn't try the sqlite3 in the java application. But you can try in the following two ways: 1. catenate the strings of sqlite3 database_name and sql command, place sql command into "" (quotation), run the command in java, just like invoke a process; 2. java includes the opendatabase(...) and so you will get the database context, with that context you can operate the database.


--
Max贝立
*《GFW,我们不高兴!Say NO!  to GFW 百万人反GFW审查大呛声》:之主题:反GFW封锁,反互联网审查,反上网实名制,反雇佣5毛,反对侵犯隐私权,监视公民邮信,电脑!GFW,我们不高兴!

请帮助Re推下面的微博短文,谢谢

#nogfw 我相信能召集百万人反GFW审查:请电邮nogfw+s...@googlegroups.com响应,汇集百万呼吁,www.google.hk/group/nogfw/ 将自动统计人数。 #GFW,我们不高兴!请RT 成功就在指尖!
Reply all
Reply to author
Forward
0 new messages