Skip to content

Commit

Permalink
Iptables binaries added+Afwall API with needed methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
irinil committed Jul 29, 2020
1 parent e384ca5 commit ff6e686
Show file tree
Hide file tree
Showing 25 changed files with 3,197 additions and 5 deletions.
6 changes: 6 additions & 0 deletions build.gradle
Expand Up @@ -50,6 +50,12 @@ dependencies {
//SU Library for root
implementation 'eu.chainfire:libsuperuser:1.0.0.201704021214'

//RootTools Library
implementation 'com.github.Stericson:RootShell:1.6' //RootTolls depends on RootShell and it's not correctly setUped for the jitpack
implementation ('com.github.Stericson:RootTools:5.0') {//Refer to https://github.com/Stericson/RootTools/issues/65
exclude group: 'com.github.Stericson'
}

//androidX legacy support
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.preference:preference:1.1.1'
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/de/tudarmstadt/informatik/hostage/Hostage.java
Expand Up @@ -48,7 +48,9 @@
import de.tudarmstadt.informatik.hostage.persistence.DAO.AttackRecordDAO;
import de.tudarmstadt.informatik.hostage.protocol.Protocol;
import de.tudarmstadt.informatik.hostage.system.Device;
import de.tudarmstadt.informatik.hostage.system.iptablesUtils.Api;
import de.tudarmstadt.informatik.hostage.ui.activity.MainActivity;
import eu.chainfire.libsuperuser.Shell;

import static de.tudarmstadt.informatik.hostage.commons.HelperUtils.getBSSID;

Expand Down Expand Up @@ -301,9 +303,11 @@ public void onCreate() {
connectionInfoEditor.apply();

mProtocolActiveAttacks = new HashMap<>();

Device.checkCapabilities();
Device.executePortRedirectionScript();
if(Shell.SU.available()) {
Device.checkCapabilities();
if(Api.assertBinaries(getContext(),true))
Device.executePortRedirectionScript();
}
createNotification();
registerNetReceiver();
try {
Expand Down
Expand Up @@ -206,8 +206,7 @@ public static void uninstallPorthack() {try {
logError(p.getErrorStream());
}
logOutput(p.getInputStream());
} catch (IOException e) {
} catch (InterruptedException e) {
} catch (IOException | InterruptedException e) {
}
}

Expand Down

0 comments on commit ff6e686

Please sign in to comment.