Search Unity

[RELEASED] zip / gzip native multiplatfrom plugin

Discussion in 'Assets and Asset Store' started by elias_t, Jul 8, 2015.

  1. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Good to know.
    Thanks.
     
  2. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    390
    I'm getting a crash while trying to run in the iOS Simulator with this library:

    dyld: lazy symbol binding failed: Symbol not found: _zipCompressBuffer
    dyld: Symbol not found: _zipCompressBuffer


    I'm using the latest version, even though supposedly the simulator has been supported since v1.5
     
  3. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.

    In the Plugins/iOS folder, there is a libzipw.a-simulator.zip archive which includes a simulator version of the plugin.

    Have you used this to replace the libzipw.a plugin?
     
  4. Hydrid101

    Hydrid101

    Joined:
    Aug 11, 2014
    Posts:
    3
    Hi, I am trying to deploy for UWP using IL2CPP but am running into a DllNotFoundException for libzipw when I try running and my app tries to unzip a downloaded file.

    I am currently running in Release for x86 in Visual Studio. Any help would be appreciated. Thanks!
     
  5. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello. Which version of Unity? So I can test here.
     
  6. Hydrid101

    Hydrid101

    Joined:
    Aug 11, 2014
    Posts:
    3
    I am using Unity 2018.2.17f1. If you could check if it works for you on the device, as well as the settings you use to deploy, that would be helpful for me to debug.
     
  7. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Ok.
    I will check this later and get back to you.
     
  8. Hydrid101

    Hydrid101

    Joined:
    Aug 11, 2014
    Posts:
    3
    Found a resolution - the DLLs for UWP somehow went missing from my project so I just reimported the package. Thanks!
     
  9. planetfactory

    planetfactory

    Joined:
    May 18, 2016
    Posts:
    56
    Hi!

    OSX store is no longer accepting 32 bits, so your plugin gets automatically rejected when uploading to the Mac App Store. I can manually fix it after each build, but it will be great if you can update the plugin and remove the 32 bits.

    Thanks!

    Albert
     
  10. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Thx for the heads up.
    I will update.
    Meanwhile I will send a build through a private message.
     
  11. gamebytom

    gamebytom

    Joined:
    Mar 13, 2017
    Posts:
    10
    Hi - I've run into a problem. I'm unzipping a file on Android using the decompress_File method - it unzips fine, but when I try to read the file I get an error - "Sharing violation on path". There is no problem reading the file if the program is reloaded - and I think perhaps a file stream is left open on the file after it has unzipped. Would appreciate any help in solving this.
     
  12. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.

    I will investigate this and get back to you.
     
  13. gamebytom

    gamebytom

    Joined:
    Mar 13, 2017
    Posts:
    10
    Thanks - looking forward to hearing from you.
     
  14. mctenny

    mctenny

    Joined:
    Mar 22, 2019
    Posts:
    3
    Google Play will soon requires arm 64bits support as mandatory, please update the library as soon as you can, much thanks!
     
  15. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.

    Yes I will update very soon. The plugin rewrite was holding me back.
    I guess I will make an intermediate update now.

    But I can send you the arm64 binaries.
    PM me for the link.
     
  16. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    update version 1.5

    - Addded arm64-v8a Android plugin.

    - Resolved some il2cpp issues.

    - Unicode filenames on decompression should work now on Windows.

    - Removed WSA support.
     
  17. ben06feb

    ben06feb

    Joined:
    Oct 2, 2012
    Posts:
    42
    Hi, Can we have details of extracted file directory, such as its name and files inside that?

    Regards,
    Ben
     
  18. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.

    You can get all the details of a zip file by using the getFileInfo function. (see demo.)

    The extracted directory contents I believe it is easy to read on your own. Unless I misunderstood and you mean something else.
     
    ben06feb likes this.
  19. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    UPDATE

    I forgot to add in the latest release notes that now you can decompress split zip archives.

    For example winrar creates such split zip files like:

    myZip.zip
    myZip.z01
    myZip.z02
    myZip.z03

     
  20. OlivierEsolu

    OlivierEsolu

    Joined:
    Oct 29, 2018
    Posts:
    1
    Hi,
    nice work!
    getting the plugin I was hoping to be able to compress and uncompress from a buffer but with the encryption, is there anyway to get this? I cannot find an way point for this without having to create a zip file on disk,
    thanks!
     
  21. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hi.

    Right now you can have an existing encrypted zip archive in a buffer and decompress from there.
    But there is not yet a function to compress to a buffer with encryption.

    I will try to add this in a next update.
     
  22. summitgamesentertainment

    summitgamesentertainment

    Joined:
    Sep 30, 2016
    Posts:
    17
    Hello!

    Need your Help, please!

    Unity Version : 2018.3.11
    Plugin Version : 1.51
    XCode v10.1

    Showing All Messages
    /clang:-1: linker command failed with exit code 1 (use -v to see invocation)


    Error on XCode :
    ld: warning: arm64 function not 4-byte aligned: _unwind_tester from ProjectPath/Projects/XCode v4.5.0/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
    ld: bitcode bundle could not be generated because 'ProjectPath/Projects/XCode v4.5.0/Libraries/ZipPlugin/Plugins/iOS/libzipw.a(minizip.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Steps Done:
    Added -lz flag on XCode> BuildSettings>Other Linker
    Also tried architecture arm64 (unity build).

    Let us know what could be done to solve the issue..
     
  23. summitgamesentertainment

    summitgamesentertainment

    Joined:
    Sep 30, 2016
    Posts:
    17
    can we get the same build as well. we are having the same issue.
     
  24. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.

    The update will be updated today.

    Check your pm for the build.
     
  25. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    update version 1.52

    - Added the ability to create split zip archives.

    - Fixed an issue with the iOS bitcode enabled plugin.
     
  26. OneKnife

    OneKnife

    Joined:
    Aug 7, 2017
    Posts:
    3
    Hello.
    i just wonder how to decompress zip file on the other thread without be a sharing violation?Is snippets blow safe?


    void AsyncDecompressFile()
    {
    _fileProcess = new int[1]; // thread1: Unity Main thread Update UI
    Thread thread = new Thread(() =>
    {
    // thread2: decompress process
    lzip.decompress_File("myfile.zip", "extracePath", _fileProcess, null, null);
    });
    thread.Start();
    }
     
  27. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Yes this should be safe.
    Look also in the demo script for threaded call.
     
  28. OneKnife

    OneKnife

    Joined:
    Aug 7, 2017
    Posts:
    3
    Hi:
    AFAIK, One thread WRITE a value, while another thread READ, may cause half write problem, or code path may optimized by the compiler。I don't know if am i right? maybe here should add keyword volatile. maybe?
     
  29. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    update version 1.54

    - buffer2File fix. (was adding modified time field when it was not needed.)
    - Added Linux glibc 2.17 version plugins (useful for SteamOS).

    update version 1.53

    - Fixed some preprocessor directives.
     
  30. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.

    Yes you can. Using the FileBuffer pointer parameter you can handle a buffer as a zip archive and extract from there to a buffer or to the file system.

    See attached doc file.
     

    Attached Files:

  31. Althis974

    Althis974

    Joined:
    Jul 18, 2019
    Posts:
    1
    Hi,

    We are currently using your plugin in our project but an error occured when built for Android on ARM64 IL2CPP. Application can be launched but game never starts. The error is the following :

    Unity : Unable to find zipw
    Unity : DllNotFoundException: Unable to load DLL 'zipw': The specified module could not be found.
    Unity : at lzip.zipDecompressBuffer (System.IntPtr source, System.Int32 sourceLen, System.Int32& v) [0x00000] in <00000000000000000000000000000000>:0
    Unity : at lzip.decompressBuffer (System.Byte[] source) [0x00000] in <00000000000000000000000000000000>:0
    Unity : at Data.DataStore.StringToDecompressedBytes (System.String value) [0x00000] in <00000000000000000000000000000000>:0
    Unity : at Data.DataStore.FromDataRecords (System.Collections.Generic.Dictionary`2[TKey,TValue] dataRecords) [0x00000] in <00000000000000000000000000000000>:0
    Unity : at Data.CloudDataStoreSaverRetriever.OnUserDataRetrieveAll (System.Collections.Generic.Dictionary`2[TKey,TValue] userData, System.Object customData) [0x00000] in <00000000000000000000000000000000>:0
    Unity : at PlayFab.Internal.PlayFabHttp+<>c__DisplayClass23_0`1[TResult].<_MakeApiCall>b__1 () [0x00000] in <00000000000000000000000000000000>:0
    Unity : at PlayFab.Internal.PlayFabUnityHttp.OnResponse (System.String respons

    It works well when built for Android on ARMv7 IL2CPP though. We checked that plugins are assigned for the appropriate platforms. (see screenshot below). We are using Unity 2018.4.5f1.

    Do you know where it could come from ?

    Thanks.

    EDIT: We've made changes on the lib/arm64-v8a/libzipw.so file to put only android available in ARM64 and it's now working. Changes look weird in file code though. (see new screenshots below). We never changed this file before.
     

    Attached Files:

    Last edited: Aug 9, 2019
  32. mamekudz

    mamekudz

    Joined:
    Feb 12, 2013
    Posts:
    2
    Hi,
    thank you, shortly after sending my last question, I found the soloution by myself. It works :). But now I want to do the reverse way to compress a buffer into a zip archive without using the file system. There is a function "compressBuffer" but there is no parameter to specify the filename. And "buffer2File" needs a path to the file system. Is there a way to do this?

    best regards, Meinolf
     
  33. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    I have finished today the feature to create in memory zip files and decompress from there to memory or the file system.

    It should be up in the store in a few days.
     
  34. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    update version 1.55

    - Added the ability to create In Memory zip archives and manipulate them.
    - MacOS: removed the 32bit only bundle.
    - Replaced the www functions with UnityWebRequest.
    - Removed the watchOS plugins.
    - Docs updated.
     
  35. AytoMaximo

    AytoMaximo

    Joined:
    Aug 26, 2015
    Posts:
    76
    Hi!
    I have an issue with lzip.gzip() method. I use it from UnityEditor on my PC.

    I'm trying to gzip stream with 4 Texture2D files, sometimes it works, but sometimes - not. Depends on the map I put, but I can't definitely say what is the technical difference between them (the same BitDepth, the same TextureFormat and etc). I convert Texture2D to byte[] with the help of EncodeToPNG(), and if it doesn't like any of my maps the final gzip file will be doomed. It has uncompressed size and I can't read it properly: for example, I successfully read the first map, but the second failed. If I comment the lines of creating gzip, I will be able to read all the stream without difficulties.

    My current solution is using EncodeToJPG() instead, but I don't like it very much.

    Really appreciate any ideas about this case :)
     
  36. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.

    Sorry for the late reply but I was away for 3 days.

    The issue here I imagine is that encoding to png makes the byte array un-compressible in terms that the final gzip is larger then the original data.

    But please send me in a private message a sample texture and the code you are using so that we can work something out.

    -------

    Also try to use the lzip.unGzip2 function instead of lzip.unGzip.
     
    Last edited: Sep 10, 2019
  37. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    update version 1.56

    - tvOS has its own plugin folder now.
    - iOS/tvOS plugins are provided by default as bitcode enabled. (non bitcode versions are still provided.)

    update version 1.57

    - tvOS plugin was accidentally not set as bitcode by default.
     
  38. AytoMaximo

    AytoMaximo

    Joined:
    Aug 26, 2015
    Posts:
    76
    Thank you for the answer! I've sent email to elias_t@yahoo.com
     
  39. liannguyen

    liannguyen

    Joined:
    Jun 22, 2016
    Posts:
    2
    decompress_File failed on IOS, Xcode11, Unity2018.4.9! 2E9FD0FD-40E1-4688-8974-C7097B1A884F.jpg
     
  40. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.

    It seems something went wrong with the downloaded zip file.
    If you can send me the sample project using a personal message so I can check it.

    Thank you.
     
  41. liannguyen

    liannguyen

    Joined:
    Jun 22, 2016
    Posts:
    2
    This is sample scene "testZip", (error after update Xcode11) Screen Shot 2019-10-01 at 8.32.29 AM.png
     
    Last edited: Oct 1, 2019
  42. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Ok.

    I will check with xcode 11 and get back to you.
     
  43. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.

    I have made various tests with Unity 2019.1 and Xcode 11.1 and all seems fine.
     
  44. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    update version 1.58

    - iOS: fixed some conflict issues with the Facebook SDK.
     
  45. mamekudz

    mamekudz

    Joined:
    Feb 12, 2013
    Posts:
    2
    Hi,

    the current version works very well. Are there plans to support more platforms like Switch, XBox and PS4? I would pay for an expanded version with pleasure again :)
     
  46. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello. Not for now. Although I am investigating the Switch option.
     
  47. planetfactory

    planetfactory

    Joined:
    May 18, 2016
    Posts:
    56
    Hi!

    I having one error with the new version of xCode and the new version of the library. Unity version is 2018.4.10. Here is the error:

    duplicate symbol '_zipCloseFileInZipRaw64' in:

    /Users/path/Libraries/libiPhone-lib.a(zip.o)
    /Users/path/Libraries/ADL-Plugins/Plugins/iOS/libzipw.a(zip.o)

    ld: 2 duplicate symbols for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    So, it seems that the symbol '_zipCloseFileInZipRaw64' exists in the 2 libraries? Anyone has encountered the same error?

    Thanks!

    Albert
     
  48. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.

    Although this is not happening on Unity 2019 I will make an update asap and send the plugins to you via pm.
    Later I will update the asset store projects.
     
  49. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    update version 1.59

    - iOS/tvOS: fixed duplicate symbol issue with Unity2018.
     
  50. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    update version 1.60

    - fixed some C# issues with the compress_dir and compress_file_list functions