Match native rounded-pixel grab rays and retry missing startup PID

This commit is contained in:
NINI
2026-10-10 23:55:54 +09:00
parent d4128d713d
commit bb32fdae9d
4 changed files with 144 additions and 12 deletions
+5 -3
View File
@@ -8,10 +8,11 @@ $checks=[Collections.Generic.List[object]]::new(); $commands=[Collections.Generi
$result=[ordered]@{milestone='Content';sourceCommit=(& git rev-parse HEAD);sourceDirty=[bool](& git status --porcelain);serial=$Serial;apkSha256=(Get-FileHash -LiteralPath $ApkPath -Algorithm SHA256).Hash;status='failed'}
$result.rendererProjection=@{fieldOfView=62;fixedWorldPivot=@(0,.65,0);rawCamera='Saved Board.camera JSON remains canonical';viewport='Landscape wm size max/min; remaining UI and physical touch helper assume sole 2400x1080 AVD'}
$networkBefore=$null; $musicBefore=$null
function Adb([string[]]$Arguments) {
function Adb([string[]]$Arguments,[switch]$AllowMissingPid) {
$started=[DateTime]::UtcNow.ToString('o'); $output=& $adb -s $Serial @Arguments 2>&1; $code=$LASTEXITCODE
$commands.Add(@{startedUtc=$started;finishedUtc=[DateTime]::UtcNow.ToString('o');command=('adb -s '+$Serial+' '+($Arguments -join ' '));exitCode=$code;output=($output -join "`n")})
if ($code -ne 0) { throw "ADB exit $code : $($Arguments -join ' ')" }; return ($output -join "`n").Trim()
$missingPid=$AllowMissingPid -and $code-eq1 -and $Arguments.Count-eq3 -and $Arguments[0]-eq'shell' -and $Arguments[1]-eq'pidof' -and $Arguments[2]-eq$package -and [string]::IsNullOrWhiteSpace(($output -join "`n"))
if ($code -ne 0 -and !$missingPid) { throw "ADB exit $code : $($Arguments -join ' ')" }; return ($output -join "`n").Trim()
}
function Check([string]$Id,[bool]$Passed,[string]$Actual) {
$checks.Add(@{id=$Id;passed=$Passed;actual=$Actual}); if (!$Passed) { throw "Content check failed: $Id ($Actual)" }
@@ -49,7 +50,7 @@ function StartHome([string]$Name) {
$ready=$false; $pauseRequested=$false
Add-Type -AssemblyName System.Drawing
for($attempt=0;$attempt-lt30;$attempt++) {
$pidText=Adb @('shell','pidof',$package)
$pidText=Adb @('shell','pidof',$package) -AllowMissingPid
$saveText=Adb @('shell',('if test -s '+$remote+'; then cat '+$remote+'; fi'))
$validSave=$false
try { $state=$saveText|ConvertFrom-Json -ErrorAction Stop; $validSave=$state.schemaVersion-eq1 -and $null-ne$state.completedStageIds -and $null-ne$state.puzzleStates } catch { }
@@ -84,6 +85,7 @@ function StartHome([string]$Name) {
$pauseRequested=$true
}
if($pidText-match'^\d+'-and$validSave-and$ui){$ready=$true;$saveText|Set-Content (Join-Path $EvidenceDir "$Name-ready-save.json") -Encoding utf8;break}
if($pidText-notmatch'^\d+'){Adb @('shell','am','start','-W','-n',$activity)|Out-Null}
}
$observations.ToArray()|ConvertTo-Json -Depth 6|Set-Content (Join-Path $EvidenceDir "$Name-readiness.json") -Encoding utf8
Check "$Name-home-ready" $ready 'Actual app PID, landscape home colors/button/title and app save JSON; bounded30 observations, black/Unity splash excluded, PNG retained for direct review'