Search Unity

7zip, lzma, LZ4, fastLZ, zip/gzip & brotli native multiplatform plugins.

Discussion in 'Assets and Asset Store' started by elias_t, Nov 16, 2013.

  1. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello. Please tell me which part needs glibc-2.14.
     
  2. elias_t

    elias_t

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

    - ZIP: Hotfix for password encoded zip files not creating folders.
    - ZIP: Hotfix for the compressDir function.
     
  3. zjuyyl

    zjuyyl

    Joined:
    Jan 10, 2018
    Posts:
    4
    Hi
    would you add a feature that get the detail progress for decompress of lzma? or this feather is already have?
    for example, the .7z file's total size is 100m, and now 30m is decompressed, so the decompress progress is 30%, I want to show the progressbar when decompress the .7z file

    or just make the int[] progress to float[] progress ,to decrib 2.3 have decompressed of total 3 files
     
  4. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello. Use the progress variable together with the get7zInfo function. The lzma.sinfo will give you the uncompressed size of the file.
     
  5. zjuyyl

    zjuyyl

    Joined:
    Jan 10, 2018
    Posts:
    4
    this can only get the size of every files in 7z file, but still cant get the size have uncompressed,for example the 7z file only contain 1 file about 1GB, it takes 1min to uncompress, how do I get the progressbar work?
     
  6. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    The progress for individual file is not implemented yet. I will look to add this in the next update.
     
  7. dongch007

    dongch007

    Joined:
    Jan 8, 2014
    Posts:
    41
    Hi, I have a problem when use lzma.
    I have many small compressed file(<64k) in apk,and I want decompress them to moilbe phone.
    The first solution is
    byte[] data = lzma.decompressBuffer(bytes);
    File.WriteAllBytes(path, data);​
    but it seems like the cost of call "decompressBuffer" is heavy than just decompress with 7zip c# implementation when file is small.I guess the time is cost at transmit data between c and c#.

    Now I use like this:
    File.WriteAllBytes(tempPath, bytes);
    Lzma.LzmaUtilDecode(tempPath, path);
    File.Delete(tempPath);​
    It's really fast, but looks not comfortable.

    So what can I do to improve the first solution?
     
    Last edited: May 24, 2018
  8. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    You have your 7z archive with solid compression enabled. This is meant for one go decompression.
    If you want to decompress several smaller files from it, non-solid compression is recommended.
     
  9. The_Arrival

    The_Arrival

    Joined:
    Dec 3, 2014
    Posts:
    82
    Hello elias,

    could you post an example on how you would wrap the decompression in a coroutine, so it would not block the mainthread and be able to return the progress each frame.
    I´m looking for a solution that works on Android and iOS, but i´m currently struggling making the coroutine non blocking. My current attempt looks like this, i also have a debug log during void Update(), so i know when a frame ticked.
    There are no Updates during the decompress, so as far as i can tell it´s blocking the mainthread until its done:


    Code (CSharp):
    1. IEnumerator DecompressCoroutine(string zipPath) {
    2.         Debug.Log("Start Zip: " + DateTime.Now);
    3.         int result = lzip.decompress_File(zipPath, Globals.DOWNLOAD_BASE_PATH, progress);
    4.  
    5.         yield return result;
    6.        
    7.         if (result != 1) {
    8.             errorMessage = "Fehler beim enpacken";
    9.             mState = State.ERROR;
    10.         } else {
    11.             Debug.Log("Decompress finsihed " + DateTime.Now);
    12.             mState = State.DECOMPRESS_FINISHED;
    13.         }
    14.     }
     
  10. elias_t

    elias_t

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

    I would recommend using a thread to accomplish this.
    The demo script has an example.
     
  11. Brogan89

    Brogan89

    Joined:
    Jul 10, 2014
    Posts:
    244
    Hi there, I'm getting an error in iOS cloud build. The error started after updating to latest version in the asset store.
    The last two error lines in cloud build log are
    but i have no idea what it means. Any help would be appreciated, thanks.
     
  12. elias_t

    elias_t

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

    In the Assets/plugins/ios you will find a bitcode folder.
    Replace the default ios plugin with one of the above folder.
     
  13. Brogan89

    Brogan89

    Joined:
    Jul 10, 2014
    Posts:
    244
    Hi, yes that did work thank you very much. Though I files were in Assets/ADL-Plugins/Plugins/iOS
    I'm having a different error now which im not sure is related or not
     
  14. elias_t

    elias_t

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

    Which xcode version do you use? So I can test here.
     
  15. Brogan89

    Brogan89

    Joined:
    Jul 10, 2014
    Posts:
    244
    We are using cloud build, Xcode Version "Latest Compatible Version". Using Unity 2018.2.5f1.
    Thanks for you help :)
     
  16. Brogan89

    Brogan89

    Joined:
    Jul 10, 2014
    Posts:
    244
    It says in the log its building with Xcode 9.4.1
     
    Last edited: Sep 3, 2018
  17. Brogan89

    Brogan89

    Joined:
    Jul 10, 2014
    Posts:
    244
    I got it work now. I followed this thread https://forum.unity.com/threads/ucb-demos.306687/ to figure out how to add the linker flag to the xcode project.
    More specifically I used this code
    Code (CSharp):
    1.         [PostProcessBuild]
    2.         public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
    3.         {
    4.             if(buildTarget == BuildTarget.iOS)
    5.             {
    6.                 Debug.Log("[UCB Demos] OnPostprocessBuildiOS");
    7.                 string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
    8.  
    9.                 PBXProject proj = new PBXProject();
    10.                 proj.ReadFromString(File.ReadAllText(projPath));
    11.  
    12.                 string target = proj.TargetGuidByName("Unity-iPhone");
    13.  
    14.                 // Set a custom link flag
    15.                 proj.AddBuildProperty(target, "OTHER_LDFLAGS", "-ObjC");
    16.                 proj.AddBuildProperty(target, "OTHER_LDFLAGS", "-lz");
    17.  
    18.                 File.WriteAllText(projPath, proj.WriteToString());
    19.             }
    20.         }
    all is well now. Thanks :)
     
    elias_t likes this.
  18. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    That's good to know!
    Thx for the feedback.
     
    Brogan89 likes this.
  19. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    Hi, can i check if this plugin compresses textures in Unity so they are of a smaller size?
     
  20. elias_t

    elias_t

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

    Usually texture files are already compressed.
    Unless they are in an uncompressed form little extra compression would be achieved.
     
  21. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    We are copying files from user's photo gallery to persistent data, chances are they are not compressed. Will your plugin work in this case?
     
  22. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    In that case yes.
     
  23. UnityDev291

    UnityDev291

    Joined:
    Jul 21, 2014
    Posts:
    9
    Hi, does this support Android ARM64 builds?
     
  24. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    It will. Soon.
     
  25. MaT67

    MaT67

    Joined:
    Sep 21, 2012
    Posts:
    1
    Hi @elias_t we are currently using your great plugin in a WebGL project but we are facing an issue.
    As the decompression seems to be working great, the compression generates an error :
    Code (CSharp):
    1. missing function: _Z18LZ3__compressBoundi UnityLoader.js:235:40
    2.     printErr file:///webgl/Build/UnityLoader.js:235 __Z18LZ3__compressBoundi blob:null/adf09ffe-9a51-49e9-a7a2-8c0c88b216b1:14907 _LZ4CompressBuffer blob:null/d493e171-dd61-4601-8e68-6359413c3b94:2285294 _LZ4_CompressBuffer_m1236384685 blob:null/d493e171-dd61-4601-8e68-6359413c3b94:1649383 _ServerManager_CompressLZ4_m27283313 blob:null/d493e171-dd61-4601-8e68-6359413c3b94:2447027 _ServerManager_UploadSave_m2823290769 blob:null/d493e171-dd61-4601-8e68-6359413c3b94:2128064 _SaveManager_Save_m1936445847
    3. -1 UnityLoader.js:234:37
    4. -1 UnityLoader.js:235:40
    5.     printErr file:///webgl/Build/UnityLoader.js:235 abort blob:null/adf09ffe-9a51-49e9-a7a2-8c0c88b216b1:20919 __Z18LZ3__compressBoundi blob:null/adf09ffe-9a51-49e9-a7a2-8c0c88b216b1:14908 _LZ4CompressBuffer blob:null/d493e171-dd61-4601-8e68-6359413c3b94:2285294 _LZ4_CompressBuffer_m1236384685 blob:null/d493e171-dd61-4601-8e68-6359413c3b94:1649383 _ServerManager_CompressLZ4_m27283313
    6. Invoking error handler due to
    7. uncaught exception: abort(-1) at jsStackTrace (webgl.asm.framework.unityweb:1427:12)
    8. stackTrace (webgl.asm.framework.unityweb:1441:11)
    9. abort (webgl.asm.framework.unityweb:20927:43)
    10. __Z18LZ3__compressBoundi (webgl.asm.framework.unityweb:14908:2)
    11. _LZ4CompressBuffer (webgl.asm.code.unityweb:2285294:1)
    12. _LZ4_CompressBuffer_m1236384685 (webgl.asm.code.unityweb:1649383:1)
    13. _ServerManager_CompressLZ4_m27283313 (webgl.asm.code.unityweb:2447027:1)
    Code (CSharp):
    1. missing function: _Z18LZ3__compressBoundi UnityLoader.js:235:40
    2.     printErr file:///webgl/Build/UnityLoader.js:235 __Z18LZ3__compressBoundi blob:null/adf09ffe-9a51-49e9-a7a2-8c0c88b216b1:14907 _LZ4CompressBuffer blob:null/d493e171-dd61-4601-8e68-6359413c3b94:2285294 _LZ4_CompressBuffer_m1236384685 blob:null/d493e171-dd61-4601-8e68-6359413c3b94:1649383 _ServerManager_CompressLZ4_m27283313 blob:null/d493e171-dd61-4601-8e68-6359413c3b94:2447027 _ServerManager_UploadSave_m2823290769 blob:null/d493e171-dd61-4601-8e68-6359413c3b94:2128064 _SaveManager_Save_m1936445847
    3. -1 UnityLoader.js:234:37
    4. -1 UnityLoader.js:235:40
    5.     printErr file:///webgl/Build/UnityLoader.js:235 abort blob:null/adf09ffe-9a51-49e9-a7a2-8c0c88b216b1:20919 __Z18LZ3__compressBoundi blob:null/adf09ffe-9a51-49e9-a7a2-8c0c88b216b1:14908 _LZ4CompressBuffer blob:null/d493e171-dd61-4601-8e68-6359413c3b94:2285294 _LZ4_CompressBuffer_m1236384685 blob:null/d493e171-dd61-4601-8e68-6359413c3b94:1649383 _ServerManager_CompressLZ4_m27283313
    6. Invoking error handler due to
    7. uncaught exception: abort(-1) at jsStackTrace (webgl.asm.framework.unityweb:1427:12)
    8. stackTrace (webgl.asm.framework.unityweb:1441:11)
    9. abort (webgl.asm.framework.unityweb:20927:43)
    10. __Z18LZ3__compressBoundi (webgl.asm.framework.unityweb:14908:2)
    11. _LZ4CompressBuffer (webgl.asm.code.unityweb:2285294:1)
    12. _LZ4_CompressBuffer_m1236384685 (webgl.asm.code.unityweb:1649383:1)
    13. _ServerManager_CompressLZ4_m27283313 (webgl.asm.code.unityweb:2447027:1)
    Here's the compression code :
    Code (CSharp):
    1. string content = "some content";
    2. byte[] @in = encoding.GetBytes(content);
    3. byte[] @out = new byte[0];
    4. if (LZ4.CompressBuffer(@in, ref @out, 9, true))
    5. {
    6.     content = Convert.ToBase64String(@out);
    7. }
    8. else
    9. { Debug.LogError("Error during compression."); }
    10.  
    11. return content;
    And the decompression code :
    Code (CSharp):
    1. string content = "base64 compressed content";
    2. byte[] @in = new byte[0];
    3. if (DecodeBase64(content, out @in))
    4. {
    5.     byte[] @out = new byte[0];
    6.     if (LZ4.DecompressBuffer(@in, ref @out, true))
    7.     {
    8.         content = encoding.GetString(@out);
    9.     }
    10.     else
    11.     { throw new Exception("Can't decompress."); }
    12. }
    13. return content;
    Do you have any idea where this issue comes from ?
    Thanks a lot.
     
    Last edited: Feb 20, 2019
  26. elias_t

    elias_t

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

    Can you please give me your UnityVersion, OS ?
     
  27. elias_t

    elias_t

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

    - Addded arm64-v8a Android support for all plugins.

    - Removed WSA support for all plugins.

    - Separated the plugin folders for each category.

    - MacOS plugins compiled only for 64 bit now.

    - ZIP: Resolved some il2cpp issues.

    - ZIP: Unicode filenames on decompression should work now on Windows.

    - LZ4/WebGL compress buffer fix.
     
  28. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    ZIP PLUGIN 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
     
  29. elias_t

    elias_t

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

    - ZIP: Added the ability to create split zip archives.

    - ZIP: Fixed an issue with the iOS bitcode enabled plugin.
     
  30. elias_t

    elias_t

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

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

    update version 2.43

    - ZIP: Fixed some preprocessor directives.
     
  31. MrFigment

    MrFigment

    Joined:
    Jan 5, 2017
    Posts:
    27
    Does it works with .NET 4.x?
     
  32. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367

    Hello.

    Yes it does.
     
  33. MrFigment

    MrFigment

    Joined:
    Jan 5, 2017
    Posts:
    27
    Thanks, I'll buy it
     
  34. elias_t

    elias_t

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

    - Android arm64 plugins for brotli, flz, lz4 & 7zip updated to fix a crash when using FileBuffers.
     
  35. DarkSunLcj

    DarkSunLcj

    Joined:
    May 30, 2018
    Posts:
    4
    Hello,I got a LZMA crash on Windows x86 platform build with IL2CPP backend,could you have a test on it?Thank you very much!
     
  36. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.
    Please send me in a private message more info about the crash.
    Was it an lzma alone format file?
    File size.
    Version created etc.
     
  37. DarkSunLcj

    DarkSunLcj

    Joined:
    May 30, 2018
    Posts:
    4
    I just built with the test scene located on ADL-Plugins/SevenZip/testScene in x86 mode, so the 7z file is inside the test project, and when I click start 7z test button, the application would crash.But when I change the Architecture to x86_64, it not crash any more.Unfortunately, our project have to build in x86 mode, so I ask for help at here.If you want, I will send you another 7z file in our project for testing.
     

    Attached Files:

  38. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Ok. I found the issue. (Was an il2cpp thing.) I already sent you a fix.
    Update will follow today.
     
  39. elias_t

    elias_t

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

    - LZMA/Windows x86/Il2cpp: fixed a crash issue.
     
  40. GordonWedge

    GordonWedge

    Joined:
    Jul 6, 2013
    Posts:
    23
    Hi, i've used your plugin since two years without problem, now i've update to the latest version and when i build from xcode (for ios) build failed with this error:

    Code (CSharp):
    1.  
    2. Undefined symbols for architecture arm64:
    3.   "_zipExtractToFile", referenced from:
    4.       _lzip_zipExtractToFile_mECEEEC95AA13F5E96FCF1F813239CDBFF2643254 in Bulk_Assembly-CSharp-firstpass_3.o
    5.      (maybe you meant: _lzip_zipExtractToFile_mECEEEC95AA13F5E96FCF1F813239CDBFF2643254)
    6.   "_fsGetName", referenced from:
    7.       _lzip_fsGetName_mDFBC687FC23A93BFC535A163281D73592EB1397E in Bulk_Assembly-CSharp-firstpass_3.o
    8.       _lzip_fillNameString_m2ACF7CA7AD927BCD809B678055CA9315C375DC92 in Bulk_Assembly-CSharp-firstpass_3.o
    9.      (maybe you meant: _lzip_fsGetName_mDFBC687FC23A93BFC535A163281D73592EB1397E)
    10.   "_zipTotalEntries", referenced from:
    11.       _lzip_zipTotalEntries_m143A166D68F19F0276664BFF23E40EE6F787ED75 in Bulk_Assembly-CSharp-firstpass_3.o
    12.      (maybe you meant: _lzip_zipTotalEntries_m143A166D68F19F0276664BFF23E40EE6F787ED75)
    13.   "_closeZipArchive", referenced from:
    14.       _lzip_closeZipArchive_m3ED817A63F5DA5CE8A65073A73CF8F8546C6B09A in Bulk_Assembly-CSharp-firstpass_3.o
    15.      (maybe you meant: _lzip_closeZipArchive_m3ED817A63F5DA5CE8A65073A73CF8F8546C6B09A)
    16.   "_fsFillSizes", referenced from:
    17.       _lzip_fsFillSizes_m3A6184BEFA517A266475D46B91F229F95031DE98 in Bulk_Assembly-CSharp-firstpass_3.o
    18.       _lzip_fstatFillSizes_mEED9D2B53918D338D76DD2FB244D846A504E422C in Bulk_Assembly-CSharp-firstpass_3.o
    19.      (maybe you meant: _lzip_fsFillSizes_m3A6184BEFA517A266475D46B91F229F95031DE98)
    20.   "_initZipFileStat", referenced from:
    21.       _lzip_initZipFileStat_m30381F7A624C1F9C202128F35B5120FDF87E26F8 in Bulk_Assembly-CSharp-firstpass_3.o
    22.      (maybe you meant: _lzip_initZipFileStat_m30381F7A624C1F9C202128F35B5120FDF87E26F8)
    23.   "_freeZipFileStat", referenced from:
    24.       _lzip_freeZipFileStat_mFAA633D31240B36CDEE1DFE99C61A7512A978CE6 in Bulk_Assembly-CSharp-firstpass_3.o
    25.      (maybe you meant: _lzip_freeZipFileStat_mFAA633D31240B36CDEE1DFE99C61A7512A978CE6)
    26.   "_fsGetComment", referenced from:
    27.       _lzip_fsGetComment_mC22959C70DC55B1AE4A7877459C2ABB6A691717C in Bulk_Assembly-CSharp-firstpass_3.o
    28.       _lzip_fillCommentString_m7EAC465E9B074EC764C23D025A3F762D60F0A22C in Bulk_Assembly-CSharp-firstpass_3.o
    29.      (maybe you meant: _lzip_fsGetComment_mC22959C70DC55B1AE4A7877459C2ABB6A691717C)
    30.   "_zipTotalFiles", referenced from:
    31.       _lzip_zipTotalFiles_m046E9AE567F60324FA9FDD7A00C7E564FB84E704 in Bulk_Assembly-CSharp-firstpass_3.o
    32.      (maybe you meant: _lzip_zipTotalFiles_m046E9AE567F60324FA9FDD7A00C7E564FB84E704)
    33.   "_zipFileStat", referenced from:
    34.       _lzip_zipFileStat_mC83E6920EC3D465D56C538CF5C2A38E0C76127A3 in Bulk_Assembly-CSharp-firstpass_3.o
    35.      (maybe you meant: _lzip_zipFileStat_mC83E6920EC3D465D56C538CF5C2A38E0C76127A3)
    36.   "_zip_Archive", referenced from:
    37.       _lzip_zip_Archive_mAD56C903E923A2BAE5E5765D53D4E62F2EC325E8 in Bulk_Assembly-CSharp-firstpass_3.o
    38.       _lzip_zipArchive_mA764D3E071FC1D81CA9220F0232636D7D065D1CB in Bulk_Assembly-CSharp-firstpass_3.o
    39.      (maybe you meant: _lzip_zip_Archive_mAD56C903E923A2BAE5E5765D53D4E62F2EC325E8)
    40. ld: symbol(s) not found for architecture arm64
    41. clang: error: linker command failed with exit code 1 (use -v to see invocation)
    42.  
    i've added -lz to other link flags but same result.
     
  41. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hello.
    If you have your project bitcode enabled you should replace the plugin with the one in the Plugins/ios/bitcode folder.
     
  42. GordonWedge

    GordonWedge

    Joined:
    Jul 6, 2013
    Posts:
    23
    Thanks for quick reply, i've set enable bitcode to 'no' in xcode, same results.
     
  43. GordonWedge

    GordonWedge

    Joined:
    Jul 6, 2013
    Posts:
    23
    I'm using only 7zip decompression in my app, can i "disable" zip plugin to workaround the problem?
     
  44. elias_t

    elias_t

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

    However I will look into the issue.
     
  45. elias_t

    elias_t

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

    - 7z/lzma: fixed some issues with the windows plugins.
    - ZIP: 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.
     
  46. elias_t

    elias_t

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

    - 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 2.49

    - tvOS plugins were accidentally not provided as bitcode by default.
     
  47. leuconoe

    leuconoe

    Joined:
    Oct 14, 2014
    Posts:
    15
    hello, @elias_t
    I want to decompress split file in StreamingAssets on android.
    What should I do?
    It was used without any problem on iOS but Android does not work.

    Code (CSharp):
    1.  
    2.  
    3.  
    4. // single zip
    5. plog("Validate: " + lzip.validateFile(GetStreamingAssetsPath() + "single.zip").ToString());                   // return -1
    6. zres = lzip.decompress_File(GetStreamingAssetsPath() + "single.zip", ppath + "/", progress, null, progress2); // return -1
    7. // split zip
    8. plog("Validate: " + lzip.validateFile(GetStreamingAssetsPath() + "split.zip").ToString());                   // return -1
    9. zres = lzip.decompress_File(GetStreamingAssetsPath() + "split.zip", ppath + "/", progress, null, progress2); // return -1
    10. // single 7z
    11. zres = lzma.doDecompress7zip(GetStreamingAssetsPath() + "single.7z", ppath + "/", progress, null, progress2);// return -1
    12. // split 7z
    13. zres = lzma.doDecompress7zip(GetStreamingAssetsPath() + "split.7z", ppath + "/", progress, null, progress2);// return -1
    14. // split 7z
    15. zres = lzma.doDecompress7zip(GetStreamingAssetsPath() + "split.7z.001", ppath + "/", progress, null, progress2);// return -1
    16.  
    17. //working but only single file
    18. string filePath = AssetBundleManager.GetStreamingAssetsPath() + "/" + "Packages.zip";
    19.             WWW www = new WWW(filePath);
    20.             yield return www;
    21.             if (www.isDone)
    22.             {
    23.                 if (string.IsNullOrEmpty(www.error))
    24.                 {
    25.                     lzip.decompress_File(null, Util.persistentDataPath, null, www.bytes, null);
    26.                 }
    27.                 else
    28.                 {
    29.                     Debuger.LogError("decompress error : " + www.error);
    30.                 }
    31.             }
     
    Last edited: Sep 25, 2019
  48. elias_t

    elias_t

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

    What you are trying to do is not possible on Android (split files in streaming assets)

    You should use a single zip archive.
     
  49. leuconoe

    leuconoe

    Joined:
    Oct 14, 2014
    Posts:
    15

    Is there another good way?
    Do you plan to apply in the future?
     
  50. elias_t

    elias_t

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

    There is no easy way (if any) to decompress from an array of byte buffers that will work as a split archive on Android.
    However I will put this on my to do list to see if it is possible.