转自: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错误的更多相关文章

  1. 解决手机unauthorized错误

    手机:xiaomi-note(OS: Android 6.0) 手机开发者选项中USB调试已经打开,在电脑命令行下输入adb devices,显示手机未认证 D:\develop\androidroo ...

  2. android studio 更新 Gradle错误解决方法(Gradle sync failed)

    android studio 更新 Gradle错误解决方法   Android Studio每次更新版本都会更新Gradle这个插件,但由于长城的问题每次更新都是失败,又是停止在Refreshing ...

  3. (转载)android开发常见编程错误总结

    首页 › 安卓开发 › android开发 android开发常见编程错误总结 泡在网上的日子 / 文 发表于2013-09-07 13:07  第771次阅读 android,异常 0 编辑推荐:稀 ...

  4. 记录一次Android交叉编译ffmpeg排查错误

    Android版本手机直播引擎中,引用了libvlc开源库.项目接过来,发现编译脚本中使用了很多用户名下的绝对路径.项目相关人离职,导致这个脚本实际上已经废掉.而且不知道相关路径下有没有其他文件和第三 ...

  5. [Android]解决3gwap联网失败:联网请求在设置代理与直连两种方式的切换

    [Android]解决3gwap联网失败:联网请求在设置代理与直连两种方式的切换 问题现象: 碰到一个问题,UI交互表现为:联通号码在3gwap网络环境下资源一直无法下载成功. 查看Log日志,打印出 ...

  6. Wireshark-配合tcpdump对Android(安卓)手机抓包

    环境:Windows, 安装真机(可以获取Root权限), adb, Wireshark, tcpdump 原理: 使用 tcpdump 进行抓包, 然后用 Wireshark 进行分析 1.获取手机 ...

  7. Ubuntu/Mac彻底解决手机ADB识别问题

    之前写过一篇同样解决手机识别问题的文章(http://www.cnblogs.com/benhero/p/4202967.html) ,不过今天在遇到特殊手机"魅族"!之前的解决方 ...

  8. Android.KungFu手机病毒原理及清理方法

    原文链接:http://jingyan.baidu.com/article/363872ec8ad56b6e4ba16fb1.html Android.KungFu手机病毒清理方法 浏览:3333 | ...

  9. Android Studio 开始运行错误

    /******************************************************************************** * Android Studio 开 ...

随机推荐

  1. weblogic设置jvm参数

    http://www.quiee.com.cn/archives/592/ weblogic a) 编辑Weblogic Server启动脚本文件:BEA_HOME\user_projects\dom ...

  2. c#+mysql 中文乱码

    c#+mysql 中文乱码 遇到一个奇怪的问题,C#读取mysql中文正常,写入时发生乱码 网上查阅原因,发现如下信息 ---------------------------------------- ...

  3. RMAN检查数据库physical/logical corruption

    1.检测physical corruption RMAN> backup validate database archivelog all; 2.检测logical corruption RMA ...

  4. 我的Android进阶之旅------>Android系统设置默认来电铃声、闹钟铃声、通知铃声

    首先了解Android系统本身提供的默认铃声文件,这些文件都放在  /system/media/audio  文件夹下. /system/media/audio/ringtones   系统来电铃声 ...

  5. Ubuntu安装deb软件包错误(依赖关系问题)解决

    执行命令 sudo dpkg -i XXX.deb 返回依赖关系错误提示 执行 sudo apt-get -f install 这条命令将自动安装需要的依赖包. 再次执行命令 sudo dpkg -i ...

  6. RPC服务框架dubbo(四):Dubbo中Provider搭建

    1.新建Maven Project, 里面只有接口(dubbo-service) 1.1 为什么这么做? RPC框架,不希望Consumer知道具体实现.如果实现类和接口在同一个项目中,Consume ...

  7. atitit.为什么笔记本跟个手机不能组装而pc可以

    atitit.为什么笔记本跟个手机不能组装而pc可以 1. 标准程度差 1 2. 为什么标准程度差 1 3. 第一个答案是「能」.第二个答案是「麻烦」. 2 4. 为什么手机不能自定义组装 3 1.  ...

  8. Linux Kernel源码浏览

    https://www.kernel.org/http://lxr.linux.no/

  9. layui单文件上传

    function imguload(cls) { var taskId = $("#model-taskId").val(); var processInstanceId = $( ...

  10. CSS3背景总结

    值 描述 CSS background-color 规定要使用的背景颜色. 1 background-position 规定背景图像的位置. 1 background-size 规定背景图片的尺寸. ...