From c2f693756aa6ad8a5008221e29d992c256652e6d Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Sat, 16 Mar 2024 08:31:07 +0100 Subject: [PATCH] Revert "Properly set header fields in ZipArchiveOutputStream" This reverts commit e209cad206b98b624b14794bc6d838839b89aa9c. GitOrigin-RevId: 6d0428089cef189567b23a07805a5487262d8be8 --- .../intellij/build/io/ZipArchiveOutputStream.kt | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/build/tasks/src/org/jetbrains/intellij/build/io/ZipArchiveOutputStream.kt b/build/tasks/src/org/jetbrains/intellij/build/io/ZipArchiveOutputStream.kt index 1fee5267773e..332fe6788a37 100644 --- a/build/tasks/src/org/jetbrains/intellij/build/io/ZipArchiveOutputStream.kt +++ b/build/tasks/src/org/jetbrains/intellij/build/io/ZipArchiveOutputStream.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.intellij.build.io import com.intellij.util.lang.ImmutableZipFile @@ -51,9 +51,9 @@ internal class ZipArchiveOutputStream(private val channel: WritableByteChannel, buffer.clear() buffer.putInt(0x04034b50) // Version needed to extract (minimum) - buffer.putShort(0x0014) + buffer.putShort(0) // General purpose bit flag - buffer.putShort(0x0800) + buffer.putShort(0) // Compression method buffer.putShort(ZipEntry.STORED.toShort()) // File last modification time @@ -413,12 +413,6 @@ internal class ZipArchiveOutputStream(private val channel: WritableByteChannel, val headerOffset = buffer.position() buffer.putInt(headerOffset, 0x02014b50) - // version made by - buffer.putShort(headerOffset + 4, 0x0314) - // version needed to extract (minimum) - buffer.putShort(headerOffset + 6, 0x0014) - // general purpose bit flag - buffer.putShort(headerOffset + 8, 0x0800) // compression method buffer.putShort(headerOffset + 10, method.toShort()) // CRC-32 of uncompressed data @@ -452,9 +446,9 @@ internal class ZipArchiveOutputStream(private val channel: WritableByteChannel, internal fun writeLocalFileHeader(name: ByteArray, size: Int, compressedSize: Int, crc32: Long, method: Int, buffer: ByteBuffer): Int { buffer.putInt(0x04034b50) // Version needed to extract (minimum) - buffer.putShort(0x0014) + buffer.putShort(0) // General purpose bit flag - buffer.putShort(0x0800) + buffer.putShort(0) // Compression method buffer.putShort(method.toShort()) // File last modification time