From 484914bd54df9f2849c839b117c0c103ecf725bc Mon Sep 17 00:00:00 2001 From: Karolis Strazdas Date: Sun, 1 Nov 2026 14:56:15 +0200 Subject: [PATCH 1/5] Prepare papyrus-0.3.0+7 --- app/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 15bf9707..09b5d4fb 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -1,7 +1,7 @@ name: papyrus description: "Digital library management application." publish_to: 'none' -version: 0.2.0+6 +version: 0.3.0+7 environment: sdk: ^3.9.2 From 9ae4ce87fe8f62e62b7a782858b3b52b686986f3 Mon Sep 17 00:00:00 2001 From: Karolis Strazdas Date: Sun, 1 Nov 2026 14:56:48 +0200 Subject: [PATCH 2/5] chore: align release reader pin with merged development revision --- app/pubspec.lock | 4 ++-- app/pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/pubspec.lock b/app/pubspec.lock index 77b5ab26..b4c05dc9 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -579,8 +579,8 @@ packages: dependency: "direct main" description: path: "." - ref: c9f566fde4de3bfd1dce6df1fd6d17bae6aaf114 - resolved-ref: c9f566fde4de3bfd1dce6df1fd6d17bae6aaf114 + ref: 48fc8acd0d73d6cfa21a20916f813517b07783b5 + resolved-ref: 48fc8acd0d73d6cfa21a20916f813517b07783b5 url: "https://github.com/PapyrusReader/reader.git" source: git version: "0.0.1" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 09b5d4fb..09a1ca80 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: papyrus_reader: git: url: https://github.com/PapyrusReader/reader.git - ref: c9f566fde4de3bfd1dce6df1fd6d17bae6aaf114 + ref: 48fc8acd0d73d6cfa21a20916f813517b07783b5 epub_pro: ^5.6.0 syncfusion_flutter_pdf: ^32.2.3 dart_mobi: ^1.0.2 From e4d49daa24dc8e00f6779a03c51e2ec9a61824f3 Mon Sep 17 00:00:00 2001 From: Karolis Strazdas Date: Sun, 1 Nov 2026 15:08:07 +0200 Subject: [PATCH 3/5] fix: include reviewed reader seek and completion corrections --- app/pubspec.lock | 4 ++-- app/pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/pubspec.lock b/app/pubspec.lock index b4c05dc9..240886b5 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -579,8 +579,8 @@ packages: dependency: "direct main" description: path: "." - ref: 48fc8acd0d73d6cfa21a20916f813517b07783b5 - resolved-ref: 48fc8acd0d73d6cfa21a20916f813517b07783b5 + ref: eafa444a5acf0ea51018a88eb76de3d19f76187a + resolved-ref: eafa444a5acf0ea51018a88eb76de3d19f76187a url: "https://github.com/PapyrusReader/reader.git" source: git version: "0.0.1" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 09a1ca80..bce049dd 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: papyrus_reader: git: url: https://github.com/PapyrusReader/reader.git - ref: 48fc8acd0d73d6cfa21a20916f813517b07783b5 + ref: eafa444a5acf0ea51018a88eb76de3d19f76187a epub_pro: ^5.6.0 syncfusion_flutter_pdf: ^32.2.3 dart_mobi: ^1.0.2 From 03b276fb7d3034a794136e873b11e6f9aaa4be99 Mon Sep 17 00:00:00 2001 From: Karolis Strazdas Date: Sun, 1 Nov 2026 15:25:22 +0200 Subject: [PATCH 4/5] fix: surface updater failures and retain Windows upgrade diagnostics --- app/assets/updates/install_windows.ps1 | 1 + tools/check_packaged_reader.ps1 | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/assets/updates/install_windows.ps1 b/app/assets/updates/install_windows.ps1 index 2efd0b1c..6396529c 100644 --- a/app/assets/updates/install_windows.ps1 +++ b/app/assets/updates/install_windows.ps1 @@ -21,4 +21,5 @@ try { } catch { $_ | Out-String | Add-Content -LiteralPath $Log # Keep the verified installer and diagnostics for a manual retry. + exit 1 } diff --git a/tools/check_packaged_reader.ps1 b/tools/check_packaged_reader.ps1 index d4d84313..dd7cc809 100644 --- a/tools/check_packaged_reader.ps1 +++ b/tools/check_packaged_reader.ps1 @@ -4,6 +4,8 @@ Set-StrictMode -Version Latest . (Join-Path $PSScriptRoot 'windows_test_helpers.ps1') Set-Location (Join-Path $PSScriptRoot '../app') $Directory = Join-Path ([IO.Path]::GetTempPath()) ('papyrus reader ' + [Guid]::NewGuid().ToString()) +$Reports = Join-Path $PWD 'build/package-smoke-results' +New-Item -ItemType Directory -Path $Reports -Force | Out-Null function Install-TestPackage([string]$Version) { $Installer = (Resolve-Path "dist/papyrus-$Version-windows-x64-setup.exe").Path $Process = Start-Process $Installer -ArgumentList @('/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', "/DIR=`"$Directory`"") -Wait -PassThru @@ -23,10 +25,16 @@ function Install-TestUpdate([string]$Version) { $Helper = (Resolve-Path 'assets/updates/install_windows.ps1').Path $Arguments = @('-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-File', "`"$Helper`"", '-ParentId', $Parent.Id, '-Installer', "`"$Installer`"", '-Checksum', $Checksum, '-InstallDirectory', "`"$Directory`"") - $Updater = Start-Process powershell.exe -ArgumentList $Arguments -PassThru + $Updater = Start-Process powershell.exe -ArgumentList $Arguments -PassThru -NoNewWindow ` + -RedirectStandardOutput (Join-Path $Reports 'windows-updater-stdout.log') ` + -RedirectStandardError (Join-Path $Reports 'windows-updater-stderr.log') Start-Sleep -Milliseconds 500 if ($Updater.HasExited) { throw 'Updater did not wait for normal app exit' } if (-not $Updater.WaitForExit(120000)) { throw 'Updater timed out' } + if ($Updater.ExitCode -ne 0) { + Get-Content -LiteralPath (Join-Path $Download 'update.log') -ErrorAction SilentlyContinue | Write-Host + throw "Updater failed with exit code $($Updater.ExitCode)" + } $Deadline = [DateTime]::UtcNow.AddSeconds(300) while (-not (Test-Path $Report) -and [DateTime]::UtcNow -lt $Deadline) { Start-Sleep -Seconds 1 } if (-not (Test-Path $Report)) { throw "Updater did not relaunch the reader. See $Download/update.log" } @@ -72,5 +80,7 @@ try { Remove-Item Env:PAPYRUS_SMOKE_REPORT -ErrorAction SilentlyContinue Remove-Item Env:PAPYRUS_PERSISTENCE_PHASE -ErrorAction SilentlyContinue Remove-Item Env:PAPYRUS_PERSISTENCE_SESSION -ErrorAction SilentlyContinue + $UpdateLog = Join-Path $Directory 'update download/update.log' + if (Test-Path $UpdateLog) { Copy-Item $UpdateLog (Join-Path $Reports 'windows-updater-install.log') } Remove-TestDirectory $Directory } From 2ae6eac44d68653a2c0cc7653c5c315aa4e64f3b Mon Sep 17 00:00:00 2001 From: Karolis Strazdas Date: Sun, 1 Nov 2026 15:40:06 +0200 Subject: [PATCH 5/5] Verify Windows updates without PowerShell module dependencies --- app/assets/updates/install_windows.ps1 | 12 +++++++++++- tools/check_packaged_reader.ps1 | 13 ++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app/assets/updates/install_windows.ps1 b/app/assets/updates/install_windows.ps1 index 6396529c..a7f14ad7 100644 --- a/app/assets/updates/install_windows.ps1 +++ b/app/assets/updates/install_windows.ps1 @@ -10,7 +10,17 @@ try { # Wait for the user's normal shutdown, preserving pending library writes. $Parent = Get-Process -Id $ParentId -ErrorAction SilentlyContinue if ($Parent -and -not $Parent.WaitForExit(86400000)) { throw 'Update expired while Papyrus was still running.' } - if ((Get-FileHash -LiteralPath $Installer -Algorithm SHA256).Hash.ToLowerInvariant() -ne $Checksum) { + $Algorithm = [System.Security.Cryptography.SHA256]::Create() + $Stream = [System.IO.File]::OpenRead($Installer) + + try { + $ActualChecksum = [System.BitConverter]::ToString($Algorithm.ComputeHash($Stream)).Replace('-', '').ToLowerInvariant() + } finally { + $Stream.Dispose() + $Algorithm.Dispose() + } + + if ($ActualChecksum -ne $Checksum) { throw 'Update checksum changed after download.' } $Arguments = @('/SP-', '/SILENT', '/NORESTART', '/NOCLOSEAPPLICATIONS', '/SUPPRESSMSGBOXES', "/DIR=`"$InstallDirectory`"", "/LOG=`"$Log`"") diff --git a/tools/check_packaged_reader.ps1 b/tools/check_packaged_reader.ps1 index dd7cc809..66e694a4 100644 --- a/tools/check_packaged_reader.ps1 +++ b/tools/check_packaged_reader.ps1 @@ -17,12 +17,23 @@ function Install-TestUpdate([string]$Version) { $Installer = Join-Path $Download 'setup.exe' Copy-Item "dist/papyrus-$Version-windows-x64-setup.exe" $Installer $Checksum = (Get-FileHash -LiteralPath $Installer -Algorithm SHA256).Hash.ToLowerInvariant() + $Helper = (Resolve-Path 'assets/updates/install_windows.ps1').Path + $RejectedLog = Join-Path $Download 'update.log' + & powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File $Helper ` + -ParentId ([int]::MaxValue) -Installer $Installer -Checksum ('0' * 64) -InstallDirectory $Directory + + if ($LASTEXITCODE -ne 1 -or -not (Test-Path $Installer) -or + -not (Select-String -LiteralPath $RejectedLog -SimpleMatch 'Update checksum changed after download.')) { + throw 'Updater did not reject an invalid checksum before installation' + } + + Copy-Item $RejectedLog (Join-Path $Reports 'windows-updater-rejected.log') + Remove-Item $RejectedLog $Report = Join-Path $PWD 'build/package-smoke-results/windows-updater.json' Remove-Item -LiteralPath $Report -ErrorAction SilentlyContinue $env:PAPYRUS_PERSISTENCE_PHASE = 'verify' $env:PAPYRUS_SMOKE_REPORT = $Report $Parent = Start-Process powershell.exe -ArgumentList @('-NoProfile', '-Command', 'Start-Sleep -Seconds 3') -PassThru - $Helper = (Resolve-Path 'assets/updates/install_windows.ps1').Path $Arguments = @('-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-File', "`"$Helper`"", '-ParentId', $Parent.Id, '-Installer', "`"$Installer`"", '-Checksum', $Checksum, '-InstallDirectory', "`"$Directory`"") $Updater = Start-Process powershell.exe -ArgumentList $Arguments -PassThru -NoNewWindow `