diff --git a/CMakeLists.txt b/CMakeLists.txt index 52cec583..b54a8ae7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,7 @@ endif() # set(ZLIB_COMPAT ON CACHE BOOL "Build zlib-ng for compatibility with zlib" FORCE) set(ZLIB_ENABLE_TESTS OFF CACHE BOOL "Do not build zlib-ng tests" FORCE) +set(WITH_NEW_STRATEGIES OFF CACHE BOOL "Disable faster, but with worse compression, deflate strategies" FORCE) # # Read product version diff --git a/LibZipSharp.props b/LibZipSharp.props index de6683ba..58c72535 100644 --- a/LibZipSharp.props +++ b/LibZipSharp.props @@ -1,6 +1,6 @@ - <_LibZipSharpNugetVersion>2.0.0-alpha4 + <_LibZipSharpNugetVersion>2.0.0-alpha5 <_NativeBuildDir>$(MSBuildThisFileDirectory)lzsbuild <_ExternalDir>$(MSBuildThisFileDirectory)external <_MonoPosixNugetVersion>7.0.0-alpha8.21302.6 diff --git a/LibZipSharp/Xamarin.Tools.Zip/ZipArchive.cs b/LibZipSharp/Xamarin.Tools.Zip/ZipArchive.cs index cd3088be..8d13cd53 100644 --- a/LibZipSharp/Xamarin.Tools.Zip/ZipArchive.cs +++ b/LibZipSharp/Xamarin.Tools.Zip/ZipArchive.cs @@ -329,7 +329,7 @@ public ZipEntry AddStream (Stream stream, string archivePath, EntryPermissions p long index = Native.zip_file_add (archive, destPath, source, overwriteExisting ? OperationFlags.Overwrite : OperationFlags.None); if (index < 0) throw GetErrorException (); - if (Native.zip_set_file_compression (archive, (ulong)index, compressionMethod, 0) < 0) + if (Native.zip_set_file_compression (archive, (ulong)index, compressionMethod, 9) < 0) throw GetErrorException (); if (permissions == EntryPermissions.Default) permissions = DefaultFilePermissions; @@ -410,7 +410,7 @@ public ZipEntry AddFile (string sourcePath, string archivePath = null, long index = PlatformServices.Instance.StoreSpecialFile (this, sourcePath, archivePath, out compressionMethod); if (index < 0) throw GetErrorException (); - if (Native.zip_set_file_compression (archive, (ulong)index, isDir ? CompressionMethod.Store : compressionMethod, 0) < 0) + if (Native.zip_set_file_compression (archive, (ulong)index, isDir ? CompressionMethod.Store : compressionMethod, 9) < 0) throw GetErrorException (); PlatformServices.Instance.SetEntryPermissions (this, sourcePath, (ulong)index, permissions); ZipEntry entry = ReadEntry ((ulong)index);