feat: 内置并统一使用项目 ADB (#149)

This commit is contained in:
chengma
2026-08-11 12:01:07 +08:00
parent 56b1a46c5c
commit 8f2037db2f
21 changed files with 355 additions and 46 deletions
+12 -2
View File
@@ -108,6 +108,13 @@ VSVersionInfo(
$distPath = Join-Path $buildRoot "dist"
$workPath = Join-Path $buildRoot "work"
$specPath = Join-Path $buildRoot "spec"
$bundledAdbSource = Join-Path $clientRoot "vendor\android-platform-tools\windows"
foreach ($adbFileName in @("adb.exe", "AdbWinApi.dll", "AdbWinUsbApi.dll")) {
$adbSourceFile = Join-Path $bundledAdbSource $adbFileName
if (-not (Test-Path -LiteralPath $adbSourceFile -PathType Leaf)) {
throw "A required bundled ADB source file is missing: $adbSourceFile"
}
}
Write-Host "[4/7] Building the main application..."
Invoke-Checked -FailureMessage "Failed to build the main application" -Command {
@@ -118,6 +125,7 @@ VSVersionInfo(
--collect-all qfluentwidgets `
--collect-all uiautomator2 `
--collect-all adbutils `
--add-binary "$bundledAdbSource;vendor/android-platform-tools/windows" `
(Join-Path $clientRoot "buyer_main.py")
}
@@ -131,11 +139,13 @@ VSVersionInfo(
$mainDist = Join-Path $distPath "CMAutoBuy"
$launcherExe = Join-Path $distPath "Launcher.exe"
$adbExe = Join-Path $mainDist "dependencies\adbutils\binaries\adb.exe"
$bundledAdbDist = Join-Path $mainDist "dependencies\vendor\android-platform-tools\windows"
foreach ($requiredPath in @(
(Join-Path $mainDist "CMAutoBuy.exe"),
(Join-Path $mainDist "dependencies\PyQt5\Qt5\plugins\platforms\qwindows.dll"),
$adbExe,
(Join-Path $bundledAdbDist "adb.exe"),
(Join-Path $bundledAdbDist "AdbWinApi.dll"),
(Join-Path $bundledAdbDist "AdbWinUsbApi.dll"),
$launcherExe
)) {
if (-not (Test-Path -LiteralPath $requiredPath -PathType Leaf)) {