Android 解决手机unauthorized错误
转自:http://blog.csdn.net/quicksand201/article/details/19190821

手机开发者选项中USB调试已经打开,在电脑命令行下输入adb devices,显示手机未认证
D:\develop\androidroot\adt-bundle-windows-x86-20131030\sdk\platform-tools>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
42f7f2230e4cafe7 unauthorized
网上搜了一圈,几经折腾,什么adb kill-server/start-server、重新开关USB调试、撤回USB除错授权,甚至坑爹的重刷手机系统都试过,也没有搞定。
没办法,折腾adb源代码去,看这里
https://android.googlesource.com/platform/system/core/+/d5fcafaf41f8ec90986c813f75ec78402096af2d
源码没看到,先看到一大段英文,英文水平一般,直接搬原文:
adb: Add public key authentification Secure adb using a public key authentication, to allow USB debugging
only from authorized hosts. When a device is connected to an unauthorized host, the adb daemon sends
the user public key to the device. A popup is shown to ask the user to
allow debugging once or permanantly from the host. The public key is
installed on the device in the later case. Other keys may be installed
at build time. On the host, the user public/private key pair is automatically generated,
if it does not exist, when the adb daemon starts and is stored in
$HOME/.android/adb_key(.pub) or in $ANDROID_SDK_HOME on windows. If needed,
the ADB_KEYS_PATH env variable may be set to a :-separated (; under
Windows) list of private keys, e.g. company-wide or vendor keys. On the device, vendors public keys are installed at build time in
/adb_keys. User-installed keys are stored in /data/misc/adb/adb_keys. ADB Protocol change:
If the device needs to authenticate the host, it replies to CNXN
packets with an AUTH packet. The AUTH packet payload is a random token.
The host signs the token with one of its private keys and sends an AUTH(0)
packet. If the signature verification succeeds, the device replies with
a CNXN packet. Otherwise, it sends a new AUTH packet with a new token so
that the host can retry with another private key. Once the host has tried
all its keys, it can send an AUTH(1) packet with a public key as
payload. adbd then sends the public key to the framework (if it has been
started) for confirmation.
在电脑的win7系统上查看ANDROID_SDK_HOME,命令行 echo %ANDRIOD_SDK_HOME%
天啊,指向一个不存在的目录,哪个流氓软件干的
将电脑环境变量中的ANDRIOD_SDK_HOME删除,重新运行adb devices,手机上出现授权提示,问题解决。
D:\develop\androidroot\adt-bundle-windows-x86-20131030\sdk\platform-tools>adb devices
List of devices attached
42f7f2230e4cafe7 device
Android 解决手机unauthorized错误的更多相关文章
- 解决手机unauthorized错误
手机:xiaomi-note(OS: Android 6.0) 手机开发者选项中USB调试已经打开,在电脑命令行下输入adb devices,显示手机未认证 D:\develop\androidroo ...
- android studio 更新 Gradle错误解决方法(Gradle sync failed)
android studio 更新 Gradle错误解决方法 Android Studio每次更新版本都会更新Gradle这个插件,但由于长城的问题每次更新都是失败,又是停止在Refreshing ...
- (转载)android开发常见编程错误总结
首页 › 安卓开发 › android开发 android开发常见编程错误总结 泡在网上的日子 / 文 发表于2013-09-07 13:07 第771次阅读 android,异常 0 编辑推荐:稀 ...
- 记录一次Android交叉编译ffmpeg排查错误
Android版本手机直播引擎中,引用了libvlc开源库.项目接过来,发现编译脚本中使用了很多用户名下的绝对路径.项目相关人离职,导致这个脚本实际上已经废掉.而且不知道相关路径下有没有其他文件和第三 ...
- [Android]解决3gwap联网失败:联网请求在设置代理与直连两种方式的切换
[Android]解决3gwap联网失败:联网请求在设置代理与直连两种方式的切换 问题现象: 碰到一个问题,UI交互表现为:联通号码在3gwap网络环境下资源一直无法下载成功. 查看Log日志,打印出 ...
- Wireshark-配合tcpdump对Android(安卓)手机抓包
环境:Windows, 安装真机(可以获取Root权限), adb, Wireshark, tcpdump 原理: 使用 tcpdump 进行抓包, 然后用 Wireshark 进行分析 1.获取手机 ...
- Ubuntu/Mac彻底解决手机ADB识别问题
之前写过一篇同样解决手机识别问题的文章(http://www.cnblogs.com/benhero/p/4202967.html) ,不过今天在遇到特殊手机"魅族"!之前的解决方 ...
- Android.KungFu手机病毒原理及清理方法
原文链接:http://jingyan.baidu.com/article/363872ec8ad56b6e4ba16fb1.html Android.KungFu手机病毒清理方法 浏览:3333 | ...
- Android Studio 开始运行错误
/******************************************************************************** * Android Studio 开 ...
随机推荐
- 【jQuery+html】JS如何在html页面获取PHP输出的变量
如题:JS如何获取php输出到模板HTML的变量呢? 废话不多说,自己看. aa.html <!-- 前提在HTML文件中--> <script type="text/ja ...
- 搜狐畅游CEO王滔辞职
凤凰科技讯 11月3日消息,搜狐公布公告确认搜狐畅游CEO离职.公告称王滔因个人原因辞去畅游首席运行官职务.将继续担任畅游公司董事和首席产品官. 据搜狐公告,董事会任命搜狐总裁余楚媛与畅游总裁陈德文为 ...
- ZOJ 3427 Array Slicing (scanf使用)
题意 Watashi发明了一种蛋疼(eggache) 语言 你要为这个语言实现一个 array slicing 函数 这个函数的功能是 有一个数组初始为空 每次给你一个区间[ l, r) 和 ...
- GPS项目小结
GPS项目中涉及到的技术有地图纠偏,js与winform c#的交互等方面: 1 google地图纠偏,能够私下call我...QQ(964877814)....,事实上主要由于考虑到政治以及军 ...
- npm stripts 使用指南
Node 开发离不开 npm,而脚本功能是 npm 最强大.最常用的功能之一. 本文介绍如何使用 npm 脚本(npm scripts). 一.什么是 npm 脚本? npm 允许在package.j ...
- Maven的个性化定制
用Maven的小伙伴都知道,Maven的宗旨是约定优于配置(Convention Over Configuration). 在宗旨的前提下Maven也提供了个性化定制的Profile,让我们看看使用方 ...
- 异步FIFO的FPGA实现
本文大部分内容来自Clifford E. Cummings的<Simulation and Synthesis Techniques for Asynchronous FIFO Design&g ...
- angular学习疑问总结
服务里返回的数据是不是只能传给控制器,而不能传给指令呢?如果是的话那么指令只能通过配置scope属性来访问控制器里的数据
- oracle获取SID
windows 下查看注册表 开始 输入regedit 查看HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb11g_home1\ORACLE_SID就是 lin ...
- Android——gridLayout(网格布局)
<?xml version="1.0" encoding="utf-8"?> <GridLayout xmlns:android=" ...