build: include android runtime helpers
This commit is contained in:
1 parent
f257c4e3fc
commit
63c726ddea
12 files changed
+129
-29
No files matched your search
+3
-2
@@ -70,6 +70,7 @@ dist\DouyinGuaji-<version>\
|
||||
- `run_cli.exe`:后台运行入口,桌面 GUI / Web GUI 会调用它
|
||||
- `assets/`、`webui/`、`config/`:运行所需资源
|
||||
- `platform-tools/`:随包 ADB 运行组件,至少包含 `adb.exe`、`AdbWinApi.dll`、`AdbWinUsbApi.dll`
|
||||
- `android-tools/`:随包手机侧辅助组件,当前包含 `ADBKeyboard.apk`
|
||||
- `logs/`、`pic/`、`state/`:运行时输出目录
|
||||
- `license.dat`:默认不随包分发;仅本地测试包需要时才使用 `-IncludeLicense` 显式复制
|
||||
|
||||
@@ -96,8 +97,8 @@ dist\installer\DouyinGuaji-3.3.3-Setup.exe
|
||||
## 发给别人前检查
|
||||
|
||||
- 打包脚本会自动运行 `python -m tools.distribution_manifest dist\DouyinGuaji-<version>`,防止源码、调试产物、个人配置和旧日志混入分发目录。
|
||||
- 最终分发目录只应保留根目录三个 exe、一个 `_internal/`、运行时白名单 `assets/`、运行时白名单 `webui/`、`platform-tools/` 中的 ADB 白名单文件、`config/README.md`、`logs/.keep`、`pic/.keep`、`state/.keep`。正式分发不要包含 `license.dat`、`README.md`、`artifacts/`、`tests/`、源码目录、调试截图、临时模板或 debug/README 页面。
|
||||
- 正式包会自带 ADB,不要求目标电脑额外安装 Android platform-tools 或配置 PATH。新电脑仍需要在手机上开启开发者选项/USB 调试并允许本机 RSA 授权;部分品牌手机首次 USB 识别还需要 Windows 能正确安装对应 USB 驱动。
|
||||
- 最终分发目录只应保留根目录三个 exe、一个 `_internal/`、运行时白名单 `assets/`、运行时白名单 `webui/`、`platform-tools/` 中的 ADB 白名单文件、`android-tools/ADBKeyboard.apk`、`config/README.md`、`logs/.keep`、`pic/.keep`、`state/.keep`。正式分发不要包含 `license.dat`、`README.md`、`artifacts/`、`tests/`、源码目录、调试截图、临时模板或 debug/README 页面。
|
||||
- 正式包会自带 ADB,不要求目标电脑额外安装 Android platform-tools 或配置 PATH。程序在需要中文输入且设备未安装 ADBKeyboard 时,会尝试从随包 `android-tools/ADBKeyboard.apk` 自动安装到手机。新电脑仍需要在手机上开启开发者选项/USB 调试并允许本机 RSA 授权;部分品牌手机首次 USB 识别还需要 Windows 能正确安装对应 USB 驱动。
|
||||
- 首次启动 PaddleOCR 相关组件可能较慢,杀毒软件也可能扫描 exe。
|
||||
- `config/config.json` 是本地运行配置,默认不随安装包带个人配置;让使用者首次打开后在 GUI 中保存配置。
|
||||
- 默认 Cython 编译后仍要以 `python -m tools.distribution_manifest dist\DouyinGuaji-<version>` 的结果为准;PASS 才能发给别人。使用 `-NoCythonForDevOnly` 生成的明文包禁止分发。
|
||||
@@ -132,30 +132,19 @@ foreach ($name in @("DouyinGuajiGUI", "web_gui", "run_cli")) {
|
||||
Remove-Item -LiteralPath $srcDir -Recurse -Force
|
||||
}
|
||||
|
||||
$RuntimeAssets = @(
|
||||
"coupon.png",
|
||||
"fav.png",
|
||||
"fudai.png",
|
||||
"fudai_icon_countdown_v20260618.png",
|
||||
"fudai_icon_pending_v20260618.png",
|
||||
"fudai_icon_purple_left_v20260618.png",
|
||||
"fudai_icon_red_left_v20260618.png",
|
||||
"fudai_task_status_dacheng_shape.png",
|
||||
"like.png",
|
||||
"x.png",
|
||||
"xin.png"
|
||||
)
|
||||
$AssetsTarget = Join-Path $DistRoot "assets"
|
||||
if (Test-Path $AssetsTarget) {
|
||||
Remove-Item -LiteralPath $AssetsTarget -Recurse -Force
|
||||
}
|
||||
New-Item -ItemType Directory -Force $AssetsTarget | Out-Null
|
||||
foreach ($name in $RuntimeAssets) {
|
||||
$src = Join-Path $Root "assets\$name"
|
||||
if (-not (Test-Path $src)) {
|
||||
throw "Missing runtime asset: assets\$name"
|
||||
}
|
||||
Copy-Item -LiteralPath $src -Destination (Join-Path $AssetsTarget $name) -Force
|
||||
$RuntimeAssetFiles = Get-ChildItem -LiteralPath (Join-Path $Root "assets") -File | Where-Object {
|
||||
$_.Extension -ieq ".png"
|
||||
}
|
||||
if (-not $RuntimeAssetFiles) {
|
||||
throw "Missing runtime assets: assets\*.png"
|
||||
}
|
||||
foreach ($asset in $RuntimeAssetFiles) {
|
||||
Copy-Item -LiteralPath $asset.FullName -Destination (Join-Path $AssetsTarget $asset.Name) -Force
|
||||
}
|
||||
|
||||
$WebuiTarget = Join-Path $DistRoot "webui"
|
||||
@@ -242,6 +231,17 @@ foreach ($name in $PlatformToolFiles) {
|
||||
}
|
||||
}
|
||||
|
||||
$AndroidToolsTarget = Join-Path $DistRoot "android-tools"
|
||||
if (Test-Path $AndroidToolsTarget) {
|
||||
Remove-Item -LiteralPath $AndroidToolsTarget -Recurse -Force
|
||||
}
|
||||
New-Item -ItemType Directory -Force $AndroidToolsTarget | Out-Null
|
||||
$AdbKeyboardApk = Join-Path $Root "tools\adb\ADBKeyboard.apk"
|
||||
if (-not (Test-Path $AdbKeyboardApk)) {
|
||||
throw "Missing Android helper: tools\adb\ADBKeyboard.apk"
|
||||
}
|
||||
Copy-Item -LiteralPath $AdbKeyboardApk -Destination (Join-Path $AndroidToolsTarget "ADBKeyboard.apk") -Force
|
||||
|
||||
$licensePath = Join-Path $Root "license.dat"
|
||||
if ($IncludeLicense -and (Test-Path $licensePath)) {
|
||||
Copy-Item -LiteralPath $licensePath -Destination (Join-Path $DistRoot "license.dat") -Force
|
||||
|
||||
Reference in new issue
Block a user