转自: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 authentificationSecure 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


转载于:https://www.cnblogs.com/defineconst/p/6559506.html

Android 解决手机unauthorized错误相关推荐

  1. 解决手机unauthorized错误

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

  2. ios android 内存不足,怎样解决手机内存不足?iOS系统可以试试这些方法

    原标题:怎样解决手机内存不足?iOS系统可以试试这些方法 怎样解决手机内存不足?不管储存空间有多少GB,使用时间一长都会被满满的数据占据,有的时候甚至会出现储存空间不足的情况,怎么才能清理手机里的内存 ...

  3. The import android cannot be resolved”错误解决方法

    导入工程的"The import android cannot be resolved"错误解决方法 2012-03-02 | 阅:  转:  |  分享 通过eclipse的im ...

  4. Android 解决: Failed to resolve: com.android.support:appcompat-v7:28.+ 错误

    今天,简单讲讲Android studio编译报错:Failed to resolve: com.android.support:appcompat-v7:28.+的问题. 这个问题其实之前遇到过,今 ...

  5. android 解决错误:Intel HAXM is required to run this AVD

    今天,简单讲解Android 启动模拟器时,提示错误: Intel HAXM is required to run this AVD. VT-x is disabled in BIOS. Enable ...

  6. android 解决小米手机上选择照片路径为null的问题

    之前做了一个获取相册选择图片的功能,后来测试人员在小米的手机 测试时出现崩溃现象.自己就在网上查找资料,发现是小米的获取图片路径的代码与其他的手机不一样,于是修改了代码,解决了这个问题,这里记录一下. ...

  7. android上传图片被旋转,解决android有的手机拍照后上传图片被旋转的问题

    需求:做仿新浪发微博的项目,能够上传图片还有两外一个项目用到手机拍摄图片,这两个都需要把图片上传到服务器 遇到问题:有的手机拍摄的图片旋转90度,有的图片旋转了180度,有的手机是正常的,服务器要求的 ...

  8. android 将图片储存到手机内存不足,如何解决手机内照片太多、空间不够用的问题呢?简单一招即可搞定...

    随着智能手机摄像头参数的不断提高,手机拍照体验已经逐渐超越数码相机.因此在大多数时候一般用户都会选择使用手机来记录日常和出游过程中所看到的人.发生的事.不过现在手机摄像头动辄超过两千万像素,拍摄的照片 ...

  9. android手机的扩容教程,解决手机系统空间不足

    android手机的扩容教程,解决手机系统空间不足问题 --通过将手机中的应用搬到SD卡中实现手机扩容 在智能手机中,android手机从市场占有率来看占有绝对优势,然而随着使用时间的增加,许多用户也 ...

最新文章

  1. 对大学生学习Linux系统的七项实用建议
  2. 关于ASP.NET 中站点地图sitemap 的使用【转xugang】
  3. Android程序ToDoList增加配置项页面
  4. MDL--元数据锁的锁请求与锁等待+元数据锁类对象
  5. 谷歌发布新编程语言,专治SQL各种“不服”
  6. python之父去面试-Python面试题之Python的Super方法
  7. [OS复习]操作系统综述1
  8. 摊牌了,我靠他实现了NLP模型使用入门
  9. JavaWeb黑马旅游网-学习笔记02【注册功能】
  10. MYSQL的binary解决mysql数据大小写敏感问题
  11. Jmeter+ant运行脚本,得到HTML报告
  12. 【Python】 配置解析ConfigParser 命令行参数解析optparser
  13. 当时尚遇上AI!港中文MMLab开源MMFashion工具箱
  14. UI初学者必备知识|最好的Sketch App 素材资源都在一流设计导航
  15. java ide 的优劣_Java程序员的困惑 Java IDE到底怎么选
  16. ASP.NET 2.0的编译行为
  17. wps合并重复项并求和_如何在excel合并同类项数据并求和(去除重复项)
  18. 东财《领导科学X》综合作业
  19. Vue.js---关闭语法检查
  20. 拼多多服务器请求失败在手机上如何修复,拼多多系统繁忙

热门文章

  1. 华为隐藏功能扩大内存代码大全_发现将华为手机这3个功能打开,竟然可以将手机性能极限发挥...
  2. Eclipse集成lombok插件 解决@Data标签get/set方法找不到异常
  3. Linux中移动,复制,删除,打包排除某个目录或文件
  4. java 线程 原子性_深入理解Java多线程与并发框架——Java内存模型与原子性、可见性、有序性...
  5. java:输出流程printStream
  6. 三元组相加获得target
  7. sql exists和not exists用法
  8. IMAP与POP3的比较
  9. 解决开机后自动重起问题
  10. matlab 曲线拟合--视频编码中PSNR计算及码率计算