View Single Post
  #53 (permalink)  
Old 09-02-2008, 06:17 PM
javacom's Avatar
javacom
Status: Offline
Developer
 
Join Date: Mar 2008
Posts: 304
Rep Power: 24
javacom will become famous soon enoughjavacom will become famous soon enough
Thumbs up XCode Template to skip Provisioning Profile to Build & Go SDK application

Someone asked me about how to skip the Provisioning Profile in order to build & go in official sdk applications (not using toolchain headers) as they are not registered developer. As the profile is signed by Apple's WWDC certificate, I think it is difficult to create a fake. But it is rather easy to amend the project template in order to skip the step for the profile.

Here is how

(1) If you have an existing project from the Official Template, you need to change the code-sign identity and add two user-defined
settings in your Project Setting as below



Code:
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Pwned Developer";
                                PROVISIONING_PROFILE_ALLOWED = NO;
                                PROVISIONING_PROFILE_REQUIRED = NO;
There are two instances for this part (one for Debug and another for Release)

(2)
Then amend the Info.plist of your project
and add these
Code:
	<key>SignerIdentity</key>
	<string>Apple iPhone OS Application Signing</string>
Then you can build & go your project with support of debug and setting break point like other registered iPhone developer

To use this method to build & go. You need
(1) Have a fake code sign identity called "iPhone Pwned Developer" in your Mac (if you have not already done so)

Here is the nice guide from Apple to create a self-signed identity
http://developer.apple.com/documenta...section_2.html

(2) You need to patch the MobileInstallation in your iPhone (if you have not already done so)
Here is how to patch the binary in iPhone and create backup first of course (the patch program is for iPhone which I compile from the source and supports 2.0 to 2.0.2)

Code:
wget http://www.cocoatouchdev.com/javacom/mobileinstallation_patch
cp -p /System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation /System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation.backup
chmod +x mobileinstallation_patch
./mobileinstallation_patch
ldid -s /System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation
(3) You don't need to patch SpringBoard, as the changing of Info.plist has done this trick.

I have updated my XCode Template to add a new one called "View-Based Application" which is modified from the original one based on the method stated above.


To install this project template, do this in your Mac
Code:
curl http://cocoatouchdev.com/javacom/ToolChainTemplate_v31.zip  > ToolChainTemplate_v31.zip 
unzip -o ToolChainTemplate_v31.zip -d "/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates"
MD5 (ToolChainTemplate_v31.zip) = b3690c87565786a0c8430bb9a41704fb

To test this new template "View-Based Application"
Create a new project from "View-Based Application" of "Application Pwned" and modified the ViewController file and implement the loadView as below, then Build & Go to your device.

You need to have the "iPhone Pwned Developer" certifcate in your Mac plus patch of MobileInstallation in your iPhone for successful build & go

Code:
- (void)loadView {
	UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
	self.view = contentView;
	[contentView release];
	self.view.autoresizesSubviews = YES;
	CGRect frame = CGRectMake(10.0, 10.0, 250.0, 100.0);
	
	UITextView *textView = [[[UITextView alloc] initWithFrame:frame] autorelease];
	
    textView.textColor = [UIColor blackColor];
    textView.font = [UIFont fontWithName:@"Arial" size:18.0];
    textView.backgroundColor = [UIColor whiteColor];
	
	textView.text = @"This is the time for Developer to port all applications to firmware 2.0";
	
	[self.view addSubview: textView];
	
}
Enjoy and port all your applications to firmware 2.0

<------- Thump up for me, if you like this thread
__________________
Touch Dial is an easy-to-use application for one touch dial / sms icon on the home screen for iPhone.

This app can read the accelerometer and do phone dial or SMS dial for the same number based on the your setting for Portrait or Landscape Mode of iPhone.


Last edited by javacom; 09-21-2008 at 01:07 PM.
Reply With Quote