转自: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. Mongoose使用——nodejs结合mongodb

    0. 前言: Mongoose是NodeJS的驱动,不能作为其他语言的驱动.Mongoose有两个特点: 通过关系型数据库的思想来设计非关系型数据库 基于mongodb驱动,简化操作 Mongooos ...

  2. (三)hibernate单表操作

    0. 贴上节hbm文件 <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hib ...

  3. mosquitto ---配置SSL/TLS

    在服务器电脑上面创建myCA文件夹, 如在/home/qa/ 文件夹下使用命令, mkdir myCA 然后执行以下命令,我们将创建并使用其他用户没有权限访问的目录. sudo chmod 700cd ...

  4. CentOS 7.1重启后无法进入Gnome

    问题环境: 新买的Intel NUC主机,通过光驱安装CentOS 7.1版本,安装过程没问题. 安装完毕后,重启. 坏了! 只能看到黑屏和一只可以移动的鼠标. 只能说说我的排查思路: 一.首先要进入 ...

  5. Introduction to SIFT (Scale-Invariant Feature Transform)

    SIFT OpenCV 官方文档: https://docs.opencv.org/master/da/df5/tutorial_py_sift_intro.html https://opencv-p ...

  6. obj 格式注意事项

    用Adreno Profiler分析图形效果的实现过程时,需要将特效涉及到的模型导出,以便进行多角度的详细查看,结果发现Adreno Profiler导出模型的功能有bug,总是报错并生成一个残缺的. ...

  7. mongodb查询实练

    1.mongodb中如何查询 (a=1 or b=2) and (c=3 or d=4)//格式:db.collection.find({"$and":[{第一个条件},{第二个条 ...

  8. Facebook API 入门

    Facebook 商业价值简介 Facebook 是一个社交网络服务网站,于 2004 年 2 月 4 日上线,到 2010 年 2 月 2 日, Facebook 正赶超雅虎将成为全球第三大网站,与 ...

  9. MongoDB,还有一个角度看数据

    传智-玄痛(传智播客北京校区C/C++学院技术指导老师) MongoDB的起源 几年前 10gen 公司做了 SaaS 方面的研发,由于公司一个 MongoDB 产品存储接口的易用性,用户评价很好,公 ...

  10. 3-06. 表达式转换(25)(中缀表达式转后缀表达式ZJU_PAT)

    题目链接:http://pat.zju.edu.cn/contests/ds/3-06 算术表达式有前缀表示法.中缀表示法和后缀表示法等形式. 日常使用的算术表达式是採用中缀表示法,即二元运算符位于两 ...