Jump to content



- - - - -

How to Fake Code Sign Applications in Xcode


7 replies to this topic

#1 kaamaru

    King

  • Founder
  • 18,302 posts
  • iPhone:iPhone 4
  • iPad:iPad

Posted 05 July 2010 - 12:17 PM

Update: If you have Xcode 3.2.3 or higher use this tutorial: http://ihackmyi.com/...ic,24020.0.html

Posted Image



In this tutorial I will show you how to fake code sign applications in Xcode. This dosen't seem to work for all people, i'm not sure if it's because they didn't follow the tutorial correctly or because of some sort of Xcode update. If you are having trouble, restart Xcode and follow the tutorial again or ask for help by commenting on this topic. If you don't understand any of the buttons or menus I'm talking about in Xcode look at my Xcode Project Window Guide.

The plist file...
First of all you have to edit the plist file, to do this navigate to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/. Once in the SDKs folder you should see a bunch of iPhone OS folders.  Choose the iPhone OS that you want to build your application in. For example if you were building your application for an iPhone with OS 3.1.3 you would choose the folder iPhoneOS3.1.3.sdk.

Posted Image

Once in the iPhone OS folder select the SDKSettings.plist and drag it to your desktop. The reason for this is because Apple is trying to stop you editing the file by making it read only. By moving the file to the desktop you make an editable copy of the file. Here is a simple example of what you have to :P.

Posted Image

Once the file has been copied to the desktop double click on the file. If it doesn’t open with Property List Editor right click on the application and click “Open With” and then click “Other…”. Navigate to /Developer/Applications/Utilities/. In the Utilities folder click Property List Editor.

Once the Property List Editor has opened the file, click the little arrow next to Default Properties. Then edit CODE_SIGNING_REQUIRED and change YES to NO.

Posted Image

Save the file and move it back into iPhone OS folder replacing the original file. A popup should appear telling you the file can't be modified. To fix this Click Authenticate.

Posted Image

Then click replace.

Posted Image

Enter your password and click OK.

Posted Image

Operation don’t Code Sign
Before you compile there is one more thing you must do. Open up your project in Xcode and select your project in the Groups & Files list. Then Click the Info Button.

Posted Image

A popup should come up with all the project info. Click the Build tab and scroll down to Code Signing. If you can’t find the Code Signing section make sure Configuration is set to "All Configurations" and make sure your showing "all settings". In the Code Signing section click the arrow next to Code Signing Identity. Change Code Signing Identity and Any iPhone OS Device to “Don’t Code Sign”.

Posted Image

It's building time!
Finally open The Overview pop-up menu and change Active SDK to the iPhone OS you changed earlier to not require code signing. Make sure you choose Device and not simulator and set Active Configuration to release. Click Build and Run and it should build with no errors except for coding errors you’ve made of course.

Posted Image

To get your application, navigate to where your project is saved and open the build folder, then open Release-iphoneos folder and you should find your application. If not, go through this tutorial again or contact me, I will be happy to help :).

Posted Image

Application → iPhone
To put the application on your iPhone your going to need a jailbroken iPhone, iPod touch or iPad as I said earlier. Before we can add the application to your iPhone, you're first going to have to download some packages from Cydia. Launch Cydia and download OpenSSH and Link Identity Editor, which are both on saurik’s repo (http://apt.saurik.com/).

When you have downloaded both packages you will need to download an SSH application. I'll be using Transmit as it has a huge amount of features and a great design. The only problem with Transmit is it's not free. If you don’t want to pay, I recommend Cyberduck.

Download

When you have downloaded an FTP application, you will need to the server name, username, path, password, port and protocol.

To find the server get your device and launch the Settings app. Then go to Wi-Fi and tap the white arrow next to you’re Wi-Fi. When you have done that, select DHCP and then look for your IP Address. For the user name put "root" and for the password put "alpine", unless you have changed it. For path you can put “/” or just leave it blank and for port put 22. The protocol is SSH or SFTP. Make sure you have OpenSSH installed or the following won't work.

Posted Image

Once you have entered all the information press connect and navigate to /private/var/stash/Applications. Copy and paste your application into the Applications folder.

The next thing you need to do is give your application the correct permissions. In transmit right click on your application and click get info. Set the permissions to 775, then click Apply and then Apply to Enclosed Items. If you are using Cyberduck right click on the folder and click info, then click the Permissions tab and in Octal Notation set the permissions to 755 and select the box Apply Changes recursively.
Posted Image

Code Sign...
When you have changed the Application permissions, open the terminal  located in /Applications/Utilities. Make sure Link Identity Editor is  installed on your device or this won’t work! To use the Link Identity Editor we have to SSH into your iPhone via the terminal. For any of you who don't know, the Link Identity Editor is used for Code Signing applications.

To SSH into your device type:

ssh root@‹IP Address›


To find your IP, get your iPhone, iPod touch or iPad and launch the  Settings app. Then go to Wi-Fi and tap the white arrow next to you’re  Wi-Fi. When you have done that, select DHCP and then look for your IP  Address.

For Example

ssh root@192.168.0.103


If it's successful it should make you enter your password. The password is "alpine" unless you have changed it. Keep in mind that no letters or black circles will show up on screen when you enter your password. When you have typed in your password press enter and you should be in the root of your device.

Posted Image

Now you need to navigate to the Applications folder. To do this enter:

cd /private/var/stash/Applications


Posted Image

Now that you're in the Applications folder type "ls" and press enter. This will list all the applications in the Applications folder.

Posted Image

Now Type:

cd ‹application Name›.app


I am going to be using iForum so I will type:

cd iForum.app


Posted Image

Now that you're in the application type:

ldid -s ‹application Name›


For Example, for iForum I would type:

ldid -s iForum


Posted Image

Congratulations!
You're finally done! You application will run and can be submitted to Cydia! To get your application for Cydia submission, just ssh into your iPhone and copy and paste your application out of the Applications folder and on to your desktop. You can submit your application to Cydia here.
-------------------------------------------------------------------------------
You left us T_T.

#2 orobin

  • Members
  • 2 posts

Posted 05 July 2010 - 03:29 PM

Hello,

this tutorial, done from the beginning, doesn't work on my configuration, and failed in the last step.
I used a sample from Apple web site.
this sample compile fine in xcode, and run the the emulator.

on my iphone,
ldid return an error :
ldid -S WeatherMap
codesign_allocate: for architecture armv6 object: WeatherMap malformed object (unknown load command 4)
util/ldid.cpp(582): _assert(0:WEXITSTATUS(status) == 0)

any idea of what is wrong ?

I have tested for os 3.1.2, os4 with the same result.

thanks
Olivier


#3 kaamaru

    King

  • Founder
  • 18,302 posts
  • iPhone:iPhone 4
  • iPad:iPad

Posted 05 July 2010 - 07:09 PM

That's really strange, here are some things you could try.

1. Reinstall ldid and then restart your iPhone and try again.
2. Download Terminal from Cydia then type the following:

apt-get install ldid


and then

ldid -S /Applications/WeatherMap.app/WeatherMap


If that doesn't work try:

ldid -S /private/var/mobile/Applications/WeatherMap.app/WeatherMap


3. chmod your application folder and all it's contents to 755, then try step 2 again.

4. Before your ldid type "su" and then enter your password (the default is alpine). Then try step 2 again.
-------------------------------------------------------------------------------
You left us T_T.

#4 orobin

  • Members
  • 2 posts

Posted 05 July 2010 - 08:24 PM

Hello,

Terminal is not working under ios4.
then, I make all my test in SSH connection.

apt-get is not available since a long time now ( if I remember zell, it have disapeared with 3.1, but I 'm not sure)
I have downloaded Aptitude package in Cydia.

with Aptitude, I didi Aptitude install ldid.

I have tried to reboot, reinstall etc...

really strange.
Olivier


#5 kaamaru

    King

  • Founder
  • 18,302 posts
  • iPhone:iPhone 4
  • iPad:iPad

Posted 05 July 2010 - 09:56 PM

Sorry, I don't have an iPhone ATM. Only an iPad.

The only other things I can think of doing are restoring, downgrading or waiting for someone to figure out what is causing the error. I spent 20 minutes searching the net about your error, but nobody seemed to have a solution.
-------------------------------------------------------------------------------
You left us T_T.

#6 Canadianguy

  • Members
  • 7,670 posts

Posted 07 July 2010 - 12:07 AM

Holy shit!!! I'm soooo confused, what's it do?

#7 kaamaru

    King

  • Founder
  • 18,302 posts
  • iPhone:iPhone 4
  • iPad:iPad

Posted 07 July 2010 - 12:15 AM

It let's you create apps to host on Cydia etc without a developers licence.
-------------------------------------------------------------------------------
You left us T_T.

#8 Hacker

    Member

  • Members
  • 12,267 posts
  • iPhone:iPhone 4S
  • iPod touch:iPod touch 4G, iPod touch 2G, iPod touch 1G
  • iPad:iPad 2
  • Mac:MacBook Pro
  • Apple TV:Apple TV 2G

Posted 08 July 2010 - 04:28 PM

The reason it doesn't work on all apps is that ldid hasn't been updated to iOS 3.2 apps or 4.0 apps so only the (shorter and simpliar technique a used, the fake certificate and changing it from XCODESIGNIPHONE to XCODESIGN (or similar), works for those!)


:D

Developer of : SwipeSelection - CardSwitcher - Emblem - MountainCenter - Check