Skip to content

Commit 9a61471

Browse files
committed
fix(release): tolerate blank apksigner output lines in the signing gate
Newer build-tools apksigner prints JDK native-access warnings followed by an empty line before the signer block. The policy function takes a [string[]] parameter, which refuses empty elements, so the gate died on a binding error instead of verifying. Blank lines are now dropped before the policy check.
1 parent bcd0b7e commit 9a61471

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎scripts/verify-release-signing.ps1‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,15 @@ $sdk = Resolve-SdkDir -Explicit $SdkDir
7070
$apksigner = Find-ApkSigner -Sdk $sdk
7171

7272
Write-Output "Verifying signer certificate of: $resolvedApk"
73-
# Coerce every record (native stderr merged by 2>&1 arrives as ErrorRecord) to a string.
74-
$out = @(& $apksigner verify --print-certs $resolvedApk 2>&1 | ForEach-Object { [string]$_ })
73+
# Coerce every record (native stderr merged by 2>&1 arrives as ErrorRecord) to a
74+
# string, and drop blank lines: newer apksigner builds separate their JDK
75+
# native-access warnings from the signer block with an empty line, and the
76+
# policy function's [string[]] parameter refuses empty elements.
77+
$out = @(
78+
& $apksigner verify --print-certs $resolvedApk 2>&1 |
79+
ForEach-Object { [string]$_ } |
80+
Where-Object { $_.Trim() }
81+
)
7582
$exit = $LASTEXITCODE
7683
if ($exit -ne 0) {
7784
Write-Error "apksigner could not verify the APK (is it signed?):`n$($out -join "`n")"

0 commit comments

Comments
 (0)