|
|
@ -14,8 +14,6 @@ import java.io.IOException;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public final class CleanUp {
|
|
|
|
public final class CleanUp {
|
|
|
|
|
|
|
|
|
|
|
|
public static final String SERVER_PATH = "/data/local/tmp/scrcpy-server.jar";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// A simple struct to be passed from the main process to the cleanup process
|
|
|
|
// A simple struct to be passed from the main process to the cleanup process
|
|
|
|
public static class Config implements Parcelable {
|
|
|
|
public static class Config implements Parcelable {
|
|
|
|
|
|
|
|
|
|
|
@ -135,13 +133,13 @@ public final class CleanUp {
|
|
|
|
String[] cmd = {"app_process", "/", CleanUp.class.getName(), config.toBase64()};
|
|
|
|
String[] cmd = {"app_process", "/", CleanUp.class.getName(), config.toBase64()};
|
|
|
|
|
|
|
|
|
|
|
|
ProcessBuilder builder = new ProcessBuilder(cmd);
|
|
|
|
ProcessBuilder builder = new ProcessBuilder(cmd);
|
|
|
|
builder.environment().put("CLASSPATH", SERVER_PATH);
|
|
|
|
builder.environment().put("CLASSPATH", Server.SERVER_PATH);
|
|
|
|
builder.start();
|
|
|
|
builder.start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void unlinkSelf() {
|
|
|
|
public static void unlinkSelf() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
new File(SERVER_PATH).delete();
|
|
|
|
new File(Server.SERVER_PATH).delete();
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
Ln.e("Could not unlink server", e);
|
|
|
|
Ln.e("Could not unlink server", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|