Skip to content

Commit 999ae0a

Browse files
committed
Closes #489
1 parent 515b337 commit 999ae0a

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

cSploit/src/main/java/org/csploit/android/MainFragment.java

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,22 +1307,29 @@ public void unregister() {
13071307
}
13081308

13091309
private void check() {
1310-
loadInterfaces();
1311-
String current = System.getIfname();
1312-
1313-
Logger.debug(String.format("current='%s', ifaces=[%s], haveInterface=%s, isAnyNetInterfaceAvailable=%s",
1314-
current != null ? current : "(null)",
1315-
ifacesToString(), haveInterface(current), isAnyNetInterfaceAvailable));
1316-
1317-
if (haveInterface(current)) {
1318-
onConnectionResumed();
1319-
} else if (current != null) {
1320-
onConnectionLost();
1321-
} else if (isAnyNetInterfaceAvailable) {
1322-
onNetworkInterfaceChanged();
1323-
}
1324-
13251310
synchronized (getActivity()) {
1311+
getActivity().runOnUiThread(new Runnable() {
1312+
@Override
1313+
public void run() {
1314+
loadInterfaces();
1315+
1316+
String current = System.getIfname();
1317+
1318+
Logger.debug(String.format("current='%s', ifaces=[%s], haveInterface=%s, isAnyNetInterfaceAvailable=%s",
1319+
current != null ? current : "(null)",
1320+
ifacesToString(), haveInterface(current), isAnyNetInterfaceAvailable));
1321+
1322+
if (haveInterface(current)) {
1323+
onConnectionResumed();
1324+
} else if (current != null) {
1325+
onConnectionLost();
1326+
} else if (isAnyNetInterfaceAvailable) {
1327+
onNetworkInterfaceChanged();
1328+
}
1329+
1330+
}
1331+
});
1332+
13261333
mTask = null;
13271334
}
13281335
}

0 commit comments

Comments
 (0)