Skip to content

Commit

Permalink
Fix class cast exception (support info)
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Feb 7, 2014
1 parent 29b7610 commit 7ade296
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/biz/bokhorst/xprivacy/XWebView.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ protected void before(MethodHookParam param) throws Throwable {
// Do nothing

} else if (mMethod == Methods.loadUrl) {
if (param.args.length > 0)
if (isRestrictedExtra(param, (String) param.args[0])) {
if (param.args.length > 0) {
String extra = (param.args[0] instanceof String ? (String) param.args[0] : null);
if (isRestrictedExtra(param, extra)) {
String ua = (String) PrivacyManager.getDefacedProp(Binder.getCallingUid(), "UA");
WebView webView = (WebView) param.thisObject;
if (webView != null)
webView.getSettings().setUserAgentString(ua);
}
}

} else
Util.log(this, Log.WARN, "Unknown method=" + param.method.getName());
Expand Down

0 comments on commit 7ade296

Please sign in to comment.