Extract "scrcpy-server.jar" string

The filename is used at several places.
This commit is contained in:
Romain Vimont 2019-06-10 15:57:10 +02:00
parent eb34098add
commit 4eb6b26c93

View file

@ -11,14 +11,15 @@
#include "net.h" #include "net.h"
#define SOCKET_NAME "scrcpy" #define SOCKET_NAME "scrcpy"
#define SERVER_FILENAME "scrcpy-server.jar"
#ifdef PORTABLE #ifdef PORTABLE
# define DEFAULT_SERVER_PATH "scrcpy-server.jar" # define DEFAULT_SERVER_PATH SERVER_FILENAME
#else #else
# define DEFAULT_SERVER_PATH PREFIX "/share/scrcpy/scrcpy-server.jar" # define DEFAULT_SERVER_PATH PREFIX "/share/scrcpy/" SERVER_FILENAME
#endif #endif
#define DEVICE_SERVER_PATH "/data/local/tmp/scrcpy-server.jar" #define DEVICE_SERVER_PATH "/data/local/tmp/" SERVER_FILENAME
static const char * static const char *
get_server_path(void) { get_server_path(void) {
@ -86,7 +87,7 @@ execute_server(struct server *server, const struct server_params *params) {
sprintf(bit_rate_string, "%"PRIu32, params->bit_rate); sprintf(bit_rate_string, "%"PRIu32, params->bit_rate);
const char *const cmd[] = { const char *const cmd[] = {
"shell", "shell",
"CLASSPATH=/data/local/tmp/scrcpy-server.jar", "CLASSPATH=/data/local/tmp/" SERVER_FILENAME,
"app_process", "app_process",
"/", // unused "/", // unused
"com.genymobile.scrcpy.Server", "com.genymobile.scrcpy.Server",