Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Remove expensive checks
Browse files Browse the repository at this point in the history
Refs #1398
  • Loading branch information
M66B committed Feb 21, 2014
1 parent 6a11f2e commit 4e904af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/biz/bokhorst/xprivacy/XIoBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ public static List<XHook> getInstances() {
@SuppressLint("SdCardPath")
protected void before(XParam param) throws Throwable {
if (mMethod == Methods.connect) {
if (param.args.length > 2 && param.args[1] instanceof InetAddress && param.doesThrow(SocketException.class)) {
if (param.args.length > 2 && param.args[1] instanceof InetAddress) {
InetAddress address = (InetAddress) param.args[1];
int port = (Integer) param.args[2];
if (isRestrictedExtra(param, address.toString() + ":" + port))
param.setThrowable(new SocketException("XPrivacy"));
}

} else if (mMethod == Methods.open) {
if (param.args.length > 0 && param.args[0] != null && param.doesThrow(FileNotFoundException.class)) {
if (param.args.length > 0 && param.args[0] != null) {
String fileName = (String) param.args[0];
if (mFileName == null) {
String externalStorage = System.getenv("EXTERNAL_STORAGE");
Expand Down Expand Up @@ -118,7 +118,7 @@ protected void before(XParam param) throws Throwable {
}

} else if (mMethod == Methods.socket) {
if (isRestricted(param) && param.doesThrow(SocketException.class))
if (isRestricted(param))
param.setThrowable(new SocketException("XPrivacy"));

} else
Expand Down

0 comments on commit 4e904af

Please sign in to comment.