愛偽裝(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_北京老胡同");