解决手机unauthorized错误
手机:xiaomi-note(OS: Android 6.0)
手机开发者选项中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%
指向一个Android/sdk目录
将电脑环境变量中的ANDRIOD_SDK_HOME删除,重新运行adb devices,手机上出现授权提示,问题解决。
D:\develop\androidroot\adt-bundle-windows-x86-20131030\sdk\platform-tools>adb devices
List of devices attached
42f7f2230e4cafe7 device
来源:python脚本自动迁移
解决手机unauthorized错误的更多相关文章
- Android 解决手机unauthorized错误
转自:http://blog.csdn.net/quicksand201/article/details/19190821 手机开发者选项中USB调试已经打开,在电脑命令行下输入adb devices ...
- 解决mybatis foreach 错误: Parameter '__frch_item_0' not found
解决mybatis foreach 错误: Parameter '__frch_item_0' not found 在遍历对象的属性(是ArrayList对象)时报错: org.mybatis.spr ...
- 使用vue 遇到的问题————— 解决手机实时显示项目
Vue项目文件组织架构: src文件夹存放源代码. Static文件夹存放第三方静态资源. git将项目上传github http://blog.csdn.net/laozitianxia/ ...
- JGUI源码:解决手机端点击出现半透明阴影(4)
下面开始进入正题,问题发现与解决 1.According解决手机浏览器点击出现半透明阴影 手机下点击有白色蒙版,原始效果如下,看起来很不协调 2.解决办法:增加 -webkit-tap-highlig ...
- Ubuntu/Mac彻底解决手机ADB识别问题
之前写过一篇同样解决手机识别问题的文章(http://www.cnblogs.com/benhero/p/4202967.html) ,不过今天在遇到特殊手机"魅族"!之前的解决方 ...
- 解决WordPress设置错误的url网站不能访问的问题
通过WordPress后台首选项更改了网站url地址之后,网站就会出现访问不了的情况,一般来说,网站后台也登陆不上去了,我从网上寻找到了四种方法,这四种方法前三种都是需要登陆到后台的,但实际上出错后, ...
- NPM全局安装软件包时解决EACCES权限错误
NPM全局安装软件包时解决EACCES权限错误 Resolving EACCES permissions errors when installing packages globally npm WA ...
- 解决 Zuul 中 OAuth2 报 unauthorized 错误
问题描述 微服务中使用 OAuth2 鉴权,直接访问正常,通过 Zuul 访问报错: { "error": "unauthorized", "erro ...
- 解决手机浏览器上input 输入框导致页面放大的问题(记录)
在微信手机页面开发当中,页面是没有问题的,但是当焦点在input输入框的时候,手机页面会自动放大. 加入以下代码在head 区,可解决此问题 <meta name="viewport& ...
随机推荐
- css怎么实现雪人
冬天来了,怎么能少的了雪人呢,不管是现实中还是程序员的代码中统统都的安排上,那就一次安排几个雪人兄弟,咱们先看效果图: 有喜欢的就赶紧cv拿走吧!!! 其详细代码如下: 图1 html部分: < ...
- mongodb Windows系统下安装卡死问题
1.操作环境 MongoBD版本:mongodb-win32-x86_64-2008plus-ssl-4.0.5-signed (4.0.5) 操作系统:Windows 2008 R2_64位 (服务 ...
- vue3获取当前路由
正解 使用useRouter: // router的 path: "/user/:uid" <template> <div>user</div> ...
- Jsonschema2pojo从JSON生成Java类(Maven)
1.说明 jsonschema2pojo工具可以从JSON Schema(或示例JSON文件)生成Java类型, 并且可以配置生成Jackson 1.x,Jackson 2.x, Moshi 1.x或 ...
- nginx worker_cpu_affinity使用方法
Nginx默认没有开启利用多核CPU,我们可以通过增加worker_cpu_affinity配置参数来充分利用多核CPU.CPU是任务处理,计算最关键的资源,CPU核越多,性能就越好. 配置Nginx ...
- linux 三剑客(持续更新)排版后续再说,边学边记笔记
切记:seq命令用于产生从某个数到另外一个数之间的所有整数.sed才是处理文本的命令 在遇到扩展符号时,需要添加特定参数,| () +[] 为扩展符号时,必须添加参数 egrep/grep -E s ...
- Go语言系列之依赖管理
依赖管理 为什么需要依赖管理? 最早的时候,Go所依赖的所有的第三方库都放在GOPATH这个目录下面.这就导致了同一个库只能保存一个版本的代码.如果不同的项目依赖同一个第三方的库的不同版本,应该怎么解 ...
- CentOS6.5安装CM5.13
注:图片如果损坏,点击文章链接:https://www.toutiao.com/i6610650059971232269/ 安装好虚拟机(2个节点) YUM源已安装好.系统版本CentOS6.5.ja ...
- yum安装软件时,出现"No package XXX available"的解决办法
第一种: 依次执行以下命令解决 1,cd /home 2,wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noa ...
- 额外空间复杂度O(1) 的二叉树遍历 → Morris Traversal,你造吗?
开心一刻 一天,有个粉丝遇到感情方面的问题,找我出出主意 粉丝:我女朋友吧,就是先天有点病,听不到人说话,也说不了话,现在我家里人又给我介绍了一个,我该怎么办 我:这个问题很难去解释,我觉得一个人活着 ...