Compare commits
1 Commits
adb_hint.2
...
adb_hint
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
665488298e |
@@ -57,17 +57,14 @@ argv_to_string(const char *const *argv, char *buf, size_t bufsize) {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
show_adb_installation_msg() {
|
show_adb_installation_msg() {
|
||||||
#ifndef __WINDOWS__
|
|
||||||
static const struct {
|
static const struct {
|
||||||
const char *binary;
|
const char *binary;
|
||||||
const char *command;
|
const char *command;
|
||||||
} pkg_managers[] = {
|
} pkg_managers[] = {
|
||||||
{"apt", "apt install adb"},
|
{"apt", "apt install adb"},
|
||||||
{"apt-get", "apt-get install adb"},
|
{"apt-get", "apt-get install adb"},
|
||||||
{"brew", "brew cask install android-platform-tools"},
|
{"brew", "brew install android-platform-tools"},
|
||||||
{"dnf", "dnf install android-tools"},
|
{"dnf", "dnf install android-tools"},
|
||||||
{"emerge", "emerge dev-util/android-tools"},
|
|
||||||
{"pacman", "pacman -S android-tools"},
|
|
||||||
};
|
};
|
||||||
for (size_t i = 0; i < ARRAY_LEN(pkg_managers); ++i) {
|
for (size_t i = 0; i < ARRAY_LEN(pkg_managers); ++i) {
|
||||||
if (cmd_search(pkg_managers[i].binary)) {
|
if (cmd_search(pkg_managers[i].binary)) {
|
||||||
@@ -75,7 +72,6 @@ show_adb_installation_msg() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
LOGI("You may download and install 'adb' from "
|
LOGI("You may download and install 'adb' from "
|
||||||
"https://developer.android.com/studio/releases/platform-tools");
|
"https://developer.android.com/studio/releases/platform-tools");
|
||||||
|
|||||||
@@ -43,10 +43,8 @@ enum process_result {
|
|||||||
PROCESS_ERROR_MISSING_BINARY,
|
PROCESS_ERROR_MISSING_BINARY,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef __WINDOWS__
|
|
||||||
bool
|
bool
|
||||||
cmd_search(const char *file);
|
cmd_search(const char *file);
|
||||||
#endif
|
|
||||||
|
|
||||||
enum process_result
|
enum process_result
|
||||||
cmd_execute(const char *const argv[], process_t *process);
|
cmd_execute(const char *const argv[], process_t *process);
|
||||||
|
|||||||
@@ -6,6 +6,12 @@
|
|||||||
#include "util/log.h"
|
#include "util/log.h"
|
||||||
#include "util/str_util.h"
|
#include "util/str_util.h"
|
||||||
|
|
||||||
|
bool
|
||||||
|
cmd_search(const char *file) {
|
||||||
|
// :/
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
build_cmd(char *cmd, size_t len, const char *const argv[]) {
|
build_cmd(char *cmd, size_t len, const char *const argv[]) {
|
||||||
// Windows command-line parsing is WTF:
|
// Windows command-line parsing is WTF:
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public final class Workarounds {
|
|||||||
mInitialApplicationField.set(activityThread, app);
|
mInitialApplicationField.set(activityThread, app);
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
// this is a workaround, so failing is not an error
|
// this is a workaround, so failing is not an error
|
||||||
Ln.d("Could not fill app info: " + throwable.getMessage());
|
Ln.w("Could not fill app info: " + throwable.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user