Page 4 of 15 FirstFirst 1234567891011121314 ... LastLast
Results 31 to 40 of 144
Discuss [XCode Template] for SDK and Open Toolchain API in firmware 2.0 at the iPhone Developer Exchange - Hackint0sh.org; pwnage just came out and managed to solve the codesign and program being "killed" issue. ...
  1. #31
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Default

    pwnage just came out and managed to solve the codesign and program being "killed" issue. will update soon.


  2. #32
    Senior Professional Array

    Join Date
    Mar 2007
    Posts
    147
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    yup just figured this out too, but would be amazing if you could add the CODESIGN_ALLOCATE env setting and ldid -S to a build step in the template. Can't wait!

  3. #33
    Senior Professional Array

    Join Date
    Mar 2007
    Posts
    147
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by Kingstone View Post
    I'm trying to port a 1.1.4 application i've made to 2.0 using your xcode patch/template.
    Well I got it to compile but when I run it, it gets stuck in UIApplicationMain...
    It never reaches appDidFinishLaunching method in my app controller class...
    I'm not sure but could it be because i use .mm for my app controller class? (i use c++ code and other external classes)
    It's weird the whole program compiled fine...
    I am stuck on this too but I can't debug because NSLog does not work inside applicationDidFinishLaunching. It is dieing somewhere in that method but I dont know where. I applicationDidFinishLaunching is working though because I have used it in a basic app and it seems to do the stuff I have written.

    edit: NSLogs go to a the system log and can be viewed with the organiser in xcode.
    Last edited by zebrum; 07-28-2008 at 01:58 AM.

  4. #34
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Default [Xcode Template] for pwned firmware 2.0 and open toolchain

    Here is the update of Xcode Template for pwned firmware 2.0 and open toolchain using the Final SDK.

    (1) If you have not installed the open toolchain header, please refer to the first post (point 2) to install it
    http://www.hackint0sh.org/forum/showthread.php?t=38389

    (2) Installed the Apple's Final iPhone SDK (build 9M2199a) in Mac and with pwned iPhone OS 2.0

    (3) Follow this guide to create a self-signed certificate http://developer.apple.com/documenta...section_2.html

    If you are already registered iPhone Developer, please create the certificate name to something else
    e.g. "iPhone Pwned Developer"

    (4) You should follow this to patch the SpringBoard and MobileInstallation in pwned iPhone OS 2.0 firmware. I have tested this patch using iPhone 1st generation and working fine.

    http://www.246tnt.com/iPhone/#xcode

    But I have made some modifications to the procedure as below, as the self created certificate "iPhone Developer" will ambiguously match with your existing certificate, if you are already iPhone Registered Developer. So I change the certificate name to "iPhone Pwned Developer" for the following procedure and the Xcode template in point 4

    If you have already patched the SpringBoard and MobileInstallation, you don't need to do this again.

    P.S. The springboard patch can be skipped, see here
    http://www.hackint0sh.org/forum/showthread.php?t=47629

    Code:
    #/bin/sh
    #assume your iPhone IP is this, change this if it is not
    export IPHONE_IP=10.0.2.2
    mkdir iphone_tmp
    cd iphone_tmp
    scp root@$IPHONE_IP:/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation .
    scp root@$IPHONE_IP:/System/Library/CoreServices/SpringBoard.app/SpringBoard .
    cp MobileInstallation MobileInstallation.bak
    cp SpringBoard SpringBoard.bak
    curl -O http://www.246tNt.com/iPhone/iphone_binary_patch
    curl -O http://www.246tNt.com/iPhone/SpringBoard.xcent
    chmod +x ./iphone_binary_patch
    ./iphone_binary_patch
    export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
    codesign -s "iPhone Pwned Developer" -f MobileInstallation
    codesign -s "iPhone Pwned Developer" --entitlements SpringBoard.xcent -f SpringBoard
    scp MobileInstallation root@$IPHONE_IP:/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation
    scp SpringBoard root@$IPHONE_IP:/System/Library/CoreServices/SpringBoard.app/SpringBoard
    (4) Download this template and use this command to install in your mac. The installation will go to "Application Pwned" directory of the Project Template. This template already incorporated a shell script build to codesign the binary before installation to iPhone.

    Code:
    curl http://cocoatouchdev.com/javacom/ToolChainTemplate_v3.zip  > ToolChainTemplate_v3.zip 
    unzip -o ToolChainTemplate_v3.zip -d "/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates"
    MD5 (ToolChainTemplate_v3.zip) = fd88fe59395ec530d5fc793cc9c85a1d

    There is currently only one template in this update


    (5) This template supports "Build and Go" to "Device and Release" only, so you have to connect your iPhone to USB cable when "Build and Go". It also supports setting breakpoint and debug iPhone program in Xcode.



    (6) If you rebuild the project using this template, please uninstall any previous build using the Xcode Organizer before "Build and Go" again. This will ensure that Xcode to regenerate the application map. If you uninstall the previous build by simply remove the application icon in iPhone, your subsequent "build and go" would fail.

    If you forgot to uninstall the previous build, your second "Build and Go" would fail as well.




    (7) The source code should be in the "Classes" directory and Resources file like png should be in the "Resources" directory of the Project.

    (8) There is also a Makefile in the project template, so that you can run "make" then "make install" to the /Applications/ directory of iPhone. The Makefile will make use of the Mac OS X Intel binary of ldid (from Saurik) to sign the binary before ssh to iPhone. Please amend the IPHONE_IP in the Makefile to the ip address of your iPhone before "make install"

    (9) If you want to uninstall the previous versions 1 or 2 of this Xcode Template (which was for SDK beta 3). You can do this by
    Code:
    rm -fr "/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates/Open Tool Chain"
    Last edited by javacom; 09-02-2008 at 05:36 AM. Reason: Add : The springboard patch can be skipped
    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.


  5. #35
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Post

    If you want to test version 3 of this Xcode template in your pwned iPhone OS 2.0, you can try this sample toolchain HelloWorld.app

    Code:
    /*
     HelloWorld.app
     main.m
    */
    
    #import <Foundation/Foundation.h>
    #import <UIKit/UIKit.h>
    #import "HelloWorld.h"
    
    int main(int argc, char *argv[]) {
    	int returnCode;
    	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    
    // this is for old toolchain UIApplicationMain
    //	returnCode = UIApplicationMain(argc, argv, [HelloWorld class]);
    
    // use this if you have updated the toolchain headers from http://code.google.com/p/iphone-dev/ after Aug 19, 2008
    	returnCode = UIApplicationMain(argc, argv, @"HelloWorld"), @"HelloWorld");
    	[pool release];
    	return returnCode;
    }

    Code:
    /*
     HelloWorld.app
     HelloWorld.h
    */
    
    #import <Foundation/Foundation.h>
    #import <UIKit/UIKit.h>
    #import <UIKit/UIApplication.h>
    #import <UIKit/UIPushButton.h>
    #import <UIKit/UITableCell.h>
    #import <UIKit/UIImageAndTextTableCell.h>
    
    @interface HelloWorld : UIApplication {
        UIImageAndTextTableCell *pbCell;
        UITableCell *buttonCell;
        UIAlertSheet *alert;
        UIView *mainView;
    }
    - (void) alertEvent:(NSString*)message;
    @end

    Code:
    /*
     HelloWorld.app
     HelloWorld.m
    */
    
    #import <CoreFoundation/CoreFoundation.h>
    #import <Foundation/Foundation.h>
    #import <UIKit/CDStructures.h>
    #import <UIKit/UIPushButton.h>
    #import <UIKit/UIThreePartButton.h>
    #import <UIKit/UINavigationBar.h>
    #import <UIKit/UIWindow.h>
    #import <UIKit/UIView-Hierarchy.h>
    #import <UIKit/UIHardware.h>
    #import <UIKit/UITable.h>
    #import <UIKit/UITableCell.h>
    #import <UIKit/UITableColumn.h>
    #import "HelloWorld.h"
    
    @implementation HelloWorld
    
    - (int) numberOfRowsInTable: (UITable *)table
    {
        return 2;
    }
    
    - (UITableCell *) table: (UITable *)table cellForRow: (int)row column: (int)col
    {
        return row ? buttonCell : pbCell; 
    }
    
    - (UITableCell *) table: (UITable *)table cellForRow: (int)row column: (int)col
    				reusing: (BOOL) reusing
    {
        return pbCell; 
    }
    
    - (void) applicationDidFinishLaunching: (id) unused
    {
        UIWindow *window;
        window = [[UIWindow alloc] initWithContentRect: [UIHardware fullScreenApplicationContentRect]];
    	
        pbCell = [[UIImageAndTextTableCell alloc] init];
        [pbCell setTitle: [NSString stringWithFormat:@"Hello World!"]]; 
    	
        UIPushButton *button = [[UIThreePartButton alloc] initWithTitle:@"Touch Me"];
        buttonCell = [[UITableCell alloc] init];
        [buttonCell addSubview: button];
        [button sizeToFit];
    	
        UITable *table = [[UITable alloc] initWithFrame: CGRectMake(0.0f, 48.0f, 320.0f, 480.0f - 16.0f - 32.0f)];
        UITableColumn *col = [[UITableColumn alloc] initWithTitle: @"HelloApp" identifier: @"hello" width: 320.0f];
    	
        [window orderFront: self];
        [window makeKey:self];
        [window _setHidden: NO];	
    	
        [table addTableColumn: col]; 
        [table setDataSource: self];
        [table setDelegate: self];
        [table reloadData];
    	
        UINavigationBar *nav = [[UINavigationBar alloc] initWithFrame: CGRectMake( 0.0f, 0.0f, 320.0f, 48.0f)];
        [nav showButtonsWithLeftTitle: @"Foo" rightTitle: @"Bar" leftBack: NO];
        [nav setDelegate: self];
        [nav setBarStyle: 0];
    	
        struct CGRect rect = [UIHardware fullScreenApplicationContentRect];
        rect.origin.x = rect.origin.y = 0.0f;
        mainView = [[UIView alloc] initWithFrame: rect];
        [mainView addSubview: nav]; 
        [mainView addSubview: table]; 
    	
        [window setContentView: mainView];
    	
    }
    
    - (void) navigationBar: (UINavigationBar *)navBar buttonClicked: (int)button    {
        switch (button) {
            case 0: //Right button
    			[self alertEvent: @"Hello Bar"];
                break;
            case 1: //Left button
    			[self alertEvent: @"Hello Foo"];
                break;
        }
    }
    
    - (void) alertEvent:(NSString*)message    {
        if (message == nil)
        {
    		alert = [[UIAlertSheet alloc] initWithTitle: @"Hello" buttons: [NSArray arrayWithObjects: @"Yes", @"No", nil]
    								 defaultButtonIndex: 1
    								 delegate: self
    								context: nil];
    		
            [alert setBodyText: @"Hi there?"];
        }
        else
        {
    		alert = [[UIAlertSheet alloc] initWithTitle:  @"Hello" buttons: [NSArray arrayWithObjects: @"OK", nil]
    								defaultButtonIndex: 1
    								delegate: self
    								context: nil];                     
    		
            [alert setBodyText: message];
        }
        [alert popupAlertAnimated:YES];
    }
    
    - (void)alertSheet:(UIAlertSheet*)sheet buttonClicked:(int)button   {
    	[self setApplicationBadge:@"hello"]; 
    	
    	/*
    	 if (button == 1 && [sheet buttonCount] == 2)
    	 {
    	 UIAlertSheet *helloSheet = [ [ UIAlertSheet alloc ] initWithFrame:
    	 CGRectMake(0, 240, 320, 240) ];
    	 [ helloSheet setTitle:@"" ];
    	 [ helloSheet setBodyText: [ NSString stringWithFormat: 
    	 @"Hello to iPhone" ] ];
    	 [ helloSheet addButtonWithTitle:@"OK" ];
    	 [ helloSheet setDelegate: self ];
    	 [ helloSheet presentSheetInView: mainView ];
    	 
    	 }
    	 */
        [alert dismiss];
        [alert release];
    }
    
    
    - (void)dealloc 
    {
    	[super dealloc];
    }
    
    
    @end
    Last edited by javacom; 09-11-2008 at 09:39 AM. Reason: update for new UIApplicationMain


  6. #36
    Senior Professional Array

    Join Date
    Mar 2007
    Posts
    147
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Please can you tell us how to sign with our own dev certificate?

    edit: I'll answer my own question...you can skip the self signed cert and patching stuff above by using your dev cert in the normal way e.g. in project properties change the name to iPhone Developer: Your Name. And then just expand Targets in the Xcode groups&files tree view, expand again and delete the last step which is code sign.

    Once you want to relase your app in Cydia you will need to add the ldid step back in though.
    Last edited by zebrum; 08-01-2008 at 12:39 AM.

  7. #37
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Default

    Quote Originally Posted by zebrum View Post
    Please can you tell us how to sign with our own dev certificate?

    edit: I'll answer my own question...you can skip the self signed cert and patching stuff above by using your dev cert in the normal way e.g. in project properties change the name to iPhone Developer: Your Name. And then just expand Targets in the Xcode groups&files tree view, expand again and delete the last step which is code sign.

    Once you want to relase your app in Cydia you will need to add the ldid step back in though.

    You can just create a fake self-signed certificate called "iPhone Pwned Developer" to sign the app (as described in the steps above). This fake certificate can co-exist with your Apple signed certificate in your KeyChain

  8. #38
    Senior Professional Array

    Join Date
    Oct 2007
    Posts
    119
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    12

    Default

    if I create a new project, and just add

    #import <UIKit/UIDevice.h>

    it will give me the error,
    error: syntax error before 'NSInteger'
    Line Location UIDevice.h:28


    any idea what's the reason?

  9. #39
    Senior Professional Array

    Join Date
    Oct 2007
    Posts
    180
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    17

    Default

    Is it possible to add link flags (-lsqlite3) in template/project ?

    Thanks,
    Rikk

  10. #40
    Advanced Array

    Join Date
    Nov 2007
    Posts
    41
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Do i have to register for the Developer program for this?
    i get a "No provisioned iPhone OS device is connected", when i try Build&Go.

    Thanks.


 

 

LinkBacks (?)

  1. 02-16-2009, 06:37 AM
  2. 01-28-2009, 07:22 AM

Similar Threads

  1. MacNN: Apple working on official magazine template for Xcode?
    By hackint0sh in forum Latest Headlines
    Replies: 0
    Last Post: 03-14-2011, 03:10 PM
  2. [Xcode Problems] About Open Toolchain dev in Xcode
    By satashi in forum iPhone Developer Exchange
    Replies: 2
    Last Post: 02-08-2011, 11:26 AM
  3. Xcode Open Toolchain Application link error?
    By syamooo in forum iPhone Developer Exchange
    Replies: 1
    Last Post: 09-28-2010, 06:59 AM
  4. Development and distribution questions Xcode + template
    By antzee in forum iPhone Developer Exchange
    Replies: 1
    Last Post: 07-07-2009, 09:46 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 03:27 PM.
twitter, follow us!