Open user8547 opened 8 months ago
$ md5sum SM-G970F_5_20230303113410_3xhglg47s4_fac.zip
c4b1969e8b18e89369e2c4985ade54b3 SM-G970F_5_20230303113410_3xhglg47s4_fac.zip
Hey so I am not sure if the problem is with the decryption of the file, but it appears that the header of the zip file has an error in it.
I usually extract these files using 7-Zip on windows and the program has not issue with extracting it, however on Linux using the most common programs (unzip, tar, 7z) all fail to extract it.
But I have found a solution to the issue, you need to fix the archive using the zip program.
Firstly download the program from your repo using the respective package manager:
sudo apt install zip
or sudo pacman install zip
Then run the fix command (this may take up to 10 minutes):
zip -FF inputarchive --out outputarchive
Example Usage:
zip -FF SM-G970F_5_20230303113410_3xhglg47s4_fac.zip --out Firmware.zip
Then you can decompress the newly created archive as usual using unzip:
unzip Firmware.zip
Hope this helps you solve the problem.
$ md5sum SM-G970F_5_20230303113410_3xhglg47s4_fac.zip c4b1969e8b18e89369e2c4985ade54b3 SM-G970F_5_20230303113410_3xhglg47s4_fac.zip
Check if you get the same corrupted zip when using Bifrost.
This project is basically in maintenance only for now (two new libraries soon), so I'm piggybanking off them.
Bitfrost after decryption produced a different zip file which unzips fine:
$ md5sum SM-G970F_5_20230303113410_3xhglg47s4_fac_G970FXXSGHWC1_G970FOXMGHWA3_G970FXXSGHWB3_G970FXXSGHWC1_SEB.zip
abe8b002c6394eefd9d2fab4927e5983 SM-G970F_5_20230303113410_3xhglg47s4_fac_G970FXXSGHWC1_G970FOXMGHWA3_G970FXXSGHWB3_G970FXXSGHWC1_SEB.zip
$ unzip SM-G970F_5_20230303113410_3xhglg47s4_fac_G970FXXSGHWC1_G970FOXMGHWA3_G970FXXSGHWB3_G970FXXSGHWC1_SEB.zip
Archive: SM-G970F_5_20230303113410_3xhglg47s4_fac_G970FXXSGHWC1_G970FOXMGHWA3_G970FXXSGHWB3_G970FXXSGHWC1_SEB.zip
inflating: BL_G970FXXSGHWC1_CL25257816_QB62768393_REV01_user_low_ship.tar.md5
inflating: AP_G970FXXSGHWC1_CL25257816_QB62768393_REV01_user_low_ship_meta_OS12.tar.md5
TheRealMrWicked: Thank you for looking into it! zip -FF
was not able to fix the zip file, but you are correct that 7z on windows is able to decompress that corrupted zip just fine!
Using latest source code as of 2024-01-05, it is not possible to unzip the downloaded and decrypted firmware: