Release Android 1.0.9 single-node client
This commit is contained in:
@@ -0,0 +1,178 @@
|
||||
# Local candidate only. Uses cached dependencies; never starts adb or an emulator.
|
||||
param([string]$JobDirectory = '',[switch]$ResumeAfterBuild,[string]$ToolRoot = '')
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Set-StrictMode -Version Latest
|
||||
$repo = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
|
||||
$tempRoot = [IO.Path]::GetFullPath([IO.Path]::GetTempPath()).TrimEnd(
|
||||
[char[]]@([IO.Path]::DirectorySeparatorChar,[IO.Path]::AltDirectorySeparatorChar)
|
||||
)
|
||||
if ($ResumeAfterBuild -and -not $JobDirectory) { throw 'Resume requires the exact completed build directory' }
|
||||
if (-not $JobDirectory) { $JobDirectory = Join-Path $tempRoot ('ucvl-android-109-' + [guid]::NewGuid().ToString('N')) }
|
||||
$job = [IO.Path]::GetFullPath($JobDirectory)
|
||||
if ([IO.Path]::GetDirectoryName($job) -ine $tempRoot -or [IO.Path]::GetFileName($job) -cnotmatch '^ucvl-android-109-[a-f0-9]{32}$' -or $job -match '[^\x00-\x7F]') {
|
||||
throw 'A fresh scoped ASCII temporary directory is required'
|
||||
}
|
||||
if ((Test-Path -LiteralPath $job) -and -not $ResumeAfterBuild) { throw 'Candidate directory already exists' }
|
||||
$buildText = Get-Content -LiteralPath (Join-Path $repo 'V2rayNG/app/build.gradle.kts') -Raw
|
||||
if ($buildText -notmatch 'versionCode = 10009' -or $buildText -notmatch 'versionName = "1.0.9"') { throw 'Source version mismatch' }
|
||||
$toolRootValue = if ($ToolRoot) { $ToolRoot } else { $env:UCVL_ANDROID_TOOL_ROOT }
|
||||
if (-not $toolRootValue) { throw 'ToolRoot or UCVL_ANDROID_TOOL_ROOT is required' }
|
||||
$toolRootPath = [IO.Path]::GetFullPath($toolRootValue)
|
||||
$javaHome = Join-Path $toolRootPath '.tools/jdk-staging/jdk-21.0.12.1+1'
|
||||
$androidSdk = Join-Path $toolRootPath '.tools/android-sdk'
|
||||
$signingProperties = Join-Path $toolRootPath '.tools/signing/signing.properties'
|
||||
$keyStore = Join-Path $toolRootPath '.tools/signing/ucvl-zonghengjia-release.jks'
|
||||
foreach ($required in @($javaHome,$androidSdk,$signingProperties,$keyStore)) {
|
||||
if (-not (Test-Path -LiteralPath $required)) { throw "Missing private build input: $required" }
|
||||
}
|
||||
$project = Join-Path $job 'project'
|
||||
$source = Join-Path $repo 'V2rayNG'
|
||||
function Save-Json([string]$Name,$Value) {
|
||||
[IO.File]::WriteAllText((Join-Path $job "evidence/$Name"),($Value | ConvertTo-Json -Depth 12),[Text.UTF8Encoding]::new($false))
|
||||
}
|
||||
function Get-PortableRelativePath([string]$Base,[string]$Target) {
|
||||
$basePath = [IO.Path]::GetFullPath($Base).TrimEnd([char[]]@([char]'\',[char]'/')) + [IO.Path]::DirectorySeparatorChar
|
||||
$baseUri = New-Object System.Uri($basePath)
|
||||
$targetUri = New-Object System.Uri([IO.Path]::GetFullPath($Target))
|
||||
[Uri]::UnescapeDataString($baseUri.MakeRelativeUri($targetUri).ToString()).Replace('\','/')
|
||||
}
|
||||
function Read-UnitTestSuites {
|
||||
@(Get-ChildItem -LiteralPath (Join-Path $project 'app/build/test-results/testPlaystoreReleaseUnitTest') -Filter 'TEST-*.xml' -File -ErrorAction SilentlyContinue | Sort-Object Name | ForEach-Object {
|
||||
[xml]$xml = [IO.File]::ReadAllText($_.FullName,[Text.Encoding]::UTF8)
|
||||
[pscustomobject]@{
|
||||
Name=[string]$xml.testsuite.name
|
||||
Tests=[int]$xml.testsuite.tests
|
||||
Failures=[int]$xml.testsuite.failures
|
||||
Errors=[int]$xml.testsuite.errors
|
||||
Skipped=[int]$xml.testsuite.skipped
|
||||
TestCases=@($xml.testsuite.testcase).Count
|
||||
ReportName=$_.Name
|
||||
ReportSha256=(Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash
|
||||
}
|
||||
})
|
||||
}
|
||||
$env:JAVA_HOME = $javaHome
|
||||
$env:ANDROID_HOME = $androidSdk
|
||||
if (-not $ResumeAfterBuild) {
|
||||
$null = New-Item -ItemType Directory -Path $job,$project,(Join-Path $job 'evidence'),(Join-Path $job 'artifacts')
|
||||
foreach ($name in @('gradlew','gradlew.bat','gradle.properties','settings.gradle.kts','build.gradle.kts','gradle')) {
|
||||
Copy-Item -LiteralPath (Join-Path $source $name) -Destination $project -Recurse
|
||||
}
|
||||
$null = New-Item -ItemType Directory -Path (Join-Path $project 'app')
|
||||
foreach ($name in @('src','libs','build.gradle.kts','proguard-rules.pro')) {
|
||||
Copy-Item -LiteralPath (Join-Path $source "app/$name") -Destination (Join-Path $project 'app') -Recurse
|
||||
}
|
||||
$inputs = @(Get-ChildItem -LiteralPath $project -File -Recurse | Sort-Object FullName | ForEach-Object {
|
||||
[ordered]@{Path=(Get-PortableRelativePath $project $_.FullName);Bytes=$_.Length;Sha256=(Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash}
|
||||
})
|
||||
Save-Json 'build-inputs.json' $inputs
|
||||
$inputsHash = (Get-FileHash -LiteralPath (Join-Path $job 'evidence/build-inputs.json')).Hash
|
||||
$started = [DateTimeOffset]::Now
|
||||
Push-Location $project
|
||||
try {
|
||||
$savedErrorActionPreference = $ErrorActionPreference
|
||||
try {
|
||||
# Windows PowerShell 5 wraps benign native stderr (for example JVM
|
||||
# warnings) as NativeCommandError. The Gradle process exit code is the
|
||||
# authoritative build result and its complete output remains in evidence.
|
||||
$ErrorActionPreference = 'Continue'
|
||||
& ./gradlew.bat --offline --no-daemon --max-workers=2 :app:testPlaystoreReleaseUnitTest :app:assemblePlaystoreRelease :app:assemblePlaystoreReleaseAndroidTest *> (Join-Path $job 'evidence/gradle.log')
|
||||
$buildExit = $LASTEXITCODE
|
||||
} finally {
|
||||
$ErrorActionPreference = $savedErrorActionPreference
|
||||
}
|
||||
} finally { Pop-Location }
|
||||
$suites = @(Read-UnitTestSuites)
|
||||
$tests = [ordered]@{StartedAt=$started.ToString('O');ExitCode=$buildExit;Offline=$true;Suites=$suites;BuildInputsSha256=$inputsHash;PhysicalDeviceTested=$false;EmulatorStarted=$false;Published=$false}
|
||||
Save-Json 'tests.json' $tests
|
||||
} else {
|
||||
$tests = Get-Content -LiteralPath (Join-Path $job 'evidence/tests.json') -Raw | ConvertFrom-Json
|
||||
$suites = @(Read-UnitTestSuites)
|
||||
if (($tests.Suites | ConvertTo-Json -Depth 5 -Compress) -cne ($suites | ConvertTo-Json -Depth 5 -Compress)) { throw 'Completed JUnit XML evidence changed' }
|
||||
$buildExit = $tests.ExitCode
|
||||
$inputs = Get-Content -LiteralPath (Join-Path $job 'evidence/build-inputs.json') -Raw | ConvertFrom-Json
|
||||
$inputsHash = (Get-FileHash -LiteralPath (Join-Path $job 'evidence/build-inputs.json')).Hash
|
||||
if ($inputsHash -ne $tests.BuildInputsSha256) { throw 'Completed build input manifest changed' }
|
||||
}
|
||||
if ($buildExit -ne 0) { throw "Gradle failed ($buildExit); evidence retained at $job" }
|
||||
$totalUnitTests = [int]($suites | Measure-Object Tests -Sum).Sum
|
||||
$authorizationSuites = @($suites | Where-Object { $_.Name -ceq 'com.v2ray.ang.ucvl.UcvlAuthorizationGuardTest' })
|
||||
$startupLeaseSuites = @($suites | Where-Object { $_.Name -ceq 'com.v2ray.ang.ucvl.UcvlVpnStartupLeaseTest' })
|
||||
$upgradeSuites = @($suites | Where-Object { $_.Name -ceq 'com.v2ray.ang.ucvl.UcvlUpgradeReliabilityTest' })
|
||||
$singleNodeSuites = @($suites | Where-Object { $_.Name -ceq 'com.v2ray.ang.ucvl.UcvlSingleNodePolicyTest' })
|
||||
$modeSwitchSuites = @($suites | Where-Object { $_.Name -ceq 'com.v2ray.ang.ucvl.UcvlModeSwitchTransactionTest' })
|
||||
$managedRecordSuites = @($suites | Where-Object { $_.Name -ceq 'com.v2ray.ang.ucvl.UcvlManagedConfigRecordTest' })
|
||||
$serviceStateSuites = @($suites | Where-Object { $_.Name -ceq 'com.v2ray.ang.ucvl.UcvlServiceStateReconcilerTest' })
|
||||
if ($totalUnitTests -lt 100 -or ($suites | Measure-Object Failures -Sum).Sum -ne 0 -or ($suites | Measure-Object Errors -Sum).Sum -ne 0 -or ($suites | Measure-Object Skipped -Sum).Sum -ne 0) {
|
||||
throw 'Unexpected unit test coverage or failures'
|
||||
}
|
||||
if ($authorizationSuites.Count -ne 1 -or $authorizationSuites[0].Tests -ne 10 -or $startupLeaseSuites.Count -ne 1 -or $startupLeaseSuites[0].Tests -lt 8) {
|
||||
throw 'Required authorization or VPN startup lease regressions missing'
|
||||
}
|
||||
if ($upgradeSuites.Count -ne 1 -or $upgradeSuites[0].Tests -ne 8) { throw 'Required Android upgrade regressions missing' }
|
||||
if ($singleNodeSuites.Count -ne 1 -or $singleNodeSuites[0].Tests -lt 20 -or $modeSwitchSuites.Count -ne 1 -or $modeSwitchSuites[0].Tests -lt 9 -or $managedRecordSuites.Count -ne 1 -or $managedRecordSuites[0].Tests -ne 4 -or $serviceStateSuites.Count -ne 1 -or $serviceStateSuites[0].Tests -ne 4) {
|
||||
throw 'Required single-node or live mode-switch regressions missing'
|
||||
}
|
||||
foreach ($suite in $suites) {
|
||||
if (-not $suite.Name -or $suite.Tests -lt 1 -or $suite.Tests -ne $suite.TestCases) { throw 'JUnit suite count differs from actual test cases' }
|
||||
}
|
||||
$authorizationUnitTests = [int]$authorizationSuites[0].Tests
|
||||
$startupLeaseUnitTests = [int]$startupLeaseSuites[0].Tests
|
||||
foreach ($row in $inputs) {
|
||||
if ((Get-FileHash -LiteralPath (Join-Path $project $row.Path)).Hash -ne $row.Sha256 -or (Get-FileHash -LiteralPath (Join-Path $source $row.Path)).Hash -ne $row.Sha256) {
|
||||
throw "Input changed during build: $($row.Path)"
|
||||
}
|
||||
}
|
||||
$java = Join-Path $env:JAVA_HOME 'bin/java.exe'
|
||||
$signer = Join-Path $env:ANDROID_HOME 'build-tools/37.0.0/lib/apksigner.jar'
|
||||
$signerBat = Join-Path $env:ANDROID_HOME 'build-tools/37.0.0/apksigner.bat'
|
||||
$zipAlign = Join-Path $env:ANDROID_HOME 'build-tools/37.0.0/zipalign.exe'
|
||||
$aapt = Join-Path $env:ANDROID_HOME 'build-tools/37.0.0/aapt.exe'
|
||||
$expectedCertificate = '0f1a09870d6ee1e73b62138f99463e7066f4228ce28b7f16ff0aeccca59ea14f'
|
||||
$previousPackage = Join-Path $toolRootPath 'releases/UCVL-Zonghengjia-1.0.8-android-universal.apk'
|
||||
$oldVerification = (& $java -jar $signer verify --verbose --print-certs $previousPackage 2>&1 | Out-String)
|
||||
if ($LASTEXITCODE -ne 0 -or $oldVerification -notmatch $expectedCertificate) { throw 'Old 1.0.8 signing identity differs' }
|
||||
$signing = @{}
|
||||
Get-Content -LiteralPath $signingProperties | ForEach-Object {
|
||||
$parts = $_ -split '=',2
|
||||
if ($parts.Length -eq 2) { $signing[$parts[0].Trim()] = $parts[1].Trim() }
|
||||
}
|
||||
$env:UCVL_ANDROID_STORE_PASS = $signing['storePassword']
|
||||
$env:UCVL_ANDROID_KEY_PASS = $signing['keyPassword']
|
||||
try {
|
||||
foreach ($unsigned in Get-ChildItem -LiteralPath (Join-Path $project 'app/build/outputs/apk/playstore/release') -Filter 'UCVL-Zonghengjia-1.0.9-android-*.apk' -File) {
|
||||
$aligned = Join-Path $job ('.aligned-' + $unsigned.Name)
|
||||
$signed = Join-Path $job ('artifacts/' + $unsigned.Name)
|
||||
& $zipAlign -f -p 4 $unsigned.FullName $aligned
|
||||
if ($LASTEXITCODE -ne 0) { throw "APK alignment failed: $($unsigned.Name)" }
|
||||
& $signerBat sign --ks $keyStore --ks-key-alias $signing['keyAlias'] --ks-pass env:UCVL_ANDROID_STORE_PASS --key-pass env:UCVL_ANDROID_KEY_PASS --out $signed $aligned
|
||||
if ($LASTEXITCODE -ne 0) { throw "APK signing failed: $($unsigned.Name)" }
|
||||
Remove-Item -LiteralPath $aligned -Force
|
||||
}
|
||||
$unsignedTest = Get-ChildItem -LiteralPath (Join-Path $project 'app/build/outputs/apk/androidTest/playstore/release') -Filter '*androidTest*.apk' -File
|
||||
if (@($unsignedTest).Count -ne 1) { throw 'Expected exactly one Android instrumentation APK' }
|
||||
$alignedTest = Join-Path $job '.aligned-app-playstore-release-androidTest-1.0.9.apk'
|
||||
$signedTest = Join-Path $job 'artifacts/app-playstore-release-androidTest-1.0.9.apk'
|
||||
& $zipAlign -f -p 4 $unsignedTest.FullName $alignedTest
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Android instrumentation APK alignment failed' }
|
||||
& $signerBat sign --ks $keyStore --ks-key-alias $signing['keyAlias'] --ks-pass env:UCVL_ANDROID_STORE_PASS --key-pass env:UCVL_ANDROID_KEY_PASS --out $signedTest $alignedTest
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Android instrumentation APK signing failed' }
|
||||
Remove-Item -LiteralPath $alignedTest -Force
|
||||
} finally {
|
||||
Remove-Item Env:UCVL_ANDROID_STORE_PASS,Env:UCVL_ANDROID_KEY_PASS -ErrorAction SilentlyContinue
|
||||
$signing.Clear()
|
||||
}
|
||||
$packages = @(foreach ($file in Get-ChildItem -LiteralPath (Join-Path $job 'artifacts') -Filter 'UCVL-Zonghengjia-1.0.9-android-*.apk' -File | Sort-Object Name) {
|
||||
$verification = (& $java -jar $signer verify --verbose --print-certs $file.FullName 2>&1 | Out-String)
|
||||
if ($LASTEXITCODE -ne 0 -or $verification -notmatch $expectedCertificate -or $verification -notmatch 'v2\): true' -or $verification -notmatch 'v3\): true') { throw "Candidate signature mismatch: $($file.Name)" }
|
||||
$badging = (& $aapt dump badging $file.FullName 2>&1 | Out-String)
|
||||
if ($LASTEXITCODE -ne 0 -or $badging -notmatch "package: name='cn.toplc.zonghengjia' versionCode='4010009' versionName='1.0.9'") { throw "Candidate manifest mismatch: $($file.Name)" }
|
||||
[ordered]@{Name=$file.Name;Bytes=$file.Length;Sha256=(Get-FileHash -LiteralPath $file.FullName).Hash;Version='1.0.9';VersionCode=4010009;SignerSha256=$expectedCertificate;V2=$true;V3=$true}
|
||||
})
|
||||
if ($packages.Count -ne 5) { throw 'Expected all five ABI/universal packages' }
|
||||
$testApk = Get-Item -LiteralPath (Join-Path $job 'artifacts/app-playstore-release-androidTest-1.0.9.apk')
|
||||
$testVerification = (& $java -jar $signer verify --verbose --print-certs $testApk.FullName 2>&1 | Out-String)
|
||||
if ($LASTEXITCODE -ne 0 -or $testVerification -notmatch $expectedCertificate) { throw 'Android instrumentation APK signature mismatch' }
|
||||
Save-Json 'candidate.json' ([ordered]@{Version='1.0.9';VersionCode=4010009;BaseVersionCode=10009;JobDirectory=$job;BuiltAt=[DateTimeOffset]::Now.ToString('O');Packages=$packages;AndroidTest=[ordered]@{Name=$testApk.Name;Bytes=$testApk.Length;Sha256=(Get-FileHash -LiteralPath $testApk.FullName).Hash;SignerSha256=$expectedCertificate};BuildInputsSha256=$inputsHash;UnitTests=$totalUnitTests;AuthorizationLifecycleJvmTests=$authorizationUnitTests;StartupLeaseJvmTests=$startupLeaseUnitTests;SingleNodeJvmTests=[int]$singleNodeSuites[0].Tests;ModeSwitchJvmTests=[int]$modeSwitchSuites[0].Tests;ManagedConfigRecordJvmTests=[int]$managedRecordSuites[0].Tests;ServiceStateJvmTests=[int]$serviceStateSuites[0].Tests;SameSignerAs=@('1.0.8');PhysicalDeviceTested=$false;AndroidServiceBroadcastTested=$false;StableReleaseAccepted=$false;Published=$false})
|
||||
Write-Output "CANDIDATE_JOB=$job"
|
||||
Write-Output 'CANDIDATE_BUILD_SIGN_VERIFY_PASSED'
|
||||
+47
-26
@@ -4,60 +4,81 @@ Seeds only a synthetic non-authenticating session. Does not alter host networkin
|
||||
or request a production account. Run after building/signing the test APK.
|
||||
"""
|
||||
import datetime
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ADB = ROOT / ".tools/android-sdk/platform-tools/adb.exe"
|
||||
PACKAGE = "cn.toplc.zonghengjia"
|
||||
SERIAL = "emulator-5554"
|
||||
|
||||
|
||||
def adb(*args, timeout=60):
|
||||
return subprocess.run([str(ADB), "-s", SERIAL, *map(str, args)], capture_output=True,
|
||||
def adb(adb_path, serial, *args, timeout=60):
|
||||
return subprocess.run([str(adb_path), "-s", serial, *map(str, args)], capture_output=True,
|
||||
text=True, encoding="utf-8", errors="replace", timeout=timeout,
|
||||
check=True, creationflags=subprocess.CREATE_NO_WINDOW).stdout
|
||||
|
||||
|
||||
def instrument(method):
|
||||
result = adb("shell", "am", "instrument", "-w", "-r", "-e", "oldVersion", "1.0.2",
|
||||
"-e", "newVersion", "1.0.3", "-e", "class",
|
||||
def instrument(adb_path, serial, method, old_version, new_version, new_version_code):
|
||||
result = adb(adb_path, serial, "shell", "am", "instrument", "-w", "-r",
|
||||
"-e", "oldVersion", old_version,
|
||||
"-e", "newVersion", new_version,
|
||||
"-e", "newVersionCode", str(new_version_code), "-e", "class",
|
||||
"com.v2ray.ang.ucvl.UpgradeSmokeTest#" + method,
|
||||
PACKAGE + ".test/androidx.test.runner.AndroidJUnitRunner", timeout=90)
|
||||
if "OK (1 test)" not in result:
|
||||
raise RuntimeError("Instrumentation failed: " + result[-3000:])
|
||||
|
||||
|
||||
def parse_args():
|
||||
tool_root = Path(os.environ.get("UCVL_ANDROID_TOOL_ROOT", ROOT))
|
||||
parser = argparse.ArgumentParser(description="Verify the 1.0.8 to 1.0.9 signed cover upgrade on the dedicated emulator")
|
||||
parser.add_argument("--adb", type=Path, default=tool_root / ".tools/android-sdk/platform-tools/adb.exe")
|
||||
parser.add_argument("--serial", default="emulator-5554")
|
||||
parser.add_argument("--old-version", default="1.0.8")
|
||||
parser.add_argument("--new-version", default="1.0.9")
|
||||
parser.add_argument("--new-version-code", type=int, default=4_010_009)
|
||||
parser.add_argument("--old-apk", type=Path, default=ROOT / "releases/UCVL-Zonghengjia-1.0.8-android-universal.apk")
|
||||
parser.add_argument("--new-apk", type=Path, default=ROOT / "releases/UCVL-Zonghengjia-1.0.9-android-universal.apk")
|
||||
parser.add_argument("--test-apk", type=Path, default=ROOT / "releases/app-playstore-release-androidTest-1.0.9.apk")
|
||||
parser.add_argument("--evidence", type=Path, default=ROOT / "acceptance/upgrade-1.0.9.json")
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main():
|
||||
assert adb("shell", "getprop", "ro.kernel.qemu").strip() == "1", "Dedicated emulator only"
|
||||
assert "ucvl_acceptance" in adb("emu", "avd", "name"), "Unexpected emulator image"
|
||||
assert adb("shell", "getprop", "sys.boot_completed").strip() == "1", "Emulator has not booted"
|
||||
old = ROOT / "releases/UCVL-Zonghengjia-1.0.2-android-universal.apk"
|
||||
new = ROOT / "releases/UCVL-Zonghengjia-1.0.3-android-universal.apk"
|
||||
test = ROOT / "releases/app-playstore-release-androidTest-1.0.3.apk"
|
||||
args = parse_args()
|
||||
assert args.adb.is_file(), f"adb not found: {args.adb}"
|
||||
assert adb(args.adb, args.serial, "shell", "getprop", "ro.kernel.qemu").strip() == "1", "Dedicated emulator only"
|
||||
assert "ucvl_acceptance" in adb(args.adb, args.serial, "emu", "avd", "name"), "Unexpected emulator image"
|
||||
assert adb(args.adb, args.serial, "shell", "getprop", "sys.boot_completed").strip() == "1", "Emulator has not booted"
|
||||
old, new, test = args.old_apk.resolve(), args.new_apk.resolve(), args.test_apk.resolve()
|
||||
assert all(path.is_file() for path in [old, new, test])
|
||||
evidence = ROOT / "acceptance/upgrade-1.0.3.json"
|
||||
report = {"timestamp": datetime.datetime.now().astimezone().isoformat(), "serial": SERIAL,
|
||||
"old_version": "1.0.2", "new_version": "1.0.3", "passed": False,
|
||||
evidence = args.evidence.resolve()
|
||||
evidence.parent.mkdir(parents=True, exist_ok=True)
|
||||
report = {"timestamp": datetime.datetime.now().astimezone().isoformat(), "serial": args.serial,
|
||||
"old_version": args.old_version, "new_version": args.new_version,
|
||||
"new_version_code": args.new_version_code, "passed": False,
|
||||
"physical_device_tested": False, "host_network_modified": False,
|
||||
"authenticated_vpn_connection_tested": False, "steps": []}
|
||||
try:
|
||||
adb("shell", "am", "force-stop", PACKAGE)
|
||||
assert "Success" in adb("install", "-r", old)
|
||||
assert "Success" in adb("install", "-r", test)
|
||||
instrument("seedUpgrade")
|
||||
report["steps"].append("seed_synthetic_session_on_1.0.2")
|
||||
assert "Success" in adb("install", "-r", new)
|
||||
instrument("verifyUpgrade")
|
||||
report["steps"].append("cover_upgrade_preserves_encrypted_session_login_and_device_id")
|
||||
instrument("loginVisibleAndEmptyFormIsSafe")
|
||||
adb(args.adb, args.serial, "shell", "am", "force-stop", PACKAGE)
|
||||
assert "Success" in adb(args.adb, args.serial, "install", "-r", old)
|
||||
assert "Success" in adb(args.adb, args.serial, "install", "-r", test)
|
||||
instrument(args.adb, args.serial, "seedUpgrade", args.old_version, args.new_version, args.new_version_code)
|
||||
report["steps"].append(f"seed_synthetic_session_and_legacy_managed_config_on_{args.old_version}")
|
||||
assert "Success" in adb(args.adb, args.serial, "install", "-r", new)
|
||||
instrument(args.adb, args.serial, "verifyUpgrade", args.old_version, args.new_version, args.new_version_code)
|
||||
report["steps"].append("cover_upgrade_preserves_encrypted_session_and_rejects_legacy_managed_config")
|
||||
instrument(args.adb, args.serial, "legacyManagedConfigCannotStartFromToggle", args.old_version, args.new_version, args.new_version_code)
|
||||
report["steps"].append("legacy_managed_config_rejected_by_real_toggle_entry_point")
|
||||
instrument(args.adb, args.serial, "loginVisibleAndEmptyFormIsSafe", args.old_version, args.new_version, args.new_version_code)
|
||||
report["steps"].append("login_visible_empty_submission_safe_fixture_cleared")
|
||||
report["apk_sha256"] = hashlib.sha256(new.read_bytes()).hexdigest()
|
||||
report["passed"] = True
|
||||
finally:
|
||||
adb("shell", "am", "force-stop", PACKAGE)
|
||||
adb(args.adb, args.serial, "shell", "am", "force-stop", PACKAGE)
|
||||
evidence.write_text(json.dumps(report, indent=2), encoding="utf-8")
|
||||
print(json.dumps(report))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user