diff --git a/AssetStudio/BundleDecompressionHelper.cs b/AssetStudio/BundleDecompressionHelper.cs index f5409b1..ded951d 100644 --- a/AssetStudio/BundleDecompressionHelper.cs +++ b/AssetStudio/BundleDecompressionHelper.cs @@ -1,9 +1,9 @@ -using BundleCompression.Lzma; -using BundleCompression.Oodle; +using AssetStudio.Libs.Lzma; +using AssetStudio.Libs.Oodle; +using K4os.Compression.LZ4; using System; using System.IO; using System.Text.RegularExpressions; -using K4os.Compression.LZ4; using ZstdSharp; namespace AssetStudio diff --git a/AssetStudio/ImportHelper.cs b/AssetStudio/ImportHelper.cs index 20c633c..53be86d 100644 --- a/AssetStudio/ImportHelper.cs +++ b/AssetStudio/ImportHelper.cs @@ -1,9 +1,12 @@ -using Org.Brotli.Dec; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.IO.Compression; using System.Linq; +#if NETFRAMEWORK +using AssetStudio.Libs.Brotli; +#endif + namespace AssetStudio { public static class ImportHelper @@ -81,7 +84,11 @@ namespace AssetStudio using (reader) { var stream = new MemoryStream(); +#if NETFRAMEWORK using (var brotliStream = new BrotliInputStream(reader.BaseStream)) +#else + using (var brotliStream = new BrotliStream(reader.BaseStream, CompressionMode.Decompress)) +#endif { brotliStream.CopyTo(stream); } diff --git a/AssetStudio/Brotli/BitReader.cs b/AssetStudio/Libs/Brotli/BitReader.cs similarity index 100% rename from AssetStudio/Brotli/BitReader.cs rename to AssetStudio/Libs/Brotli/BitReader.cs diff --git a/AssetStudio/Brotli/BrotliInputStream.cs b/AssetStudio/Libs/Brotli/BrotliInputStream.cs similarity index 98% rename from AssetStudio/Brotli/BrotliInputStream.cs rename to AssetStudio/Libs/Brotli/BrotliInputStream.cs index 097f179..ef66c00 100644 --- a/AssetStudio/Brotli/BrotliInputStream.cs +++ b/AssetStudio/Libs/Brotli/BrotliInputStream.cs @@ -1,9 +1,9 @@ -/* Copyright 2015 Google Inc. All Rights Reserved. +/* Copyright 2015 Google Inc. All Rights Reserved. Distributed under MIT license. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ -namespace Org.Brotli.Dec +namespace AssetStudio.Libs.Brotli { /// /// diff --git a/AssetStudio/Brotli/BrotliRuntimeException.cs b/AssetStudio/Libs/Brotli/BrotliRuntimeException.cs similarity index 100% rename from AssetStudio/Brotli/BrotliRuntimeException.cs rename to AssetStudio/Libs/Brotli/BrotliRuntimeException.cs diff --git a/AssetStudio/Brotli/Context.cs b/AssetStudio/Libs/Brotli/Context.cs similarity index 100% rename from AssetStudio/Brotli/Context.cs rename to AssetStudio/Libs/Brotli/Context.cs diff --git a/AssetStudio/Brotli/Decode.cs b/AssetStudio/Libs/Brotli/Decode.cs similarity index 100% rename from AssetStudio/Brotli/Decode.cs rename to AssetStudio/Libs/Brotli/Decode.cs diff --git a/AssetStudio/Brotli/Dictionary.cs b/AssetStudio/Libs/Brotli/Dictionary.cs similarity index 100% rename from AssetStudio/Brotli/Dictionary.cs rename to AssetStudio/Libs/Brotli/Dictionary.cs diff --git a/AssetStudio/Brotli/Huffman.cs b/AssetStudio/Libs/Brotli/Huffman.cs similarity index 100% rename from AssetStudio/Brotli/Huffman.cs rename to AssetStudio/Libs/Brotli/Huffman.cs diff --git a/AssetStudio/Brotli/HuffmanTreeGroup.cs b/AssetStudio/Libs/Brotli/HuffmanTreeGroup.cs similarity index 100% rename from AssetStudio/Brotli/HuffmanTreeGroup.cs rename to AssetStudio/Libs/Brotli/HuffmanTreeGroup.cs diff --git a/AssetStudio/Brotli/IntReader.cs b/AssetStudio/Libs/Brotli/IntReader.cs similarity index 100% rename from AssetStudio/Brotli/IntReader.cs rename to AssetStudio/Libs/Brotli/IntReader.cs diff --git a/AssetStudio/Brotli/Prefix.cs b/AssetStudio/Libs/Brotli/Prefix.cs similarity index 100% rename from AssetStudio/Brotli/Prefix.cs rename to AssetStudio/Libs/Brotli/Prefix.cs diff --git a/AssetStudio/Brotli/RunningState.cs b/AssetStudio/Libs/Brotli/RunningState.cs similarity index 100% rename from AssetStudio/Brotli/RunningState.cs rename to AssetStudio/Libs/Brotli/RunningState.cs diff --git a/AssetStudio/Brotli/State.cs b/AssetStudio/Libs/Brotli/State.cs similarity index 100% rename from AssetStudio/Brotli/State.cs rename to AssetStudio/Libs/Brotli/State.cs diff --git a/AssetStudio/Brotli/Transform.cs b/AssetStudio/Libs/Brotli/Transform.cs similarity index 100% rename from AssetStudio/Brotli/Transform.cs rename to AssetStudio/Libs/Brotli/Transform.cs diff --git a/AssetStudio/Brotli/Utils.cs b/AssetStudio/Libs/Brotli/Utils.cs similarity index 100% rename from AssetStudio/Brotli/Utils.cs rename to AssetStudio/Libs/Brotli/Utils.cs diff --git a/AssetStudio/Brotli/WordTransformType.cs b/AssetStudio/Libs/Brotli/WordTransformType.cs similarity index 100% rename from AssetStudio/Brotli/WordTransformType.cs rename to AssetStudio/Libs/Brotli/WordTransformType.cs diff --git a/AssetStudio/BundleCompression/Oodle/Oodle.cs b/AssetStudio/Libs/Oodle/Oodle.cs similarity index 97% rename from AssetStudio/BundleCompression/Oodle/Oodle.cs rename to AssetStudio/Libs/Oodle/Oodle.cs index b074a69..bec97b3 100644 --- a/AssetStudio/BundleCompression/Oodle/Oodle.cs +++ b/AssetStudio/Libs/Oodle/Oodle.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; using AssetStudio.PInvoke; #endif -namespace BundleCompression.Oodle +namespace AssetStudio.Libs.Oodle { public static class OodleLZ { diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Common/CRC.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Common/CRC.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Common/CRC.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Common/CRC.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Common/CommandLineParser.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Common/CommandLineParser.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Common/CommandLineParser.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Common/CommandLineParser.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Common/InBuffer.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Common/InBuffer.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Common/InBuffer.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Common/InBuffer.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Common/OutBuffer.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Common/OutBuffer.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Common/OutBuffer.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Common/OutBuffer.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZ/IMatchFinder.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZ/IMatchFinder.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZ/IMatchFinder.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZ/IMatchFinder.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZ/LzBinTree.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZ/LzBinTree.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZ/LzBinTree.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZ/LzBinTree.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZ/LzInWindow.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZ/LzInWindow.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZ/LzInWindow.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZ/LzInWindow.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZ/LzOutWindow.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZ/LzOutWindow.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZ/LzOutWindow.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZ/LzOutWindow.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZMA/LzmaBase.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZMA/LzmaBase.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZMA/LzmaBase.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZMA/LzmaBase.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZMA/LzmaDecoder.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZMA/LzmaDecoder.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZMA/LzmaDecoder.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZMA/LzmaDecoder.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZMA/LzmaEncoder.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZMA/LzmaEncoder.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/LZMA/LzmaEncoder.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Compress/LZMA/LzmaEncoder.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoder.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoder.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoder.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoder.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoderBit.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoderBit.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoderBit.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoderBit.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoderBitTree.cs b/AssetStudio/Libs/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoderBitTree.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoderBitTree.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/Compress/RangeCoder/RangeCoderBitTree.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/7zip/ICoder.cs b/AssetStudio/Libs/SevenZipLzma/7zip/ICoder.cs similarity index 100% rename from AssetStudio/BundleCompression/SevenZipLzma/7zip/ICoder.cs rename to AssetStudio/Libs/SevenZipLzma/7zip/ICoder.cs diff --git a/AssetStudio/BundleCompression/SevenZipLzma/SevenZipLzma.cs b/AssetStudio/Libs/SevenZipLzma/SevenZipLzma.cs similarity index 97% rename from AssetStudio/BundleCompression/SevenZipLzma/SevenZipLzma.cs rename to AssetStudio/Libs/SevenZipLzma/SevenZipLzma.cs index 03adabc..690fa42 100644 --- a/AssetStudio/BundleCompression/SevenZipLzma/SevenZipLzma.cs +++ b/AssetStudio/Libs/SevenZipLzma/SevenZipLzma.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.IO; using SevenZip.Compression.LZMA; -namespace BundleCompression.Lzma +namespace AssetStudio.Libs.Lzma { public static class SevenZipLzma {