Created
April 11, 2019 05:44
-
-
Save pyeongho/20bc05ab4648c13cf29d2fb7eff583ad to your computer and use it in GitHub Desktop.
root_tcpip.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void tAdbTcpip() { | |
Thread t = new Thread(() -> { | |
try { | |
Process proc = Runtime.getRuntime() | |
.exec(new String[]{ "su", "-c", "setprop service.adb.tcp.port 5555" }); | |
proc.waitFor(); | |
proc = Runtime.getRuntime() | |
.exec(new String[]{ "su", "-c", "stop adbd" }); | |
proc.waitFor(); | |
proc = Runtime.getRuntime() | |
.exec(new String[]{ "su", "-c", "start adbd" }); | |
proc.waitFor(); | |
} catch (Exception e) { | |
log.e(e.getMessage()); | |
} | |
}); | |
t.start(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment