--------------------------------------- 制作说明 ---------------------------------------
--[[
插件作者 : 真标鞋匠优化
制作时间 : 2018.12.13
FTP上传下载功能,需配合FTP服务器端使用
--]]
--FTPUpLoadFile
--curl -T /sdcard/myfile.txt ftp://ftpUser:ftpPassword@ipAddress:ftpPort/
function QMPlugin.FTPUploadFile(url,filepath)
os.execute(string.format("curl -T %s %s",filepath,url))
end
--FTPDownLoadFile
--curl -o /sdcard/myfile.txt ftp://ftpUser:ftpPassword@ipAddress:ftpPort/myfile.txt
function QMPlugin.FTPDownLoadFile(url,filepath)
os.execute(string.format("curl -o %s %s",filepath,url))
end
function QMPlugin.ftpDel(name,passwd,ftpdz,lj)--删除
os.execute("curl -u "..name..":"..passwd.." "..ftpdz.." -X 'DELE "..lj.."'")
return true
end
function QMPlugin.ftpSc(name,passwd,sjlj,sclj)--上传
os.execute("curl -u "..name..":"..passwd.." -T "..sjlj.." "..sclj)
return true
end
function QMPlugin.ftpXz(xzdz,name,passwd,bcdz)--下载
os.execute("curl "..xzdz.." -u "..name..":"..passwd.." -o "..bcdz)
return true
end
function QMPlugin.xzwj(lj,wz)--下载文件
os.execute("curl -o "..lj.." "..wz)
return true
end
function QMPlugin.Cmd(a)--执行命令
return os.execute(a)
end
function QMPlugin.ext()--结束脚本
os.exit()
end
Import "ShanHai.lua"
Import "HuangYi.lua"
// 更新安卓系统的curl库文件
If shanhai.Mount("/system") Then
PutAttachment "/system/bin/", "curl"
PutAttachment "/system/lib/", "libcurl.so"
Call shanhai.Chmod("/system/bin/curl", 2)
Call shanhai.Chmod("/system/lib/libcurl.so", 2)
ShowMessage "/system系统目录挂载成功"
Delay delayTime
Else
ShowMessage "/system系统目录挂载失败"
Delay delayTime
EndScript
End If
Dim GameApp = "com.qq.ac.android"
Dim AppFileName = GameApp & ".apk"
Dim AppFilePath = "/sdcard/" & AppFileName
// FTP服务器地址,端口号和登录用户
Dim ftpHostName = "192.168.100.100"
Dim ftpHostPort = "21"
Dim ftpUser = "admin:admin"
Dim ftpURL = "ftp://" & ftpUser & "@" & ftpHostName & ":" & ftpHostPort & "/" & packageName & "/" & AppFileName
HuangYi.FTPDownLoadFile(ftpURL, AppFilePath)
附件下载:

老马黑科技


