diff options
Diffstat (limited to 'recovery.cpp')
-rw-r--r-- | recovery.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/recovery.cpp b/recovery.cpp index 6deeaaaed..f3cb06747 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -44,7 +44,7 @@ #include "device.h" #include "adb_install.h" extern "C" { -#include "minadbd/adb.h" +#include "adb.h" #include "fuse_sideload.h" #include "fuse_sdcard_provider.h" } @@ -169,6 +169,11 @@ fopen_path(const char *path, const char *mode) { return fp; } +bool is_ro_debuggable() { + char value[PROPERTY_VALUE_MAX+1]; + return (property_get("ro.debuggable", value, NULL) == 1 && value[0] == '1'); +} + static void redirect_stdio(const char* filename) { // If these fail, there's not really anywhere to complain... freopen(filename, "a", stdout); setbuf(stdout, NULL); @@ -993,7 +998,7 @@ main(int argc, char **argv) { // only way recovery should be run with this argument is when it // starts a copy of itself from the apply_from_adb() function. if (argc == 2 && strcmp(argv[1], "--adbd") == 0) { - adb_main(); + adb_main(0, DEFAULT_ADB_PORT); return 0; } @@ -1112,9 +1117,7 @@ main(int argc, char **argv) { // If this is an eng or userdebug build, then automatically // turn the text display on if the script fails so the error // message is visible. - char buffer[PROPERTY_VALUE_MAX+1]; - property_get("ro.build.fingerprint", buffer, ""); - if (strstr(buffer, ":userdebug/") || strstr(buffer, ":eng/")) { + if (is_ro_debuggable()) { ui->ShowText(true); } } |