imetting_backend/test_apk_parser.py

25 lines
773 B
Python
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"""
测试APK解析功能
"""
from app.utils.apk_parser import parse_apk_with_androguard
# 测试导入是否正常
try:
from androguard.core.apk import APK
print("✅ androguard 导入成功")
print(f" androguard 模块路径: {APK.__module__}")
except ImportError as e:
print(f"❌ androguard 导入失败: {e}")
exit(1)
# 如果有测试APK文件可以在这里测试解析
# apk_path = "path/to/your/test.apk"
# result = parse_apk_with_androguard(apk_path)
# print(f"解析结果: {result}")
print("\n📋 测试结果:")
print(" 1. androguard 库已成功安装")
print(" 2. 导入路径正确: androguard.core.apk.APK")
print(" 3. 可以正常使用 APK 解析功能")
print("\n💡 提示: 请重启后台服务以使更改生效")