javaandroidlinuxunzipunrar

Split two files


I have combined two files in android, using this Linux command

cat file1.png file2.zip > file3.png

How can I split two files again?I just want the zip file to be retrieved separately.

Is there any specific command?I've tried these codes:

unzip file3.png

Replaced png with zip:

unzip file3.zip

but none of them work. The only application with which I can open the combination, is winrar on windows

And also I tried several unzipping and unraring apps on android but none of them work except RAR app by rarlab

Is there any source for those apps I mentioned to unrar/unzip the file?


Solution

  • Strictly speaking : there's no way.

    You might look for the PK 0x04 0x03 as a separator in the answer above, but you don't have any guaranty that this char sequence does not show up in the image data of the file1.png as well.

    All together it's a funny question. If you want to split files like this on a regular basis rethink your strategy. If you need it to correct a one time mistake or something, you can split finding the seperator and be ok in over 99% of the cases.