adb
root
android 7.1.1 & 9
--- a/adb/daemon/main.cpp
+++ b/adb/daemon/main.cpp
@@ -64,6 +64,9 @@ static void drop_capabilities_bounding_set_if_needed() {
}
static bool should_drop_privileges() {
+#ifndef ORIGINAL_ADBD_ROOT
+ return false;
+#else
#if defined(ALLOW_ADBD_ROOT)
char value[PROPERTY_VALUE_MAX];
@@ -104,6 +107,7 @@ static bool should_drop_privileges() {
#else
return true; // "adb root" not allowed, always drop privileges.
#endif // ALLOW_ADBD_ROOT
+#endif
}
static void drop_privileges(int server_port) {
android 11
--- a/adb/daemon/main.cpp
+++ b/adb/daemon/main.cpp
@@ -63,6 +63,9 @@
static const char* root_seclabel = nullptr;
static bool should_drop_privileges() {
+#ifndef ORIGINAL_ANDROID
+ return false;
+#else
// The properties that affect `adb root` and `adb unroot` are ro.secure and
// ro.debuggable. In this context the names don't make the expected behavior
// particularly obvious.
@@ -92,6 +95,7 @@ static bool should_drop_privileges() {
}
return drop;
+#endif
}
static void drop_privileges(int server_port) {
remount
android 11
adb shell
echo 0 > /d/mmc0/sw_wp_en
mount -o remount -w /
mount -o remount -w /vendor
print_packet
--- a/adb/adb.cpp
+++ b/adb/adb.cpp
@@ -155,7 +155,7 @@ void handle_offline(atransport *t)
}
#if DEBUG_PACKETS
-#define DUMPMAX 32
+#define DUMPMAX 256
void print_packet(const char *label, apacket *p)
{
const char* tag;
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -164,7 +164,7 @@ apacket* get_apacket(void);
void put_apacket(apacket* p);
// Define it if you want to dump packets.
-#define DEBUG_PACKETS 0
+#define DEBUG_PACKETS 1
#if !DEBUG_PACKETS
#define print_packet(tag, p) \
--- a/adb/adb_utils.cpp
+++ b/adb/adb_utils.cpp
@@ -157,7 +157,7 @@ bool mkdirs(const std::string& path) {
}
std::string dump_hex(const void* data, size_t byte_count) {
- size_t truncate_len = 16;
+ size_t truncate_len = 256;
bool truncated = false;
if (byte_count > truncate_len) {
byte_count = truncate_len;
usb otg
msm8953
echo 0 > /sys/bus/platform/drivers/usbdetect/usb_mode
echo 1 > /sys/bus/platform/drivers/usbdetect/usb_mode
rk3399
echo 1 > /sys/bus/platform/drivers/extcon-usb-gpio/usb_mode
echo 0 > /sys/bus/platform/drivers/extcon-usb-gpio/usb_mode
ac8257
echo device > /sys/cl