lua插件放到 按键精灵手机助手 安装位置的 Plugin 文件夹里面
使用curl必须保证/system/bin 和 /system/lib 文件夹里有 curl 和libcurl 两个文件,有的curl 版本可能不需要libcurl
手机版按键精灵是通过lua的os.execute函数来执行curl的
调用方法:
用法和linux的方式是一样的:
os.execute(curl http://yesp.top)--获取网页源码
以下是本人测试在按键精灵上可用的curl 用法:
--GET方式提交数据
curl -G -d "name=value&name2=value2" http://www.baidu.com
--POST方式提交数据
curl -d "name=value&name2=value2" http://www.baidu.com #post数据
--以表单的方式上传文件
curl -F file=@/tmp/me.txt http://www.aiezu.com
curl -F key=123 -F data=123 -F file=@/sdcard/1.png http://yesp.top
--设置header
curl -A "Mozilla/5.0 Firefox/21.0" http://www.baidu.com #设置http请求头User-Agent
curl -e "http://pachong.org/" http://www.baidu.com #设置http请求头Referer
curl -H "Connection:keep-alive \nUser-Agent: Mozilla/5.0" http://yesp.top
--http响应头处理
curl -I http://www.aiezu.com #仅仅返回header
curl -D /tmp/header http://www.aiezu.com #将http header保存到/tmp/header文件
--curl认证
curl -u aiezu:password http://www.aiezu.com #用户名密码认证
curl -E mycert.pem https://www.baidu.com #采用证书认证
--curl_ftp 几种写法
curl ftp://ip:端口/路径/ --user name:passwd
curl ftp://ip:端口/路径/ name:passwd #简洁写法
curl ftp://name:passwd@ip:端口/路径/ #简洁写法2
--FTP上传
curl --user user:pass -T /file/name ftp://ip:端口/路径/
--FTP下载
curl ftp://ip:端口/路径/ –u name:passwd -o size.zip
curl ftp://ip:端口/路径/ –u name:passwd -o /保存路径
--FTP删除
curl -u name:passwd ftp://ip:端口/ -X 'DELE 路径'
--列出ftp服务器上的目录列表
curl ip:端口/路径/ –u name:passwd
下载地址见评论