Zorro · API reference
Zorro is controlled through local HTTP commands of the form /cmd?fun=command¶meters.
| Item | Value |
|---|---|
| On-device scripts | http://127.0.0.1:8844/cmd? |
| From a computer | http://device-LAN-IP:8844/cmd? |
| Method | GET |
| Result file | /var/mobile/zorroresult.plist |
Before you call anything
- Turn on Enable HTTP script commands in Zorro's script settings.
- Zorro must be in the foreground before every command:
runApp("zorro")
mSleep(3 * 1000)Return values
Commands return synchronously — the HTTP response is the JSON itself:
{"retcode": 1, "msg": "result description"}The same data is written to /var/mobile/zorroresult.plist. When you call getcurrentrecordparam, that file gains an extra data node holding the parameters.
retcode | Meaning |
|---|---|
1 | Completed successfully |
0 | Execution error |
2 | Running (result file only; HTTP never returns this) |
10 | Runtime environment error |
100 | Product not activated, or the license expired |
Endpoint list
| Function | Command | Parameters | Minimum version |
|---|---|---|---|
| Reset | newrecord | — | — |
| Set spoofed / backed-up apps | setparam | fakeapps backupapps | v4.2.7 |
| Next record | nextrecord | — | — |
| Activate a specific record | activerecord | record | — |
| Delete a specific record | deleterecord | record | — |
| Get every record name | getallrecords | — | v2.9.1 |
| Get the current record name | getcurrentrecord | — | v2.9.1 |
| Set the current record's coordinates | setcurrentrecordlocation | location | — |
| Clear the current record's coordinates | clearcurrentrecordlocation | — | — |
| Reset coordinates from the current IP | resetlocationbyip | — | v4.3.7 |
| Get the current record's parameters | getcurrentrecordparam | — | v2.9.1 |
| Set the current record's parameters | change | See below | — |
| Restart the service | rebootservice | — | v5.5.0 |
Endpoint details
Reset
GET http://127.0.0.1:8844/cmd?fun=newrecordSet spoofed / backed-up apps
GET http://127.0.0.1:8844/cmd?fun=setparam&fakeapps=com.z.go1,com.z.go2&backupapps=com.z.go1,com.z.go2| Parameter | Notes |
|---|---|
fakeapps | Bundle IDs of apps to spoof without backing up, comma-separated. These are the apps with a black checkmark in the app |
backupapps | Bundle IDs of apps to spoof and back up, comma-separated. These are the apps with a red checkmark in the app |
Requires v4.2.7 or later.
Next record
GET http://127.0.0.1:8844/cmd?fun=nextrecordActivate a specific record
GET http://127.0.0.1:8844/cmd?fun=activerecord&record=record-id| Parameter | Required | Notes |
|---|---|---|
record | Yes | Record ID. URL-encode it if it contains non-ASCII characters |
Delete a specific record
GET http://127.0.0.1:8844/cmd?fun=deleterecord&record=record-id| Parameter | Required | Notes |
|---|---|---|
record | Yes | Record ID |
Get every record name
GET http://127.0.0.1:8844/cmd?fun=getallrecordsRequires v2.9.1 or later.
Get the current record name
GET http://127.0.0.1:8844/cmd?fun=getcurrentrecordRequires v2.9.1 or later.
Set the current record's coordinates
GET http://127.0.0.1:8844/cmd?fun=setcurrentrecordlocation&location=longitude,latitude| Parameter | Required | Notes |
|---|---|---|
location | Yes | Format longitude,latitude or longitude_latitude, for example 121.4997,31.2394 |
Clear the current record's coordinates
GET http://127.0.0.1:8844/cmd?fun=clearcurrentrecordlocationReset coordinates from the current IP
GET http://127.0.0.1:8844/cmd?fun=resetlocationbyipRe-sets the current record's coordinates from your current network IP.
Requires v4.3.7 or later.
Get the current record's parameters
GET http://127.0.0.1:8844/cmd?fun=getcurrentrecordparamThe parameters are written to the data node of /var/mobile/zorroresult.plist. The parameter names you get here can be used directly with the change command below.
Requires v2.9.1 or later.
Set the current record's parameters
GET http://127.0.0.1:8844/cmd?fun=change&idfa=AFF18523-B306-4E04-BB4D-2DD6CE48C694&idfv=ADF28523-B306-4E04-BB4D-2DD6CE48C694&os=12.1.3&product=iPhone9%2C2&remark=xxxx- Pass only the parameters you want to change. Anything you omit stays as it is.
- Values must be URL-encoded —
iPhone9,2becomesiPhone9%2C2, for example.
| Parameter | Notes |
|---|---|
name | Device name, mapped to DeviceName, e.g. xxxx iPhone |
os | iOS version such as 11.2.6, mapped to SystemVersion. Also resets SystemBuildVersion, Safari and related parameters |
idfa | Mapped to AdvertisingIdentifier |
idfv | Mapped to IdentifierForVendor |
product | Product type such as iPhone8,1, mapped to ProductType. Also resets HWModel, screen resolution and related parameters |
UniqueDeviceID | UDID. Only useful for enterprise apps that call private APIs (supported since v4.2.7) |
remark | A note. Shown under the record in the list, same as adding a note by swiping left in the app |
These are the officially documented parameters; others will be added later.
Restart the service
GET http://127.0.0.1:8844/cmd?fun=rebootserviceRestarts Zorro's background service.
Requires v5.5.0 or later.
Lua example (TouchSprite)
local sz = require("sz")
local http = require("szocket.http")
local BASE = "http://127.0.0.1:8844/cmd?fun="
-- URL encoding (needed for non-ASCII characters, commas and so on)
function urlEncode(s)
s = string.gsub(s, "([^%w%.%- ])", function(c)
return string.format("%%%02X", string.byte(c))
end)
return string.gsub(s, " ", "+")
end
-- Unified call: returns retcode plus the full JSON
function Zorro(query)
local res, code = http.request(BASE .. query)
if code ~= 200 then return nil end
local r = sz.json.decode(res)
return r.retcode, r
end
-- Launch (required before any command)
runApp("zorro")
mSleep(3 * 1000)
-- 1. Choose apps: WeChat is spoofed only, Alipay is spoofed and backed up
Zorro("setparam&fakeapps=com.tencent.xin&backupapps=com.alipay.iphoneclient")
-- 2. Reset
local ret, r = Zorro("newrecord")
if ret == 100 then
toast("Not activated, or the license expired", 2)
elseif ret ~= 1 then
toast("Reset failed: " .. tostring(r and r.msg), 2)
end
-- 3. Change the current record's parameters (values must be URL-encoded)
Zorro("change&os=" .. urlEncode("12.1.3")
.. "&product=" .. urlEncode("iPhone9,2")
.. "&remark=" .. urlEncode("wechat001"))
-- 4. Set the coordinates
Zorro("setcurrentrecordlocation&location=121.4997661114,31.2394855667")
-- 5. Activate a specific record
Zorro("activerecord&record=" .. urlEncode("wechat001"))For usage, see the Zorro user guide.
The interface and supported systems may change with updates. Back up important data before cleaning, resetting or deleting anything.
