I have a React Native app that needs to decompress a gzip file so that it can access the individual files that are inside the gzip file. Exactly like how it works when you tap on the file in the iOS Files app and it extracts everything into a folder in the same directory. I can read the gzip using RNFS but that is just a stream of the raw data. I need the actual files that have been zipped up.
I could also do this in native Swift but I don't see a way to do it. NSData has a decompress() func but that's also just raw data. It must be possible, any thoughts?
I tried react-native-zip-archive unzip(base64DecodedString, filePath) but it doesn't seem to support gzip.
Here's a way to do it in Swift - you need both Gzip and Light-Swift-Untar Swift packages: