adb未授权,无法连接问题的解决措施
2016-11-18 14:25
609 查看
本例是解决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;
原理:
如果是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;
相关文章推荐
- 几行命令解决adb无法连接Android手机的问题
- android开发时解决adb端口被占用问题,adb无法连接手机
- Ubuntu12.04下adb无法识别设备 Ubuntu下adb看不到设备的解决方法 博客分类: ubuntu 这个问题纠结了我2天,本来过去在ubuntu 9下连接HTC
- android编程练习中遇到的问题(二)-ADB端口被占用的解决方法或者AS无法连接虚拟机
- 解决MAC电脑下魅族手机adb无法连接问题
- 完美解决MAC OS下小米2(V5)系统无法连接adb问题(Eclipse无法识别)
- 解决Mac下MX4手机无法连接adb问题之解决方案
- 魅族手机MX4 MX4 Pro 魅蓝note 无法连接USB调试,adb连不上问题的解决
- NOKIA XL驱动安装【解决ADB无法连接问题】
- 微信开发学习 问题1: 网页授权问题 “该连接无法访问” 解决方法
- 解决mstsc无法连接问题:由于没有远程桌面授权服务器可以提供许可证
- 解决adb无法连接手机问题
- 解决Mac下MX4手机无法连接adb问题之解决方案
- 解决大量TCPIP连接后出现“因为系统缺乏足够缓冲区空间或者因为队列已满无法执行套接字上操作”的问题
- 解决SQL SERVER 2005无法远程连接的问题
- 疑问:配置Web.Config时出现无法连接到 SQL Server 数据库的问题!!!(已解决)
- 解决SQL Server 2005 Express中无法连接到服务器问题
- 无法与SQLServer2000连接的问题解决
- 解决SQL Server 2005 Express中无法连接到服务器问题
- 解决SQL SERVER 2005无法远程连接的问题