Can the user take the resource from the iPhone App

2019-05-22 08:37发布

问题:

I know that the Apple Mac OS .app file is a collection of programs and data. I guest the iPhone is similar in this way. I can unzip a Mac OS .app to find the resource , images using this way. Can the iPhone App do the similar thing? I mean, can the user unzip the iPhone .app to get the resource/ img from that? thz.

回答1:

Yes. They are definitely viewable, with a little extra effort.

Unzipping the ".ipa" file gets you all the .png and .nib resources. The .png files are encoded using a non-standard format (described here) so you can't open them directly, but that same page also points to a tool to convert them to standard .png files.

The .nib files are more problematic, as described in this question:

Technically it is possible to instantiated a nib and introspect much of the information out of it, but it is non-trivial and wouldn't result in anything like using Interface builder

Note that signatures don't have anything to do with this: the application signature will detect if any of the resources have changed, but the signature is not the reason the resources are not (conveniently) openable: signing the application doesn't change the format of the underlying resources.

Apple presumably chose these formats to optimize load time - making it convenient to pull images out of someone else's app was probably not a design goal :-)



回答2:

The .ipa file can be unzipped, and resources viewed, but as they are signed, it won't work if you change anything. However, PNGs are encoded in a different way and nibs are compiled, so they aren't viewable with normal tools.



回答3:

All resources are signed, which makes them non-viewable to the casual user when the app is unzipped.

However, I wouldn't be at all surprised if that was easily removable.