Android调试大杂烩

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值