fix(tng): 修复地区选择黑屏并加固注册链 native abort 防护
This commit is contained in:
15
reverse/scripts/_scan_tng_vhv_u.py
Normal file
15
reverse/scripts/_scan_tng_vhv_u.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import re
|
||||
import zipfile
|
||||
|
||||
APK = r"reverse/dumps/tng_1.9.10_base.apk"
|
||||
with zipfile.ZipFile(APK) as z:
|
||||
data = b"".join(z.read(n) for n in z.namelist() if n.endswith(".dex"))
|
||||
|
||||
for cls in ["Lvhvlnqgy/w;", "Lvhvlnqgy/u;"]:
|
||||
print("===", cls, "refs ===")
|
||||
pat = cls.encode() + rb"[^\x00]{0,120}"
|
||||
hits = sorted(set(re.findall(pat, data)))
|
||||
for h in hits[:40]:
|
||||
print(h.decode("ascii", "ignore"))
|
||||
print("count", len(hits))
|
||||
print()
|
||||
14
reverse/scripts/parse_reg_crash_log.py
Normal file
14
reverse/scripts/parse_reg_crash_log.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import sys
|
||||
|
||||
path = sys.argv[1]
|
||||
lines = open(path, encoding="utf-8", errors="ignore").read().splitlines()
|
||||
keys = (
|
||||
"Runtime aborting", "Aborting", "stack corruption", "blocked __stack",
|
||||
"vhvlnqgy.u", "UserRegistration", "F libc", "has died",
|
||||
)
|
||||
for i, line in enumerate(lines):
|
||||
if any(k in line for k in keys):
|
||||
start = max(0, i - 2)
|
||||
end = min(len(lines), i + 6)
|
||||
print("---")
|
||||
print("\n".join(lines[start:end]))
|
||||
89
reverse/scripts/tap_country_code.py
Normal file
89
reverse/scripts/tap_country_code.py
Normal file
@@ -0,0 +1,89 @@
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
ADB = ["adb"]
|
||||
|
||||
|
||||
def adb(*args):
|
||||
subprocess.run(ADB + list(args), check=False)
|
||||
|
||||
|
||||
def main():
|
||||
adb("shell", "am", "force-stop", "my.com.tngdigital.ewallet")
|
||||
time.sleep(2)
|
||||
adb("shell", "am", "start", "-n", "my.com.tngdigital.ewallet/.ui.SplashActivity")
|
||||
time.sleep(16)
|
||||
adb("shell", "uiautomator", "dump", "/sdcard/ui_cc.xml")
|
||||
xml = subprocess.check_output(
|
||||
ADB + ["shell", "cat", "/sdcard/ui_cc.xml"], text=True, errors="ignore")
|
||||
root = ET.fromstring(xml)
|
||||
target = None
|
||||
register_btn = None
|
||||
for node in root.iter("node"):
|
||||
rid = node.get("resource-id") or ""
|
||||
text = node.get("text") or ""
|
||||
if "tv_left" in rid or (text.strip().startswith("+") and len(text.strip()) < 8):
|
||||
target = node
|
||||
if "注册" in text and node.get("clickable") == "true":
|
||||
register_btn = node
|
||||
if target is None and register_btn is not None:
|
||||
bounds = register_btn.get("bounds", "")
|
||||
m = re.match(r"\[(\d+),(\d+)\]\[(\d+),(\d+)\]", bounds)
|
||||
if m:
|
||||
x1, y1, x2, y2 = map(int, m.groups())
|
||||
x, y = (x1 + x2) // 2, (y1 + y2) // 2
|
||||
print(f"tap register at {x},{y}")
|
||||
adb("shell", "input", "tap", str(x), str(y))
|
||||
time.sleep(4)
|
||||
adb("shell", "uiautomator", "dump", "/sdcard/ui_cc.xml")
|
||||
xml = subprocess.check_output(
|
||||
ADB + ["shell", "cat", "/sdcard/ui_cc.xml"], text=True, errors="ignore")
|
||||
root = ET.fromstring(xml)
|
||||
for node in root.iter("node"):
|
||||
rid = node.get("resource-id") or ""
|
||||
text = node.get("text") or ""
|
||||
if "tv_left" in rid or (text.strip().startswith("+") and len(text.strip()) < 8):
|
||||
target = node
|
||||
break
|
||||
if target is None:
|
||||
for node in root.iter("node"):
|
||||
text = node.get("text") or ""
|
||||
if "注册" in text or "Register" in text.lower():
|
||||
print("login screen text:", text[:40])
|
||||
print("ERROR: country code control not found")
|
||||
return 1
|
||||
bounds = target.get("bounds", "")
|
||||
m = re.match(r"\[(\d+),(\d+)\]\[(\d+),(\d+)\]", bounds)
|
||||
if not m:
|
||||
print("bad bounds", bounds)
|
||||
return 1
|
||||
x1, y1, x2, y2 = map(int, m.groups())
|
||||
x, y = (x1 + x2) // 2, (y1 + y2) // 2
|
||||
print(f"tap country {target.get('text','')} at {x},{y}")
|
||||
adb("shell", "input", "tap", str(x), str(y))
|
||||
time.sleep(3)
|
||||
adb("shell", "uiautomator", "dump", "/sdcard/ui_cc2.xml")
|
||||
xml2 = subprocess.check_output(
|
||||
ADB + ["shell", "cat", "/sdcard/ui_cc2.xml"], text=True, errors="ignore")
|
||||
root2 = ET.fromstring(xml2)
|
||||
countries = []
|
||||
for node in root2.iter("node"):
|
||||
text = (node.get("text") or "").strip()
|
||||
if "+61" in text or "+86" in text or "Australia" in text or "Malaysia" in text:
|
||||
countries.append(text)
|
||||
pid = subprocess.check_output(
|
||||
ADB + ["shell", "pidof", "my.com.tngdigital.ewallet"], text=True).strip()
|
||||
print("pid:", pid or "DEAD")
|
||||
print("countries visible:", countries[:8])
|
||||
if countries:
|
||||
print("OK region picker visible")
|
||||
return 0
|
||||
print("FAIL region picker empty/black")
|
||||
return 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in New Issue
Block a user