build: bundle adb platform tools

This commit is contained in:
Your Name committed 2026-06-27 17:59:36 +08:00
1 parent ecbd07cea0
commit f257c4e3fc
11 files changed
+207 -6

No files matched your search

+17
View File
@@ -76,6 +76,14 @@ ALLOWED_WEBUI_SUFFIXES = {
".js",
}
ALLOWED_PLATFORM_TOOLS_FILES = {
"platform-tools/adb.exe",
"platform-tools/adbwinapi.dll",
"platform-tools/adbwinusbapi.dll",
"platform-tools/notice.txt",
"platform-tools/source.properties",
}
FORBIDDEN_SUFFIXES = (
".py",
".pyc",
@@ -150,6 +158,8 @@ def is_forbidden_distribution_entry(entry: str, *, allow_license: bool = False)
if not any(lower.startswith(prefix) for prefix in ALLOWED_WEBUI_DIRS):
return True
return Path(lower).suffix not in ALLOWED_WEBUI_SUFFIXES
if lower.startswith("platform-tools/"):
return lower not in ALLOWED_PLATFORM_TOOLS_FILES
if any(lower.startswith(prefix.lower()) for prefix in FORBIDDEN_PREFIXES):
return True
return any(lower.endswith(suffix) for suffix in FORBIDDEN_SUFFIXES)
@@ -173,6 +183,13 @@ def find_missing_required_runtime_entries(entries: list[str]) -> list[str]:
for required in ("DouyinGuajiGUI.exe", "web_gui.exe", "run_cli.exe"):
if required.lower() not in normalized:
missing.append(required)
for required in (
"platform-tools/adb.exe",
"platform-tools/AdbWinApi.dll",
"platform-tools/AdbWinUsbApi.dll",
):
if required.lower() not in normalized:
missing.append(required)
if not any(entry.startswith("_internal/") and entry.startswith("_internal/python") and entry.endswith(".dll") for entry in normalized):
missing.append("_internal/python*.dll")
if "_internal/base_library.zip" not in normalized: