From 1e22ebcac2719fe6a1fda73d8c3bc78fb202ed84 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 16 Nov 2018 18:36:17 +0100 Subject: [PATCH] Always use non-empty arguments The client passes parameters to the server via "adb shell" arguments. Use "-" instead of "" when no crop is specified to avoid empty arguments, which are not handled the same way on all devices. Fixed . --- app/src/server.c | 2 +- server/src/main/java/com/genymobile/scrcpy/Server.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/server.c b/app/src/server.c index 3ad21511..31bf64de 100644 --- a/app/src/server.c +++ b/app/src/server.c @@ -93,7 +93,7 @@ static process_t execute_server(const char *serial, max_size_string, bit_rate_string, tunnel_forward ? "true" : "false", - crop ? crop : "''", + crop ? crop : "-", send_frame_meta ? "true" : "false", }; return adb_execute(serial, cmd, sizeof(cmd) / sizeof(cmd[0])); diff --git a/server/src/main/java/com/genymobile/scrcpy/Server.java b/server/src/main/java/com/genymobile/scrcpy/Server.java index db06cedb..0dabb69f 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Server.java +++ b/server/src/main/java/com/genymobile/scrcpy/Server.java @@ -71,7 +71,7 @@ public final class Server { } private static Rect parseCrop(String crop) { - if (crop.isEmpty()) { + if ("-".equals(crop)) { return null; } // input format: "width:height:x:y"