majd / ipatool

Command-line tool that allows searching and downloading app packages (known as ipa files) from the iOS App Store
MIT License
5.34k stars 466 forks source link

Mac AppStore support #211

Open Siguza opened 1 year ago

Siguza commented 1 year ago

Description

Any idea what it would take to support the Mac AppStore?

My primary use case for this is trying to obtain clean IPA copies of the installers for macOS 10.14 and 10.15.

davipt commented 1 year ago

Apologies for the off-topic, but this may help you and others.

You can go to https://support.apple.com/en-us/HT211683 and click on the link for each operating system you want to “backup”. You’ll need a Mac that supports the operating system you want. For example, I had to use a Mac mini Intel to download the OS versions released before the M1 Macs. The links will open the Mac App Store, where you can hit install (or download). Once the package is downloaded, it will say your Mac is not compatible because you’ll be running a later macOS, and the system doesn’t want to downgrade. Make a copy of the package from /Applications (or just the InstallESD.dmg). Now the issue is that the InstallESD.dmg will be system locked and impossible to be removed, even as the root user, so to delete them you’ll need to restart in recovery mode, open the terminal, run “csrutil disable”, remove the files with an “rm -fr”, run “csrutil enable” (just in case), and then restart back into normal mode.

This doesn’t invalidate that it would be nice if the IPATool could download any app type. It is our (the community) job to help figure out the right parameters to use, as it’s easy to figure out the parameters for the mobile apps, via Apple Configurator, but much harder to understand what kind of calls the Mac App Store app is doing underneath the encryption layer.

Siguza commented 1 year ago

I'm well aware of that page, but that is unfortunately inadequate. The requirement of having a compatible Mac is already a big limitation, but backing up the installed app from the file system is just not possible in a clean way.

Also you don't need recovery to get rid of it. Just move to /tmp and reboot.

bruno-rodrigues-bitsight commented 1 year ago

You are correct. I had to use a Mac mini M1, an Intel, and even a 2011 Intel stuck at High Sierra 10.13 to retrieve all available versions.

Moving to /tmp used to work, but maybe something changed on Sonoma as the files were moved into /var/dirs_cleaner/ and never disappeared, even after many reboots.

majd commented 11 months ago

I am not sure if that would be possible through the API currently being used by ipatool. The current API originates from an older version of Apple Configurator which was used to install the apps owned by the Apple ID, onto the connected iOS device. mas-cli/mas is closer to what you're looking for but I'm not sure if you're able to obtain the installer package through that tool.

Siguza commented 11 months ago

Hm, I see. The linked project seems to just be using host frameworks to call into the same code as the App Store, and not talk to the API directly. Honestly, I was just hoping that the MAS API would be a mere URL change away or something, or that someone might have looked into this before.