Android R上curl和wget等无法使用的解决办法
1.问题
sh脚本文件中使用到了curl和get,在编译的时候出现了异常
11:00:44 Disalloed PATH tool "curl" used: xxx ... ...
11:00:44 See https://android.googlesource./platform/build/+/master/Changes.md#PATH_Tools for more information.
...
11:00:44 Disalloed PATH tool "get" used: xxx ... ...
11:00:44 See https://android.googlesource./platform/build/+/master/Changes.md#PATH_Tools for more information.
...
"curl" is not alloed to be used. See https://android.googlesource./platform/build/+/master/Changes.md#PATH_Tools for more information.
"get" is not alloed to be used. See https://android.googlesource./platform/build/+/master/Changes.md#PATH_Tools for more information.
2.原因
Android Q 版本的限制
3.解决
在build/soong/ui/build/paths/config.go中把需要用到的curl、get等命令加入白名单
var Configuration = map[string]PathConfig{
"bash": Alloed,
"dd": Alloed,
....
"unzip": Alloed,
"zip": Alloed,
"curl": Alloed, // add
"get": Alloed, // add
....
}
加上这个白名单后,还是会报异常
get: missing URL
Usage: get [OPTION]... [URL]...
还需要在BoardConfig.mk中加上
BUILD_BROKEN_USES_NETWORK := true
TEMPORARY_DISABLE_PATH_RESTRICTIONS := true
PS.get是一款免费的工具,用于从网上自动下载文件,它在带宽非常窄,网络不稳定的情况下,具有很强的适应性。
curl命令是一个功能强大的网络工具,它能够通过http、ftp等方式下载文件,也能够上传文件,支持HTTPS等众多协议,
还支持POST、cookies、认证、从指定偏移处下载部分文件、用户代理字符串、限速、文件大小、进度条等特征。
空调维修
- 我的世界电脑版运行身份怎么弄出来(我的世界
- 空调抽湿是什么意思,设置抽湿的温度有什么意
- 方太燃气灶有一个打不着火 怎么修复与排查方法
- 夏季免费清洗汽车空调的宣传口号
- 清洗完空调后出现漏水现象
- iphone6能玩什么游戏(iphone6游戏)
- 如何设置电脑密码锁屏(如何设置电脑密码锁屏
- win10删除开机密码提示不符合密码策略要求
- 电脑w7显示不是正版(w7不是正版怎么解决)
- 万家乐z8热水器显示e7解决 怎么修复与排查方法
- 1匹空调多少瓦数(1匹空调多少瓦)
- 安卓手机连接电脑用什么软件好(关于安卓手机
- 电脑网页看视频卡是什么原因(爱拍看视频卡)
- 华帝燃气灶点火器一直响然后熄火怎么办:问题
- 电脑壁纸怎么换(关于电脑壁纸怎么换的介绍)
- 冬天空调的出风口应该朝什么方向(冬天空调风