adb未授权,无法连接问题的解决措施

1 篇文章 0 订阅
0 篇文章 0 订阅

本例是解决ffbm模式 adb未授权,无法连接的问,其他情况类似,做个记录做备忘

原理:

如果是ffbm模式启动,则函数 int adb_auth_verify(uint8_t* token, uint8_t* sig, int siglen) 直接返回1

路径:system/core/adb/adb_auth_client.cpp



commit dd9ea32488c4064fd958019de1ae825d5bbfa038

Author: xxx <xxx@localhost>
Date:   Tue Nov 15 20:23:00 2016 +0800


    user版本ffbm模式 adb未授权,无法连接
    
    Change-Id: I1f847ab4bfe76eaef82e10bebf1e3d1dbcbe7848


diff --git a/system/core/adb/adb_auth_client.cpp b/system/core/adb/adb_auth_client.cpp
index 8e7d38be..1ec4339 100644
--- a/system/core/adb/adb_auth_client.cpp
+++ b/system/core/adb/adb_auth_client.cpp
@@ -32,6 +32,8 @@
 #include "fdevent.h"
 #include "transport.h"
 
+#include "cutils/properties.h"
+
 struct adb_public_key {
     struct listnode node;
     RSAPublicKey key;
@@ -43,6 +45,13 @@ static const char *key_paths[] = {
     NULL
 };
 
+static const char *ffbm_boot_mode_string[] = {
+    "ffbm-00",
+    "ffbm-01",
+    "ffbm-02"
+};
+
+
 static fdevent listener_fde;
 static int framework_fd = -1;
 
@@ -143,6 +152,19 @@ int adb_auth_verify(uint8_t* token, uint8_t* sig, int siglen)
     struct listnode *item;
     struct listnode key_list;
     int ret = 0;
+
+//jimbo add start for ffbm adb connect
+    char boot_mode[PROPERTY_VALUE_MAX] = { 0 };
+    unsigned long i = 0;
+
+   /**Get mode from misc boot mode,overwrite the config file mode*/
+    property_get("ro.bootmode", boot_mode, "normal");
+    for(i = 0; i < sizeof(ffbm_boot_mode_string) / sizeof(char *); i++) {
+        if(!strcmp(ffbm_boot_mode_string[i], boot_mode)) {
+            return 1;
+        }
+    }
+//jimbo add end
 
     if (siglen != RSANUMBYTES)
         return 0;
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值