Skip to content

Display and control your Android device

Remove sc_adb_get_serialno()

Romain Vimont9c545e8c29b7
diff --git a/app/src/adb/adb.c b/app/src/adb/adb.c
index baa0e406..2afe11c5 100644
--- a/app/src/adb/adb.c
+++ b/app/src/adb/adb.c
@@ -587,38 +587,6 @@ sc_adb_getprop(struct sc_intr *intr, const char *serial, const char *prop,
return strdup(buf);
}
-char *
-sc_adb_get_serialno(struct sc_intr *intr, unsigned flags) {
- const char *const argv[] = SC_ADB_COMMAND("get-serialno");
-
- sc_pipe pout;
- sc_pid pid = sc_adb_execute_p(argv, flags, &pout);
- if (pid == SC_PROCESS_NONE) {
- LOGE("Could not execute \"adb get-serialno\"");
- return NULL;
- }
-
- char buf[128];
- ssize_t r = sc_pipe_read_all_intr(intr, pid, pout, buf, sizeof(buf) - 1);
- sc_pipe_close(pout);
-
- bool ok = process_check_success_intr(intr, pid, "adb get-serialno", flags);
- if (!ok) {
- return NULL;
- }
-
- if (r == -1) {
- return NULL;
- }
-
- assert((size_t) r < sizeof(buf));
- buf[r] = '\0';
- size_t len = strcspn(buf, " \r\n");
- buf[len] = '\0';
-
- return strdup(buf);
-}
-
char *
sc_adb_get_device_ip(struct sc_intr *intr, const char *serial, unsigned flags) {
assert(serial);
diff --git a/app/src/adb/adb.h b/app/src/adb/adb.h
index 04e2c985..ac9e15b0 100644
--- a/app/src/adb/adb.h
+++ b/app/src/adb/adb.h
@@ -86,14 +86,6 @@ char *
sc_adb_getprop(struct sc_intr *intr, const char *serial, const char *prop,
unsigned flags);
-/**
- * Execute `adb get-serialno`
- *
- * Return the result, to be freed by the caller, or NULL on error.
- */
-char *
-sc_adb_get_serialno(struct sc_intr *intr, unsigned flags);
-
/**
* Attempt to retrieve the device IP
*