feat: add Zalo database extraction and schema analysis script using ADB

This commit is contained in:
Victor Phan
2026-07-23 22:31:48 +07:00
parent 1a684ddcc9
commit a0548bf1fa
+4 -1
View File
@@ -8,11 +8,14 @@ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(
def run_adb_command(command: str): def run_adb_command(command: str):
"""Chạy lệnh ADB shell và trả về kết quả""" """Chạy lệnh ADB shell và trả về kết quả"""
full_cmd = f"adb shell {command}" full_cmd = f"adb -s 10.160.138.2:5555 shell {command}"
try: try:
result = subprocess.run(full_cmd, shell=True, check=True, capture_output=True, text=True) result = subprocess.run(full_cmd, shell=True, check=True, capture_output=True, text=True)
return result.stdout.strip() return result.stdout.strip()
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
logging.error(f"Lệnh ADB thất bại: {full_cmd}")
logging.error(f"Mã lỗi: {e.returncode}")
logging.error(f"Chi tiết lỗi: {e.stderr}")
return None return None
def analyze_zalo(): def analyze_zalo():