File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
apps/faf-legacy-deployment/scripts Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -379,11 +379,23 @@ class Patcher(
379379 require(Files .isRegularFile(path)) { " Path $path is not a regular file" }
380380
381381 val archiveName = base.relativize(path).toString().replace(" \\ " , " /" )
382- val entry = ZipEntry (archiveName)
383- // fix timestamp for determinism (not strictly necessary)
384- entry.time = 315532800000L
382+
383+
384+ // Read file fully (FA requires sizes & CRC up front otherwise can't read the zip file)
385+ val bytes = Files .readAllBytes(path)
386+ val crc = java.util.zip.CRC32 ().apply { update(bytes) }
387+
388+ val entry = ZipEntry (archiveName).apply {
389+ method = ZipEntry .DEFLATED
390+ size = bytes.size.toLong()
391+ compressedSize = - 1 // let deflater handle, still no descriptor
392+ this .crc = crc.value
393+ // fix timestamp for determinism (not strictly necessary)
394+ time = 315532800000L // 1980-01-01
395+ }
396+
385397 this .putNextEntry(entry)
386- Files .newInputStream(path).use { inp -> inp.copyTo( this ) }
398+ this .write(bytes)
387399 this .closeEntry()
388400 }
389401
You can’t perform that action at this time.
0 commit comments