Tài liệu STouchSTouch Documentation

Engine tự động hoá iOS cho iPhone jailbreak (RootHide). Viết Lua, điều khiển qua HTTP/Cloud.iOS automation engine for jailbroken iPhones (RootHide). Write Lua, control over HTTP/Cloud.

Giới thiệuOverview

STouch gồm: engine.dylib (inject SpringBoard, tổng hợp sự kiện HID), http server :8090 (điều khiển qua REST + Web IDE), vision (dò màu/khớp ảnh), và agent (nối VPS để điều khiển từ xa). Chạy trên iPhone 6s iOS 15.8.x, RootHide.STouch consists of: engine.dylib (injects SpringBoard, synthesizes HID events), http server :8090 (REST control + Web IDE), vision (color/template matching), and an agent (dials a VPS for remote control). Runs on iPhone 6s, iOS 15.8.x, RootHide.

Cài đặtInstallation

Thêm repo vào Sileo rồi cài gói STouch:Add the repo to Sileo and install the STouch package:

https://sileo.companyus.info

Kiến trúcArchitecture

Thành phầnComponentVai tròRole
engine.dylibInject SpringBoard, tổng hợp digitizer/HID (tap, vuốt, phím), chạy Lua.Injects SpringBoard, synthesizes digitizer/HID (tap, swipe, keys), runs Lua.
http :8090REST điều khiển + phục vụ Web IDE + screenshot.REST control + serves the Web IDE + screenshots.
visionfindColor / findImage đọc framebuffer.read the framebuffer.
agentDial-out VPS qua WSS → điều khiển từ xa mọi mạng.Dials a VPS over WSS → remote control on any network.
stouch_getcookieHelper CLI entitled (binary riêng, vì engine chạy sandbox không đọc được keychain/container app khác) — cấp hàm Lua getcookiefb() lấy cookie+token Facebook.Entitled CLI helper (separate binary, since the sandboxed engine can't read another app's keychain/container) — powers the getcookiefb() Lua function to fetch the Facebook cookie+token.

Điều khiển từ xa (Cloud Relay)Remote control (Cloud Relay)

Agent trên phone chủ động nối ra VPS bằng WebSocket, browser nói chuyện với VPS qua HTTPS → né chặn Private Network Access của Chrome. Không cần cùng mạng với phone.The on-phone agent connects out to the VPS over WebSocket; the browser talks to the VPS over HTTPS → bypasses Chrome's Private Network Access block. No shared network with the phone required.

Nút cứng trên máyOn-device buttons

NútButtonTác dụngAction
Giảm âm lượng (Volume-Down)Volume-DownDừng script đang chạy NGAY — <0.5s kể cả đang chờ curl/mạng/sleep (~1s nếu đúng lúc đang OCR). Từ 1.3.13; trước đó phải đợi lệnh mạng xong (tới 8-15s).Stops the running script immediately — <0.5s even mid curl/network/sleep (~1s if exactly during an OCR). Since 1.3.13; before that it waited for the network call to finish (up to 8-15s).
Tăng âm lượng (Volume-Up)Volume-UpMở/đóng menu script nổi (chọn .lua để chạy). Đang ghi macro thì dừng ghi.Toggle the floating script menu (pick a .lua to run). Stops macro recording if recording.

Lua API — Hệ thốngSystem

HàmFunctionMô tảDescription
sleep(s)Ngủ (giây, hỗ trợ số thực).Sleep (seconds, floats supported).
usleep(us)Ngủ theo micro-giây.Sleep in microseconds.
toast(str)Hiện thông báo nổi trên màn.Show a floating toast on screen.
log(str)Ghi log (xem qua /log).Write to the log (view via /log).
execute(cmd)Chạy shell (posix_spawn), trả stdout.Run a shell command (posix_spawn), returns stdout.
rootDir() · currentDir() · botPath()Đường dẫn thư mục script (đều CÓ / cuối) — nối tên file: currentDir().."Examples/x.lua".Script directory paths (all with a trailing /) — concatenate filenames: currentDir().."Examples/x.lua".
keepAutoTouchAwake()Giữ script chạy suốt kể cả khi khoá màn (nghỉ dài).Keep the script running even while the screen is locked (long pauses).
mem()RAM SpringBoard (MB) — đo leak.SpringBoard RAM (MB) — leak measurement.
getVersion() · getSN() · getLocalIP() · getOrientation()Phiên bản engine · serial · IP LAN · hướng màn (dùng ORIENTATION_TYPE).Engine version · serial · LAN IP · screen orientation (use ORIENTATION_TYPE).

Lua API — Chạm & vuốtTouch & swipe

HàmFunctionMô tảDescription
tap(x, y)Chạm 1 phát tại (x,y).Single tap at (x,y).
touchDown(id, x, y)Ngón id xuống — multi-touch từng ngón.Finger id down — per-finger multi-touch.
touchMove(id, x, y)Di ngón id tới (x,y).Move finger id to (x,y).
touchUp(id, x, y)Nhấc ngón id.Lift finger id.

Vuốt = touchDown → nhiều touchMovetouchUp. Giữ (long-press) = down rồi sleep rồi up.Swipe = touchDown → several touchMovetouchUp. Long-press = down, then sleep, then up.

Lua API — Bàn phímKeyboard

HàmFunctionMô tảDescription
inputText(str)Nhập chuỗi vào ô đang focus — đẩy y nguyên qua clipboard (bỏ qua bộ gõ/bàn phím → không bị Telex biến "w"→"ư"). UTF-8 OK.Insert a string into the focused field — verbatim via clipboard (bypasses the keyboard/IME → no Telex mangling). UTF-8 OK.
copyText(str) · simulatePaste()Copy chuỗi vào clipboard máy · Dán (Cmd+V). inputText = copyText + simulatePaste.Copy a string to the device clipboard · Paste (Cmd+V). inputText = copyText + simulatePaste.
clearText()Xoá sạch ô đang focus (Cmd+A rồi Delete).Clear the focused field (Cmd+A then Delete).
keyDown(usage) · keyUp(usage)Nhấn/nhả phím theo HID usage (vd Backspace (0x07<<16)|0x2A, Enter |0x28).Press/release a key by HID usage (e.g. Backspace (0x07<<16)|0x2A, Enter |0x28).
keyboard(show)Hiện/ẩn bàn phím.Show/hide the keyboard.

Lua API — Màn hìnhScreen

HàmFunctionMô tảDescription
getScreenResolution()Trả w, h (6s = 750×1334).Returns w, h (6s = 750×1334).
getColor(x, y)Màu pixel tại (x,y).Pixel color at (x,y).
screenshot(path)Chụp màn ra file PNG.Capture the screen to a PNG file.
rgbToInt(r,g,b)Gộp RGB thành int để so màu.Pack RGB into an int for color comparison.

Lua API — Vision

HàmFunctionMô tảDescription
findColor(x1,y1,x2,y2, color, [t])Tìm pixel màu color trong vùng — trả x, y hoặc nil.Find a pixel of color in the region — returns x, y or nil.
findImage(path, [t])Khớp mẫu ảnh trên màn thật — trả x, y tâm khớp hoặc nil.Match a template image on the live screen — returns the match center x, y or nil.
ocr()OCR toàn màn — trả bảng Lua (như AZTouch): {{text, x, y, w, h, rectangle={bottomLeft,topRight}}, …}. Dùng #r đếm, ipairs duyệt, toạ độ = pixel (cùng hệ tap).OCR the whole screen — returns a Lua table (AZTouch-style): {{text, x, y, w, h, rectangle={bottomLeft,topRight}}, …}. Use #r for count, ipairs to iterate, coords = pixels (same as tap).
local x,y = findImage("/var/mobile/tmpl/next.png", 0.9)
if x then tap(x,y) end

Lua API — App & mạngApp & network

HàmFunctionMô tảDescription
appActivate(bundle) · appRun(bundle)Mở/đưa app lên trước.Launch / bring an app to the foreground.
appState(bundle) · appInfo(bundle)Trạng thái / thông tin app.App state / info.
appKill(bundle) · frontMostAppId()Tắt hẳn app · Bundle id của app đang mở trước.Terminate an app · Bundle id of the foreground app.
getcookiefb()Lấy cookie Facebook (định dạng Cookie header): UID|c_user=..; xs=..; fr=..; datr=..|token. Đọc binarycookies + keychain FB qua helper entitled. Trả chuỗi rỗng nếu FB chưa đăng nhập.Get the Facebook cookie (Cookie-header format): UID|c_user=..; xs=..; fr=..; datr=..|token. Reads FB binarycookies + keychain via an entitled helper. Returns an empty string if FB is not logged in.
setVPN("on"/"off")Bật/tắt VPN đầu tiên (vd Shadowrocket).Toggle the first VPN (e.g. Shadowrocket).
isVPNConnected()Trả true/false — VPN có đang lên không. Hỏi kernel (interface tunnel), không OCR/không đọc app → verify sạch trước khi bật lại.Returns true/false — whether the VPN is up. Kernel query (tunnel interface), no OCR / no app reading → clean verify before re-toggling.
setWifi("on"/"off") · setAirplaneMode("on"/"off")Wifi / máy bay. Nhận cả chuỗi "on"/"off" lẫn boolean.Wi-Fi / airplane mode. Accepts both "on"/"off" strings and booleans.

Lua API — Dialog & PlistDialog & Plist

HàmFunctionMô tảDescription
dialog(spec)Hiện form nhập (Label/Input/CheckBox/Switch) — trả bảng kết quả, chặn tới khi bấm OK.Show an input form (Label/Input/CheckBox/Switch) — returns a result table, blocks until OK.
alert(msg)Hộp thoại thông báo.A message dialog.
vibrate()Rung.Vibrate.
readPlist(path) · writePlist(path, tbl)Đọc/ghi plist.Read/write a plist.
clipText([str])Đọc / ghi clipboard.Read / write the clipboard.

HTTP API — Endpoints

Cổng :8090 trên phone, hoặc qua relay /stouchr/<device-id>/…Port :8090 on the phone, or via relay /stouchr/<device-id>/…

Method · PathMô tảDescription
GET /deviceInfoModel, iOS, độ phân giải, tên máy, owner (tên định danh máy).Model, iOS, resolution, device name, owner (device identity name).
GET /screenshotPNG màn hình hiện tại.PNG of the current screen.
POST /touch?phase=down|move|up&x=&y=Sự kiện chạm HID (dùng cho tap & vuốt).HID touch event (used for tap & swipe).
POST /tap?x=&y=Chạm nhanh 1 phát.Quick single tap.
POST /type (body = text)Nhập text vào ô đang focus — SET ô = text (Cmd+A → xoá → paste), verbatim (bỏ qua bộ gõ Telex), KHÔNG ghi log. "Bàn phím → máy" gõ real-time gọi endpoint này mỗi phím.Insert text into the focused field — SET field = text (Cmd+A → delete → paste), verbatim (bypasses the Telex IME), no logging. The "keyboard → device" live typing calls this per keystroke.
POST /homeVề màn hình chính.Go to the home screen.
POST /run (body = Lua)Chạy đoạn Lua tức thì.Run a Lua snippet immediately.
POST /runfile?name=Chạy file script theo tên.Run a script file by name.
POST /stopDừng script đang chạy.Stop the running script.
GET /files · /file/read · POST /file/writeQuản lý file script.Manage script files.
GET /file/download?name=Tải file (ảnh/binary) — đúng Content-Type theo đuôi (image/png…) + attachment.Download a file (image/binary) — correct Content-Type by extension (image/png…) + attachment.
POST /file/new · /file/delete · /file/renameTạo/xoá/đổi tên file & thư mục.Create/delete/rename files & folders.
GET /log · POST /log/clearĐọc / xoá log.Read / clear the log.
# Tap máy phone36 qua relayTap device phone36 via relay
curl -X POST "https://stouch.companyus.info/stouchr/phone36/tap?x=375&y=667"

# Chạy Lua qua relayRun Lua via relay
curl -X POST "https://stouch.companyus.info/stouchr/phone36/run" \
     --data 'toast("hello"); tap(200,400)'

🔧 ChangeInfo — Device Info Faker

Sản phẩm RIÊNG, khác STouch: công cụ giả lập thông tin thiết bị + reset sạch app (thay AZInfo/FakeInfo). STouch = engine tự động hoá; ChangeInfo = giả/đổi/xoá thiết bị. Hai cái cài độc lập từ cùng repo.A SEPARATE product, not STouch: a tool to fake device info + fully reset apps (replaces AZInfo/FakeInfo). STouch = automation engine; ChangeInfo = fake/rotate/wipe the device. Both install independently from the same repo.

Giới thiệuOverview

ChangeInfo giả nhận dạng thiết bị (model, iOS, serial, IMEI, ICCID, GPS, locale, múi giờ, nhà mạng — đồng bộ coherent), reset dữ liệu app + keychain, backup/restore. Tự viết 100%, self-contained (app + dylib inject + CLI setuid). Chạy iPhone 6s iOS 15.8.x RootHide.ChangeInfo fakes the device identity (model, iOS, serial, IMEI, ICCID, GPS, locale, timezone, carrier — kept coherent), resets app data + keychain, backup/restore. 100% self-written, self-contained (app + injected dylib + setuid CLI). Runs on iPhone 6s, iOS 15.8.x, RootHide.

Cài đặtInstallation

Cùng repo với STouch, cài gói ChangeInfo:Same repo as STouch, install the ChangeInfo package:

https://sileo.companyus.info
  • Sau cài chạy 1 lần launchctl reboot userspace để backboardd nạp filter inject app (fake mới ăn).After install, run launchctl reboot userspace once so backboardd loads the app-injection filter (faking then takes effect).
  • Không phụ thuộc gói nào khác (không cần AZInfo/FakeInfo).No dependency on other packages (no AZInfo/FakeInfo needed).

URL scheme changeinfo://

API tự động hoá — gọi từ script Lua STouch bằng openURL(...), hoặc từ app khác. Đây là cách flow reg điều khiển ChangeInfo.The automation API — call it from a STouch Lua script via openURL(...), or from another app. This is how the reg flow drives ChangeInfo.

URLTác dụngAction
changeinfo://clearData?mode=clear&apps=<csv>&rotate=1Reset app + đổi nhận dạng thiết bị trong 1 lệnh. mode=clear|kill · apps=bundle csv · rotate=1 reset xong tự đổi máy mới coherent.Reset apps + rotate device identity in one call. mode=clear|kill · apps=bundle csv · rotate=1 rotates to a fresh coherent device after wiping.
changeinfo://rotateChỉ đổi nhận dạng thiết bị (coherent), KHÔNG xoá data.Only rotate the device identity (coherent), without wiping data.
…&cc=<ISO2>&lat=<n>&lon=<n>&tz=<IANA>Device khớp GEO của IP (1.0.10) — thêm vào clearData/rotate. cc=mã nước 2 chữ (US/JP/VN…) → sinh máy có nhà mạng/locale/TZ/GPS/region đúng nước đó. lat/lon/tz tuỳ chọn = GPS+múi giờ thật của IP (thiếu → dùng thủ đô nước). KHÔNG có cc → random như cũ.Device matched to the IP's GEO (1.0.10) — append to clearData/rotate. cc=2-letter country (US/JP/VN…) → generates a device whose carrier/locale/TZ/GPS/region match that country. Optional lat/lon/tz = the IP's real GPS+timezone (omit → country capital). No cc → random as before.
changeinfo://fake?apply=1Bật fake bằng cấu hình đã lưu.Enable faking using the saved config.
changeinfo://backup?apps=<csv>&name=<name>Backup dữ liệu app.Back up app data.
changeinfo://restore?file=<name>.changeinfoKhôi phục từ backup.Restore from a backup.
changeinfo://removeBackup?file=… · ?mode=deleteAllXoá 1 / tất cả backup.Delete one / all backups.
-- Trong script Lua STouch: reset FB + máy mới mỗi cycleIn a STouch Lua script: reset FB + fresh device each cycle
openURL("changeinfo://clearData?mode=clear&apps=com.facebook.Facebook&rotate=1")

-- IP-COHERENT (1.0.10): check IP trước → máy khớp đúng nước IPIP-COHERENT (1.0.10): check the IP first → device matches the IP's country
local j  = curl_get("http://ip-api.com/json/?fields=countryCode,lat,lon,timezone", 8)
local cc = j:match('"countryCode"%s*:%s*"([^"]*)"')
openURL("changeinfo://clearData?mode=clear&apps=com.facebook.Facebook&rotate=1&cc="..(cc or ""))

Chạy ngầm (automation): URL scheme KHÔNG hiện dialog chặn — nó reset+rotate rồi hiện toast "✓ Hoàn tất" (tự tắt, không kẹt) + ghi kết quả để script verify. Đọc từ /var/mobile/Library/Preferences/com.companyus.changeinfo.plist: plutil -key LastURLOK (=1 thành công) · LastURLResult (chuỗi đầy đủ + nhận dạng mới) · LastURLTime (epoch). (Nút thủ công trong app vẫn có dialog xác nhận trước + "Hoàn tất" sau.)Runs silently (automation): the URL scheme shows NO blocking dialog — it resets+rotates, shows a self-dismissing "✓ Done" toast + writes a result for scripts to verify. From /var/mobile/Library/Preferences/com.companyus.changeinfo.plist read: plutil -key LastURLOK (=1 on success) · LastURLResult (full string + new identity) · LastURLTime (epoch). (Manual in-app buttons still show a confirm dialog + a "Done" result.)

Reset & xoáReset & wipe

Reset xoá sạch triệt để, chống app "nhớ" tài khoản cũ:Reset wipes thoroughly, preventing apps from "remembering" the old account:

  • Container: Documents/Library/tmp/SystemData.Container: Documents/Library/tmp/SystemData.
  • App-group: xoá TOÀN BỘ top-level (cask/mobileconfig/... — nơi FB giấu tài khoản).App-group: wipes ALL top-level entries (cask/mobileconfig/… — where FB hides the account).
  • Keychain: xoá thật item protected (com.facebook.device-based-login = saved account) nhờ khai membership đúng → FB quên hẳn account, về màn "Tham gia Facebook".Keychain: actually deletes protected items (com.facebook.device-based-login = saved account) via proper membership → FB fully forgets the account, back to the "Join Facebook" screen.
  • Snapshot & state (1.0.8): kill app + xoá SplashBoard/Snapshots + Saved Application State → mở lại app là cold launch fresh, app-switcher không vẽ lại ảnh màn acc cũ (khỏi tưởng nhầm "còn acc").Snapshot & state (1.0.8): kills the app + wipes SplashBoard/Snapshots + Saved Application State → reopening is a fresh cold launch, the app-switcher no longer shows the old account's screen (no false "still logged in").

Chọn app để reset trong tab "Chọn App" (liệt kê mọi app cài đặt). Cờ Xoá-file-hệ-thống / Xoá-dữ-liệu-app / Xoá-receipt bật/tắt trong Cài đặt.Pick apps to reset in the "Select Apps" tab (lists every installed app). Delete-system-files / delete-app-data / delete-receipt flags toggle in Settings.

Giả lập thiết bịDevice faking

MụcItemMô tảDescription
Model + iOSMulti-select từ pool, generate coherent (board/serial/IMEI/ICCID/GPS/locale/TZ/nhà mạng khớp nhau). Fake được iOS≥17 (iPhone 13+) KHÔNG crash FB. Serial/IMEI/UDID/MAC tươi MỖI rotate (chống trùng chéo máy).Multi-select from a pool, generates coherent values (board/serial/IMEI/ICCID/GPS/locale/TZ/carrier all matching). Can fake iOS≥17 (iPhone 13+) without crashing FB. Fresh serial/IMEI/UDID/MAC every rotate (no cross-device collision).
IP-coherentDevice khớp GEO của IP (214 nước): reset qua changeinfo://…&cc=<ISO2> → nhà mạng/locale/TZ/GPS/region đúng nước IP.Device matched to the IP's GEO (214 countries): reset via changeinfo://…&cc=<ISO2> → carrier/locale/TZ/GPS/region match the IP's country.
Safari UASafari hiển thị đúng iOS giả (vd iOS 26) — deviceinfo.me / navigator.userAgent khớp.Safari reports the faked iOS (e.g. iOS 26) — deviceinfo.me / navigator.userAgent match.
Bàn phímKeyboardGIỮ ngôn ngữ bàn phím GỐC (không đổi theo region giả) → user vẫn gõ được.KEEPS the original keyboard language (not switched to the faked region) → still usable for typing.
Anti-detectẨn jailbreak (isJailBroken→NO, ẩn path JB), ẩn proxy, giả IDFA/IMEI/ICCID/IMSI.Hides jailbreak (isJailBroken→NO, hides JB paths), hides proxy, fakes IDFA/IMEI/ICCID/IMSI.

CLI — changeinfo_cli

Helper setuid-root (app gọi ngầm; cũng chạy tay qua SSH). Reset/backup/restore per-app.A setuid-root helper (the app calls it under the hood; also runnable via SSH). Reset/backup/restore per app.

changeinfo_cli reset <bundle[,bundle...]> <kill|clear> [sys=0|1,appdata=0|1,receipt=0|1]
changeinfo_cli backup <bundle[,...]> <name> [keywords]
changeinfo_cli restore <name.changeinfo>
changeinfo_cli removebackup <name.changeinfo|ALL>