Skip to content

Commit

Permalink
Cleaned Iptables API, added chmod 0777 for script.
Browse files Browse the repository at this point in the history
  • Loading branch information
irinil committed Aug 1, 2020
1 parent fdc45c6 commit e5d3a47
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 639 deletions.
Expand Up @@ -94,11 +94,14 @@ private static boolean deployAsset(String assetFilePath, String destFilePath) {

public static void executePortRedirectionScript() {
Api.remountSystem();
String mode="0777";

if (deployAsset("payload/redirect-ports.sh", "redirect-ports.sh")) {
String scriptFilePath = new File(MainActivity.getInstance().getFilesDir(), "redirect-ports.sh").getAbsolutePath();
Process p = null;
try {
Runtime.getRuntime().exec("chmod " + mode + " " + scriptFilePath).waitFor();

p = new ProcessBuilder("su", "-c", "sh "+scriptFilePath).start();
p.waitFor(); // stall the main thread

Expand Down

0 comments on commit e5d3a47

Please sign in to comment.