Files
OpticalSystem/uniapp/scripts/verify-apk.ps1
一休哥哥6666 721543f423 feat:uniapp模块
2026-07-14 14:53:45 +08:00

34 lines
1008 B
PowerShell
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 用法:.\scripts\verify-apk.ps1 "D:\path\to\app.apk"
param(
[Parameter(Mandatory = $true)]
[string]$ApkPath
)
if (-not (Test-Path $ApkPath)) {
Write-Error "APK 不存在: $ApkPath"
exit 1
}
$sdk = $env:ANDROID_HOME
if (-not $sdk) { $sdk = "$env:LOCALAPPDATA\Android\Sdk" }
$aapt = Get-ChildItem -Path "$sdk\build-tools" -Recurse -Filter "aapt.exe" -ErrorAction SilentlyContinue |
Sort-Object FullName -Descending |
Select-Object -First 1
Write-Host "=== APK 文件 ==="
Write-Host $ApkPath
Write-Host ""
if ($aapt) {
Write-Host "=== 包名aapt dump badging==="
& $aapt.FullName dump badging $ApkPath | Select-String "package:|launchable-activity"
} else {
Write-Host "未找到 aapt.exeAndroid SDK build-tools"
Write-Host "请在 HBuilderX 中打开 src/manifest.json -> 基础配置 -> Android包名确认是否为 com.jyuan.optical"
}
Write-Host ""
Write-Host "=== 手机已安装的相关包 ==="
adb shell pm list packages | findstr /i "uni jyuan optical"