Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

ideviceinstaller uses the wrong Info.plist on projects using storyboards

#274

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) {

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

State: resolved
Milestone: none
Assigned to: Martin S. Martin S.

Activity

  1. Martin S.
    Martin S.
    • 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?

    July 11th, 2012 @ 11:09 AM

  2. Michael Perry
    Michael Perry

    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. :)

    July 11th, 2012 @ 08:07 PM

  3. Martin S.
    Martin S.

    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.

    July 13th, 2012 @ 04:42 PM

  4. Martin S.
    Martin S.
    • State changed from open to resolved

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

    Thanks for reporting.

    August 24th, 2012 @ 10:22 PM

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.