This commit is contained in:
parent
84ae0f6994
commit
1d36961a7c
16 changed files with 734 additions and 48 deletions
|
|
@ -58,15 +58,7 @@ function Build-Host([string]$Goos, [string]$Goarch, [string]$Ext = "") {
|
|||
}
|
||||
}
|
||||
|
||||
Write-Host "==> building host drm ($Version) into $Out"
|
||||
Build-Host windows amd64 ".exe"
|
||||
Build-Host windows arm64 ".exe"
|
||||
Build-Host linux amd64
|
||||
Build-Host linux arm64
|
||||
Build-Host darwin amd64
|
||||
Build-Host darwin arm64
|
||||
|
||||
Write-Host "==> building on-device MITM (linux/arm64)"
|
||||
Write-Host "==> building on-device MITM (linux/arm64) first (embedded into drm.exe)"
|
||||
$env:GOOS = "linux"
|
||||
$env:GOARCH = "arm64"
|
||||
$env:CGO_ENABLED = "0"
|
||||
|
|
@ -81,10 +73,31 @@ try {
|
|||
Remove-Item Env:CGO_ENABLED -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Stage into bootstrap embed so a lone drm.exe can extract bin/proxy-android-arm64.
|
||||
$embedProxy = Join-Path $Root "apps\pkg\bootstrap\embedded\bin\proxy-android-arm64"
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path $embedProxy) | Out-Null
|
||||
Copy-Item (Join-Path $Out "proxy-android-arm64") $embedProxy -Force
|
||||
Write-Host " staged embed: $embedProxy"
|
||||
|
||||
Write-Host "==> building host drm ($Version) into $Out"
|
||||
Build-Host windows amd64 ".exe"
|
||||
Build-Host windows arm64 ".exe"
|
||||
Build-Host linux amd64
|
||||
Build-Host linux arm64
|
||||
Build-Host darwin amd64
|
||||
Build-Host darwin arm64
|
||||
|
||||
New-Item -ItemType Directory -Force -Path (Join-Path $Root "bin"), (Join-Path $Root "apps\proxy") | Out-Null
|
||||
Copy-Item (Join-Path $Out "proxy-android-arm64") (Join-Path $Root "bin\proxy-android-arm64") -Force
|
||||
Copy-Item (Join-Path $Out "proxy-android-arm64") (Join-Path $Root "apps\proxy\proxy-android-arm64") -Force
|
||||
Copy-Item (Join-Path $Out "drm-windows-amd64.exe") (Join-Path $Root "bin\drm.exe") -Force
|
||||
try {
|
||||
Copy-Item (Join-Path $Out "drm-windows-amd64.exe") (Join-Path $Root "bin\drm.exe") -Force
|
||||
} catch {
|
||||
Write-Host "WARN: could not refresh bin\drm.exe (file in use): $($_.Exception.Message)"
|
||||
}
|
||||
# Restore tiny embed stub so the 9MB MITM binary is not left in the source tree.
|
||||
$stub = Join-Path $Root "apps\pkg\bootstrap\embedded\bin\proxy-android-arm64"
|
||||
[System.IO.File]::WriteAllBytes($stub, [byte[]](0x7F, 0x45, 0x4C, 0x46))
|
||||
|
||||
Write-Host "==> checksums"
|
||||
$sumsPath = Join-Path $Out "SHA256SUMS.txt"
|
||||
|
|
@ -96,5 +109,47 @@ $lines = Get-ChildItem $Out -File |
|
|||
[System.IO.File]::WriteAllLines($tmpSums, @($lines))
|
||||
Move-Item -Force $tmpSums $sumsPath
|
||||
|
||||
# Portable Windows folder: binaries + minimal config (no Go / no full source).
|
||||
$win = Join-Path $Out "windows-amd64"
|
||||
New-Item -ItemType Directory -Force -Path @(
|
||||
$win,
|
||||
(Join-Path $win "bin"),
|
||||
(Join-Path $win "apps\pkg"),
|
||||
(Join-Path $win "apps\proxy\device"),
|
||||
(Join-Path $win "outputs")
|
||||
) | Out-Null
|
||||
Copy-Item (Join-Path $Out "drm-windows-amd64.exe") (Join-Path $win "bin\drm.exe") -Force
|
||||
Copy-Item (Join-Path $Out "proxy-android-arm64") (Join-Path $win "bin\proxy-android-arm64") -Force
|
||||
# Also beside bin\ for users who cd into bin
|
||||
Copy-Item (Join-Path $Out "drm-windows-amd64.exe") (Join-Path $win "drm.exe") -Force
|
||||
Copy-Item (Join-Path $Out "proxy-android-arm64") (Join-Path $win "proxy-android-arm64") -Force
|
||||
Copy-Item (Join-Path $Root "apps\proxy\device\tproxy_iptables.sh") (Join-Path $win "apps\proxy\device\") -Force
|
||||
Copy-Item (Join-Path $Root "apps\pkg\go.mod") (Join-Path $win "apps\pkg\") -Force
|
||||
Copy-Item (Join-Path $Root "README.md") (Join-Path $win "README.md") -Force -ErrorAction SilentlyContinue
|
||||
# Module YAMLs are NOT shipped in the exe and not required in this zip —
|
||||
# operators add apps/modules/<name>/module.yaml from the GitHub tree.
|
||||
@"
|
||||
Null DRM — Windows portable
|
||||
|
||||
Scaffold (drm.exe also creates this on first run if you only download the exe):
|
||||
bin\drm.exe
|
||||
bin\proxy-android-arm64
|
||||
apps\proxy\device\tproxy_iptables.sh
|
||||
|
||||
Modules are NOT inside the exe. Add your own:
|
||||
apps\modules\bbc\module.yaml
|
||||
(copy from the GitHub repo apps/modules/bbc/module.yaml)
|
||||
|
||||
You do NOT need ``drm proxy build``.
|
||||
|
||||
bin\drm.exe proxy install-ca --reinject
|
||||
adb shell am force-stop bbc.iplayer.android
|
||||
bin\drm.exe capture --app bbc --channel bbcone --wait 120
|
||||
|
||||
NordVPN UK on the phone. First install-ca creates data\proxy-ca.* (private CA).
|
||||
"@ | Set-Content -Encoding utf8 (Join-Path $win "README.txt")
|
||||
|
||||
Write-Host "==> done ($Version)"
|
||||
Get-ChildItem $Out | Format-Table Name, Length
|
||||
Write-Host "==> portable Windows folder: $win"
|
||||
Get-ChildItem $win | Format-Table Name, Length
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue