How to "fake code sign" your application for Cydia submission

Discussion in 'iOS Development' started by iPhoneSupport, Nov 9, 2009.

  1. iPhoneSupport

    iPhoneSupport Banned

    Joined:
    Nov 8, 2009
    Messages:
    13
    Likes Received:
    0
    Device:
    2G iPod touch
    Hey guys. Today I'm going to show you all how to fake code sign your XCode applications and let you know how to put the application on your device.

    This requires four things to be installed from CYDIA (Search for them)[[MUST BE INSTALLED FROM CYDIA]]
    - ldid (Link Identity Editor)
    - Respring (Or however you prefer respringing your device).
    - OpenSSH
    - GUICache

    First, open a new Finder window and click on "Macintosh HD" or whatever you called your main computer hard-drive.

    Please Register or Log in to view images



    Next, navigate to the path Developer/Platforms/iPhoneOS.platform/Developer/SDKs

    You will see something that looks like this:

    Please Register or Log in to view images



    For this tutorial, we are going to use the iPhoneOS3.0.sdk because the latest SDKs unfortunately do not work. (3.1 and 3.1.2.)

    Go into the iPhoneOS3.0.sdk folder and you will see a few files and folders, including the one we care about most called "SDKSettings.plist."

    Drag "SDKSettings.plist" to your Desktop to edit it because it cannot be modified when it is in the folder "iPhoneOS3.0.sdk."

    Once it is on your Desktop, open it up in TextEdit or whatever text program you want to use.

    In the plist, you will see it says this:

    Code:
    <key>CODE_SIGNING_REQUIRED</key>
    		<string>YES</string>
    Change that string to this:

    Code:
    <key>CODE_SIGNING_REQUIRED</key>
    		<string>NO</string>
    Save the .plist and close out of your text editor. Now, drag the SDKSettings.plist file from your Desktop into the iPhoneOS3.0.sdk folder so that you overwrite it. Finder will ask you to authenticate it, then click on "replace."

    Once you've done that, open up your XCode project for the app you want to build. (restart it if it's already open).

    Please Register or Log in to view images



    Now click on the name of your project so that it is highlighted blue like this:

    Please Register or Log in to view images



    Once you've done that, click on the

    Please Register or Log in to view images

    button.

    Now, in this picture below, change your settings to what is highlighted:

    Please Register or Log in to view images



    After you've done that, build your project by pressing Command "B" on your keyboard. Make sure the project build is "Release"

    In the XCode project, go to the "Products" folder on the sidebar and right click on your application.app. Click on "Reveal in Finder"

    Next, drag your application to the Desktop.

    After that, open up whatever SSH program you use and copy your application to the path "/Applications"

    Now open up Terminal and do the following commands:
    Code:
    ssh root@*IP Address*
    password: alpine
    [B]Example:[/B]ssh root@192.168.1.102
    Now do the following command:

    Code:
    ldid -S /Applications/*Application*.app/*Application name* (no.app)
    [B]Example:[/B] ldid -S /Applications/PasscodeMod.app/PasscodeMod
    Now open up GUICache and click "Rebuild"

    Now go back to Terminal (in your SSH shell) and type:
    Code:
    chmod -R 755 /Applications/*Application*.app
    [B]Example:[/B] chmod -R 755 /Applications/PasscodeMod.app
    Respring your device

    Now your application should be fully functional on your device.

    I hope this tutorial was helpful. If you have any questions or concerns, post them below!

    :]
  2. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    The SDKSettings plist "mod" works on the 3.1.2 SDK.

    Also, you can add a "Run Script" build phase that automatically handles the codesigning and whatever else you need at compile time.
  3. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Why not just open your apps' build settings and tell it not to codesign if you are are planning on pseudo signing? There are no modifications required that way. Also, modifying it to say no could mess up your dev environment, causing it to not sign your apps that you send to Apple unless you manually go into your apps' build settings to put things the way they should be.

    Also, for the record, any code signing will work on device. It doesn't need to be pseudo signed. Just sign it with Xcode how it would usually sign. There's no need for any of this.

    If you insist on using ldid, then why not download the version that exists for OS X and appending a run script (as Axis mentioned) that signs your app with ldid during the build process. You can even have your script scp your application onto your device, removing the need for an external SSH client or SSH via terminal.

    The other issue I have is with your changing permissions. Why? Xcode knows you're making an app. It thus creates an app with the appropriate permissions. There should be no need for that.

    EDIT: And yes, I know. I make a ton of jailbreak apps and dylibs in Xcode.
  4. ukki51

    ukki51 New Member

    Joined:
    Aug 5, 2009
    Messages:
    55
    Likes Received:
    0
    Device:
    iPhone 4 (Black)
  5. clusty

    clusty New Member

    Joined:
    Jan 19, 2008
    Messages:
    1
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    I followed as close as I could the guide, but I hit the following snag:

    When i do the ldid thing i get:

    util/ldid.cpp(567): _assert(0:arch != NULL)

    Any indication what could I be doing wrong?
  6. SatanicBoomBoomHead

    SatanicBoomBoomHead New Member

    Joined:
    Dec 8, 2009
    Messages:
    3
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    I have the same problem

    PLEASE HELP!
  7. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    Run this command before psuedo-signing -

    Code:
    export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
  8. SatanicBoomBoomHead

    SatanicBoomBoomHead New Member

    Joined:
    Dec 8, 2009
    Messages:
    3
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    It worked! Thank so much. You truly are the king of kings!
  9. chronos

    chronos New Member

    Joined:
    Mar 13, 2010
    Messages:
    4
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    @Axis:

    Where do I run that command? On the SSH terminal connected on my iPhone?
  10. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    yes sir.

Share This Page