#274 ✓resolved
Michael Perry

ideviceinstaller uses the wrong Info.plist on projects using storyboards

Reported by Michael Perry | June 13th, 2012 @ 12:42 AM

Version: Checked out from http://cgit.sukimashita.com/ideviceinstaller.git, commit b7bec60c948b7fcfa35ff0ccbc986c650dbfc4d4

This problem seems to stem from how zip_name_locate() parses through archives. What was happening was ideviceinstaller would fail to find the CFBundleName when attempting to install an app; it turns out it was parsing the Info.plist embedded in one of our storyboard files, not the one located in the .app file's root.

My fix was to construct the exact path for the Info.plist file and pass it to the call to zip_f_get_contents() at line 542, as well as to remove the flag from the third parameter. See the modified source (attached) for clarification.

Before:

if (zip_f_get_contents(zf, "Info.plist", ZIP_FL_NODIR, &zbuf, &len) < 0) {

After:

char plistLocation[256];
strcpy(plistLocation, zip_get_name(zf, 0, 0));
strcpy(plistLocation, zip_get_name(zf, 1, 0));
strcat(plistLocation, "Info.plist");
if (zip_f_get_contents(zf, plistLocation, 0, &zbuf, &len) < 0) {

Comments and changes to this ticket

  • Martin S.

    Martin S. July 11th, 2012 @ 11:09 AM

    • State changed from “new” to “open”
    • Tag set to ideviceinstaller, libzip
    • Assigned user set to “Martin S.”

    I think the fix is to actually replace the ZIP_FL_NODIR flag with 0. That way it should look for the Info.plist in the ZIP root instead of using the first file that matches.

    Could you verify if that fixes it for you?

  • Michael Perry

    Michael Perry July 11th, 2012 @ 08:07 PM

    That doesn't work; I'm getting 'ERROR: could not locate Info.plist in archive!'. My guess is because the Info.plist file isn't actually in the ZIP root, it's in the APP root. The file structure of a .ipa file looks like this:

    App_Name.ipa (this is the ZIP)/Payload/App_Name.app/Info.plist

    That's why I specify the exact location of the file as well as replace ZIP_FL_NODIR with 0 in my solution; you need to traverse multiple directories to get at the file. I'm sure there's a more elegant solution... but that's up to you. :)

  • Martin S.

    Martin S. July 13th, 2012 @ 04:42 PM

    Yeah, did not think far enough, you are right.

    We'll need to add support for IPCC files next to IPA here aswell, so this section should see a rewrite anyways.

  • Martin S.

    Martin S. August 24th, 2012 @ 10:22 PM

    • State changed from “open” to “resolved”

    Should be fixed with this commit:
    http://cgit.sukimashita.com/ideviceinstaller.git/commit/?id=60cf678...

    Thanks for reporting.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A project around supporting the iPhone in Linux.

See http://libimobiledevice.org

People watching this ticket

Attachments

Pages