feat: add ortho annotation removal and package integrity manifest

This commit is contained in:
codex
2026-08-07 14:51:57 +03:00
parent 3eaa659947
commit 1986d15c2b
5 changed files with 82 additions and 2 deletions
@@ -12,6 +12,8 @@ if(-not (Test-Path $moduleManifestPath)){throw 'Composite module manifest is mis
$moduleManifest=Get-Content $moduleManifestPath -Raw | ConvertFrom-Json
if($moduleManifest.package -ne 'P_Rec_Annot' -or $moduleManifest.version -ne $xml.ApplicationPackage.AppVersion){throw 'Composite module manifest identity/version mismatch.'}
foreach($assembly in $moduleManifest.assemblies){$path=Join-Path $BundleRoot "Contents\Windows\$($assembly.name)"; if(-not (Test-Path $path)){throw "Manifest assembly missing: $($assembly.name)"}; if((Get-FileHash $path -Algorithm SHA256).Hash.ToLowerInvariant() -ne $assembly.sha256){throw "Manifest hash mismatch: $($assembly.name)"}}
if($moduleManifest.schemaVersion -lt 2 -or @($moduleManifest.files).Count -eq 0){throw 'Complete package file manifest is missing.'}
foreach($file in $moduleManifest.files){$path=Join-Path $BundleRoot ($file.relativePath -replace '/', '\'); if(-not (Test-Path -LiteralPath $path)){throw "Manifest file missing: $($file.relativePath)"}; if((Get-FileHash $path -Algorithm SHA256).Hash.ToLowerInvariant() -ne $file.sha256){throw "Manifest hash mismatch: $($file.relativePath)"}}
$forbidden='^(AcMgd|AcDbMgd|AcCoreMgd|AdWindows|PnP.*)\.dll$'
$forbiddenFiles=Get-ChildItem $BundleRoot -Recurse -File | Where-Object { $_.Name -match $forbidden -or $_.Extension -in '.pdb','.cs' -or $_.FullName -match '\\(bin|obj)\\' }
if($forbiddenFiles){throw "Bundle contains forbidden files: $($forbiddenFiles.FullName -join ', ')"}