seemoo-lab / opendrop

An open Apple AirDrop implementation written in Python
https://owlink.org
GNU General Public License v3.0
8.48k stars 265 forks source link

cpio/AppleDouble issue on Linux #74

Open scintill opened 2 years ago

scintill commented 2 years ago

I haven't narrowed down exactly what's going on. I tried to AirDrop two photos from iOS to Linux, with "All Photo data" (or something like that) enabled in iOS. I got two subdirectories, like:

./D133E878-0B6A-4D1B-A4EF-D6A9AB509FB9/._IMG_0767.HEIC
./D133E878-0B6A-4D1B-A4EF-D6A9AB509FB9/IMG_0767.HEIC
./9103465E-D5B9-489B-9113-F1742E2A0C6C/IMG_0768.HEIC
./9103465E-D5B9-489B-9113-F1742E2A0C6C/._IMG_0768.HEIC

Both the dot-prefixed and regular .HEIC file in each are actually AppleDouble encoded Macintosh file as reported by file. The contents are identical. I guess it's an issue with libarchive wrongly selecting the metadata and saving two copies.

I was able to get the real file by hacking opendrop's code to save the cpio archive itself and extracting with the cpio command, but maybe that's a fluke.

I will probably look into this more, but if anyone else knows something, please let us know.

Sn0wfreezeDev commented 2 years ago

Hi @scintill, I never saw such an issue, but you might be on the right track. Initially I would have expected that the iPhone shares the files as JPGs. I know that in the /Discover or /Ask the receiving device is able to state if it supports HEIC and if not I'd guess it should receive JPG files.

scintill commented 2 years ago

I actually want the original HEIC files. I don’t know if the metadata file issue is related to HEIC. Maybe so, if others haven’t seen it yet.