Android icon indicating copy to clipboard operation
Android copied to clipboard

Support split zip files in importer (fixes Stocard import)

Open TheLastProject opened this issue 10 months ago • 2 comments

Just got an email, it seems Stocard started to split their ZIP files into a main .zip and a .z01 file. Frustrating, that's not the first export change the last year, almost starting to think they're doing this just to spite me :D

It seems that zip4j has support for merging split files using the mergeSplitFiles function, but the documentation is a bit limited: https://github.com/srikanth-lingala/zip4j?tab=readme-ov-file#merging-split-zip-files-into-a-single-zip

It's also not sure how to allow importing this. It seems impossible to import this when tapping a .zip file, so this should probably throw an error and nudge users towards selecting all splits in their file manager.

Marking this as "bug" because it breaks the Stocard importer. Again.

TheLastProject avatar Jan 13 '25 18:01 TheLastProject

For anyone who runs into this issue: I currently don't have any affected exports I've been given an OK to share with other devs who could perhaps help with this and I don't have time to look into this currently myself.

TheLastProject avatar Feb 05 '25 11:02 TheLastProject

It seems zip4j may already be detecting the missing .z01 file and can support it without much code changes, if we just keep asking for more files when the import fails with a FileNotFoundException:

Image

From discussions on Matrix it seems like they also changed the structure again and extracts may no longer be the top level directory. It would be good to make the directory searching more flexible, so that Catima automatically finds the directory with the cards and providers: https://github.com/CatimaLoyalty/Android/blob/e1cfb15a8b296c4d0acf1f1249e9ca71d9f9a2a5/app/src/main/java/protect/card_locker/importexport/StocardImporter.java#L166-L208

TheLastProject avatar May 01 '25 19:05 TheLastProject