爱伪装(AWZ) Http脚本指南
爱伪装` `AWZ` `Http脚本指南
目录
前言
要使用HTTP脚本,需要应用的设置中,将脚本选项下的“启用HTTP脚本指令”开关打开。
手机脚本调用:可直接调用http://127.0.0.1:1688/cmd?
PC调用:可直接调用http://局域网IP:1688/cmd?
HTTP指令说明
指令返回值说明
指令调用后,直接返回json串,格式:{"result":返回值}
另提供文件返回值,在:/var/mobile/iggresult.txt
文件中
返回值 | 说明 |
---|---|
2 | 指令正在执行过程中,还未完成。 |
1 | 指令执行正常完成。 |
3 | 一键新机成功,但IP地址重复(仅针对newrecord指令)。 |
4 | 下一条记录已到最后一条(仅针对nextrecord指令)。 |
0 | 指令执行出错。 |
100 | 产品未激活,或已过期。 |
10 | 运行环境异常。 |
iggparams.txt参数文件说明
获取或设置当前记录参数在:/var/mobile/iggparams.txt
文件中;
每一行一个参数,换行符为: chr(10)
;
参数名与参数值之间,使用冒号(:
)隔开;
可通过调用指令getcurrentrecordparam后,打开该文件查看格式。
参数名称 | 说明 |
---|---|
RecordID | 记录ID,如:"APP001"。 |
DeviceName | 设备名称,如:"xxxx iPhone"。 |
SystemVersion | 系统版本号,如:"10.3.1"。 |
IDFA | IDFA值。 |
IDFV | IDFV值。 |
UDID | 设备UDID值。 |
IMEI | 设备IMEI值。 |
SerialNum | 设备序列号。 |
MAC | MAC地址。 |
SSID | SSID值。 |
BSSID | BSSID值。 |
OpenUDID | OpenUDID值。 |
触动脚本示例
1、启动应用
runApp("AWZ");-- 第一次启动,建议延迟等待3秒,需要联网验证,如:mSleep(3 *1000);
2、生效指定记录
function activeRecord(name) local sz = require("sz"); local http = require("szocket.http"); local res, code = http.request("http://127.0.0.1:1688/cmd?fun=activerecord&record="..name); if code == 200 then local resJson = sz.json.decode(res); local result = resJson.result; dialog("the result is: " .. result, 2); end end;runApp("AWZ");mSleep(1 * 1000);activeRecord("APP001");
3、一键新机
function newRecord() local sz = require("sz"); local http = require("szocket.http"); local res, code = http.request("http://127.0.0.1:1688/cmd?fun=newrecord"); if code == 200 then local resJson = sz.json.decode(res); local result = resJson.result; dialog("the result is: " .. result, 2); if result == 3 then -- IP地址重复 end -- ....其他代码 end end;runApp("AWZ");mSleep(1 * 1000);newRecord();
4、重命名当前记录
function renameCurrentRecord(name) local sz = require("sz"); local http = require("szocket.http"); local res, code = http.request("http://127.0.0.1:1688/cmd?fun=renamecurrentrecord&name="..name); if code == 200 then local resJson = sz.json.decode(res); local result = resJson.result; dialog("the result is: " .. result, 2); end end;runApp("AWZ");mSleep(1 * 1000);renameCurrentRecord("139xxxxxxx吴有财");
5、设置当前记录坐标
function setCurrentRecordLocation(location) local sz = require("sz"); local http = require("szocket.http"); local res, code = http.request("http://127.0.0.1:1688/cmd?fun=setcurrentrecordlocation&location="..location); if code == 200 then local resJson = sz.json.decode(res); local result = resJson.result; dialog("the result is: " .. result, 2); end end;runApp("AWZ");mSleep(1 * 1000);setCurrentRecordLocation("116.7361382365_39.8887921413_北京老胡同");