mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-01 05:18:38 +00:00
update:server删除由server自己负责
This commit is contained in:
parent
5ef8d9bcab
commit
b0c228df02
4 changed files with 18 additions and 34 deletions
|
@ -14,7 +14,7 @@ public final class DesktopConnection implements Closeable {
|
|||
|
||||
private static final int DEVICE_NAME_FIELD_LENGTH = 64;
|
||||
|
||||
private static final String SOCKET_NAME = "scrcpy";
|
||||
private static final String SOCKET_NAME = "qtscrcpy";
|
||||
|
||||
private final LocalSocket socket;
|
||||
private final InputStream inputStream;
|
||||
|
|
|
@ -2,10 +2,14 @@ package com.genymobile.scrcpy;
|
|||
|
||||
import android.graphics.Rect;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class Server {
|
||||
|
||||
private static final String SERVER_PATH = "/data/local/tmp/scrcpy-server.jar";
|
||||
|
||||
private Server() {
|
||||
// not instantiable
|
||||
}
|
||||
|
@ -82,6 +86,14 @@ public final class Server {
|
|||
return new Rect(x, y, x + width, y + height);
|
||||
}
|
||||
|
||||
private static void unlinkSelf() {
|
||||
try {
|
||||
new File(SERVER_PATH).delete();
|
||||
} catch (Exception e) {
|
||||
Ln.e("Cannot unlink server", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String... args) throws Exception {
|
||||
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
|
||||
@Override
|
||||
|
@ -90,6 +102,7 @@ public final class Server {
|
|||
}
|
||||
});
|
||||
|
||||
unlinkSelf();
|
||||
Options options = createOptions(args);
|
||||
scrcpy(options);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue