Comments (2)
Well, this is just modified code I'm using but I'm sure you see how to adapt it
to the current codebase.
Original comment by [email protected]
on 17 May 2012 at 7:36
from zirco-browser.
private static boolean setProxy(Context ctx, String host, int port)
{
boolean ret = false;
try
{
if(Build.VERSION.SDK_INT < 14)
{
Object requestQueueObject = getRequestQueue(ctx);
if (requestQueueObject != null)
{
//Create Proxy config object and set it into request Q
HttpHost httpHost = new HttpHost(host, port, "http");
setDeclaredField(requestQueueObject, "mProxyHost", httpHost);
//Log.d("Webkit Setted Proxy to: " + host + ":" + port);
ret = true;
}
}
else
{
ret=setICSProxy(host,port);
}
}
catch (Exception e)
{
Log.e("ProxySettings","Exception setting WebKit proxy settings: " + e.toString());
}
return ret;
}
private static boolean setICSProxy(String host, int port) throws ClassNotFoundException,
NoSuchMethodException, IllegalArgumentException, InstantiationException,
IllegalAccessException, InvocationTargetException {
Class webViewCoreClass = Class.forName("android.webkit.WebViewCore");
Class proxyPropertiesClass = Class.forName("android.net.ProxyProperties");
if (webViewCoreClass != null && proxyPropertiesClass != null) {
Method m = webViewCoreClass.getDeclaredMethod("sendStaticMessage", Integer.TYPE,
Object.class);
Constructor c = proxyPropertiesClass.getConstructor(String.class, Integer.TYPE,
String.class);
m.setAccessible(true);
c.setAccessible(true);
Object properties = c.newInstance(host, port, null);
m.invoke(null, PROXY_CHANGED, properties);
return true;
}
Original comment by [email protected]
on 17 May 2012 at 7:36
from zirco-browser.
Related Issues (20)
- cannot add new bookmark when legacy browser disable bookmark.
- Open unwanted old websites/tab
- Dowload crash
- New corrections for the Chinese translations of the Zirco Browser HOT 3
- browser errors for htc
- JellyBean: Crashing when entering URL into address bar HOT 1
- File appears to be downloading when network disconnected
- Force close on offsite links from Google+ mobile site
- lacks simple instruction for custom search
- I want to know how to browse all websites through google mobile(Mobile Gateway) ?
- Save As Web Page Complete/Offline Browsing
- Cannot access ports other than default 80 HOT 1
- Open video page of the biggest Chinese video site would crash
- Program sends a security exception registering for location updates from system HOT 2
- per site settings (javascript, user agent)
- predefined user agent strings
- Having trouble accessing Moshi Monsters web site, Flash plug-in isn't working
- Psiphon: INSTALL_FAILED_CONFLICTING_PROVIDER
- 請問我的手機為三星sm-G71o2如要換zirco的瀏覽器有没有影響因現在手機出現了當當的所以此裝置会改善嗎還有我的裝置管理員好像不是先前的管理員因有的工具沒有檔案流失請說明
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zirco-browser.