|
|||||||||
|
|||||||||
|
||||
|
This is the latest update of the Xcode template (version 3.5.2) for iPhone SDK and Open Toolchain API / official SDK API (without cert) in pwned iPhone / iPod Touch firmware 2.0.x / 2.1 / 2.2
This Xcode Template is now updated to version 3.5.2 To install, run these in Mac Terminal (assume you have installed the Xcode in /Developer folder, if not, change it according to your installed directory) Code:
curl -O http://www.iphone.org.hk/attach/42698-ToolChainTemplate_v352.zip unzip -o 42698-ToolChainTemplate_v352.zip -d "/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates" ![]() There are 4 new project templates to build the command line utility for iPhone C++ Tool (.cpp) CoreFoundation Tool (.c) Foundation Tool (.m) Objective C++ Tool (.mm) These 4 command line utility templates used wifi ssh connection to install compiled binary in your iPhone, so you need not connect your iPhone via usb port and MobileInstallation patch is not needed as well. Requirements & Info: (1) Default use Open toolchain headers (2) iPhone and Mac connected to same network (you should change the IPHONE_IP, default is 10.0.2.2 in Project Settings) (3) Open SSH and Link Indenty Editor installed in iPhone (4) Mac's ssh key installed in iPhone (5) Debug / Release build to iPhone folder /private/var/root (no Build & Go) and you should change IPHONE_INSTALL_DIR in the Project Settings (6) Cannot build to Simulator You need to amend the IPHONE_IP and IPHONE_INSTALL_DIR user settings twice, one for Release and another for Debug. If you don't want Open ToolChain headers for these command line tool, just remove the Other CC flags settings in the Project Settings, then it will use the official SDK headers. And you have to remove it twice, one for Release and another one for Debug in Project Settings. If you need Open ToolChain Headers in your Mac do this (assume you have installed the Xcode in /Developer folder, if not, change it according to your installed directory) Code:
$ sudo mkdir -p /Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS2.0.sdk/
$ svn co http://iphone-dev.googlecode.com/svn/branches/include-1.2-sdk
$ cd include-1.2-sdk
$ ./configure --prefix=/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS2.0.sdk/
$ sudo sh install-headers.sh
Xcode Template Version 3.5.2 adds a Static Library Template for iPhone To build the Universary Library for i386 and arm First build it on "Device" "Release" Second build it on "Simulator" "Release" Then the Universary Library binary will be in the project directory To examine the content of the Universary Library binary, run ./otoolprint.sh in the project folder Open Tool Chain Application This template uses open toolchain headers provides a starting point for any application without Interface Builder. Requirements and Info: (1) No Interface Builder (2) Default use open toolchain headers (3) Cannot build to Simulator (4) You need to have pwned iPhone / iPod Touch with patched MobileInstallation (5) You need to have codesign certificate "iPhone Pwned Developer" installed in Mac (6) You need to have XCode SDK Info.plist Setting removed Provisioning Profile requirement View-Based Application This template provides a starting point for an application that uses a single view. It provides a view controller to manage the view, and a nib file that contains the view. Requirements and Info: (1) Default use official iPhone SDK headers (2) You need to have pwned iPhone / iPod Touch with patched MobileInstallation (3) You need to have codesign certificate "iPhone Pwned Developer" installed in Mac (4) You need to have XCode SDK Info.plist Setting removed Provisioning Profile requirement Window-Based Application This template provides a starting point for any application without Interface Builder and provides a minimal iPhone application with a single view, ready for customizing. This is a good starting point for your first application. In the UIView subclass, you can implement methods to draw content on the screen and to respond to touches. In a more full-featured application, you typically add a view controller to handle data and to manage rotation. Requirements and Info: (1) No Interface Builder (2) Default use official iPhone SDK headers (3) You need to have pwned iPhone / iPod Touch with patched MobileInstallation (4) You need to have codesign certificate "iPhone Pwned Developer" installed in Mac (5) You need to have XCode SDK Info.plist Setting removed Provisioning Profile requirement Always reboot iPhone and your Mac after you have changed settings and to troubleshoot FAQ If you have "security policy error" after Build & Go. Do these steps (1) Install a new free app from App Store in iPhone (not sync from iTunes) (2) Launch that newly purchased free app and then close it. (3) Reboot your iPhone (that is power off and on again) (4) Launch the app again that you have Build & Go in Xcode to iPhone. If you need MobileInstallation Patch (updated to support firmware 2.0 to 2.2) see post here http://hackint0sh.org/forum/showpost...3&postcount=14 if you want to know how to remove Provisioning Profile requirement see post #62 below http://www.hackint0sh.org/forum/show...1&postcount=62 if you want to know how to remove Provisioning Profile requirement for iPhone SDK 2.2 (build 9M2621) see post #125 below http://www.hackint0sh.org/forum/show...&postcount=125 If you need instruction to have codesign certfifcate "iPhone Pwned Developer" installed in Mac Here is the nice guide from Apple to create a self-signed identity http://developer.apple.com/documenta...section_2.html If you want to know how to install your Mac's ssh key in iPhone Here it is In order to avoid typing the password using ssh, you can install the ssh public key of your Mac to your iPhone using the following method (a) keygen in Mac terminal and type (if you haven't generated it before) Code:
ssh-keygen -t rsa Code:
ssh root@10.0.2.2 'mkdir -p .ssh' (c) copy mac public key to iPhone, and in Mac Terminal type Code:
cat ~/.ssh/id_rsa.pub | ssh root@10.0.2.2 'cat >> .ssh/authorized_keys' (d) Edit the file /etc/ssh/sshd_config in iPhone change these Code:
#StrictModes yes #PubkeyAuthentication yes #AuthorizedKeysFile .ssh/authorized_keys Code:
StrictModes no PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys <---------- add reputation 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; 12-24-2008 at 05:30 PM. Reason: Update the latest template 3.5.2 and most updated info for firmware 2.2 |
|
||||
|
Below is the old template version 2.1a for iPhone SDK beta 3
----------------------------------------------------------------------------------------------- Assume, you have installed iPhone SDK Beta 3 and have a pwned iPhone and you want to port some 1.1.x applications to firmware 2.0 using the SDK development environment and the open toolchain header You can do this (1) Install iPhone SDK beta 3 from Apple (2) Install the toolchain headers as per instructions from here http://wikee.iphwn.org/howto:using_s...lchain_headers But I have modified it for the Beta 3 SDK path as below Code:
$ sudo mkdir -p /Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS2.0.sdk/
$ svn co http://iphone-dev.googlecode.com/svn/branches/include-1.2-sdk
$ cd include-1.2-sdk
$ ./configure --prefix=/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS2.0.sdk/
$ sudo sh install-headers.sh
The installation instruction for version 2.1 is also revised as below by using the following commands in Mac Terminal Code:
curl http://cocoatouchdev.com/javacom/ToolChainTemplate_v21a.zip > ToolChainTemplate_v21a.zip unzip -o ToolChainTemplate_v21a.zip -d "/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates" (4) 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" ![]() (5) When using SDK framework to build toolchain iPhone App, you will discover that the header files are not updated and some methods will fail in the iPhone OS. But now you can update the header file using class-dump, see post 11 of this thread http://hackint0sh.org/forum/showpost...9&postcount=11 Additional Info When using this template to create new project. The source code and header files should be added to the ./src folder of the new project and the support files like png and wav and xib (interface Builder) files should be put to the ./resources folder There is a Makefile in the new project folder as well, so that you can run make to compile into .app folder and package it into zip file as well. You can then ssh/scp to the iPhone firmware 2.0 beta for testing. There are some restrictions on the Application such as run as "mobile" user for the Apple SDK's build to device release method. Both methods allow you to use the xcode organiser to debug the error message (such as NSLog() message) when running. P.S. This XCode Template was based on the project file and MakeFile from nesapp by NerveGas and modified and extended for the SDK API of iPhone OS 2.0 There are problems when porting the existing 1.1.x applications to firmware 2.0. Some of them are UIKit related, as Apple has changed the API in OS 2.0 The following posts showed some of the UIKit header and API problems and proposed solutions when porting from 1.1.x to 2.0 firmware. The development environment is pwned iPhone OS2.0 (5A240d) and iPhone SDK beta 3 with open toolchain header Xcode Template from this thread Posts Index Post 11 open toolchain header update How to use class-dump for iPhone SDK to update open toolchain header Post 9 HelloToolChain.app setFont setColor methods in UITextLabel and UITextView (and the use of UIFont UIColor methods) Post 10 HelloSlider.app UISlider.h in SDK vs UISliderControl.h in open toolchain API Post 12 HelloTouch.app UIEvent.h, UITouch.h and touch events handling for open toolchain API Post 13 HelloSensor.app UIAccelerometer.h and the accelerometer method for open toolchain API Post 21 another version using official SDK API & Template Post 14 T4Two.app (a ported 2.0 firmware game) Multitouch and property directives in UIView for open toolchain API Post 15 UIShowCase Add a new project template in the Xcode Template and use a local "UIKIt.h" header file to build the sample app UIShowCase (non-Interface Builder Version) from Apple Post 19 tris.app A ported 2.0 firmware game showing the Touch Event Handling in firmware 1.x methods vs. the firmware 2.0 methods Post 22 SimpleTableView A SDK sample app that use interface builder .xib file in Open toolchain, also add a UISearchBar in the UITableView Firmware 2.0 Applications / Sources nesapp from NerveGas (with souce code) Erica Applications for iPhone 2.0 (no source code) Erica Utilities for iPhone 2.0 (no source code) iCountDown (ported to firmware 2.0, with source code and binary) Embark (with binary), this application is very simple so I did not list out the source code, but you can simply get the method calls that it use by running this in Mac Terminal, this is also my shortcut method to study codes from other binary Code:
strings Embark.app/Embark tris.app (a ported 2.0 firmware game) Last edited by javacom; 11-13-2008 at 04:02 PM. Reason: Updated Knowledge Base Index |
|
|||
|
I'm having some trouble with your template. I downloaded it and put it in the location you specified, but when I hit new project it doesn't show up as a project choice in XCode. I get an error that says the project file could not be parsed.
|
| Sponsored links Remove advertisements | |
|
|
|
|
|
||||
|
Helpful post javacom...
THUMBS UP FOR YOU !
__________________
My iPhone Firmware Roadmap OTB 1.1.2 --> 1.1.4 --> 2.0 Beta --> BACK TO 1.1.4 --> 2.0 -> 2.0.1 -> 2.0.2 -> 2.1 -> 2.2 -> 3.0 SIM Unlock - thanks to NextSIM4 My Mac mini 2.0 GHz Dual core, 2GB RAM, 160 GB HDD, Leopard 10.5.8 My MacBook Aluminium Unibody, 2.0 GHz Dual core, 4 GB RAM, 160 GB HDD, Leopard 10.5.8 My Blogs: Jash's Blog: http://www.jashsayani.com The iFone Blog: http://theifoneblog.blogspot.com |
| Sponsored links Remove advertisements | |
|
|
|
|
|
||||
|
There are problems using setFont setColor methods in UITextLabel and UITextView in the sdk compiler and open toolchain headers
Typically the code for setFont and setColor in firmware 1.1.x would be Code:
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
float grayComponents[4] = { 0.3, 0.3, 0.3, 1. };
UITextLabel* label;
[label setFont:[NSClassFromString(@"WebFontCache") createFontWithFamily:@"Helvetica" traits:0 size:17.]];
[label setColor:CGColorCreate(colorSpace, grayComponents)];
Code:
[NSCFType CGColor]: unrecognized selector sent to instance Code:
typedef float CGFloat; #import <UIKit/UIFont.h> #import <UIKit/UIColor.h> These two header files are in here and there are some new methods defined Code:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/Frameworks/UIKit.framework/Headers Code:
firmware 1.1.x code
float grayComponents[4] = { 0.3, 0.3, 0.3, 1. };
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
[label setColor:CGColorCreate(colorSpace, grayComponents)];
firmware 2.0 code method 1 (using CGColor)
float grayComponents[4] = { 0.3, 0.3, 0.3, 1. };
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
[label setColor:[UIColor colorWithCGColor:CGColorCreate(colorSpace, grayComponents)]];
firmware 2.0 code method 2 (using Color Components)
[label setColor:[UIColor colorWithRed:0.3 green:0.3 blue:0.3 alpha:1.0];
The following sample code demonstrates the use of UIFont and UIColor methods and will display the useless "Hello ToolChain" in iPhone OS 2.0 (pwned) if you use the Xcode template of this thread to build There will be warning messages when build and just ignore them. To remove these warnings, the open toolchain headers should be amended. Code:
/*
HelloToolChain.app
main.m
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
// include for the sdk compiler and open toolchain headers
#ifndef UIKIT_UIFont_UIColor_H
#define UIKIT_UIFont_UIColor_H
typedef float CGFloat;
#import <UIKit/UIFont.h>
#import <UIKit/UIColor.h>
#endif
@interface HelloToolChain : UIApplication
{
}
@end
@implementation HelloToolChain
- (void) applicationDidFinishLaunching: (NSNotification *)aNotification
{
UIWindow *window = [[UIWindow alloc] initWithContentRect: [UIHardware fullScreenApplicationContentRect]];
UITextLabel *label = [[UITextLabel alloc] initWithFrame: CGRectMake(0, 100, 320, 50)];
[label setFont:[UIFont fontWithName:@"Marker Felt" size:50]];
[label setCentersHorizontally: YES];
[label setText:@"Hello ToolChain"];
[label setBackgroundColor:[UIColor blackColor]];
[label setColor:[UIColor whiteColor]];
UIView *mainView = [[UIView alloc] initWithFrame: [UIHardware fullScreenApplicationContentRect]];
[mainView addSubview: label];
[mainView becomeFirstResponder];
[window orderFront: self];
[window makeKeyAndVisible];
[window setContentView: mainView];
}
@end
int main(int argc, char *argv[]) {
int returnCode;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
returnCode = UIApplicationMain(argc, argv, [HelloToolChain class]);
[pool release];
return returnCode;
}
Last edited by javacom; 05-20-2008 at 07:20 AM. Reason: code amendment |
| Sponsored links Remove advertisements | |
|
|
|
|
|
||||
|
UISliderControl of Open Toolchain is not available in iPhone OS 2.0 runtime. It should be replaced by UISlider by adding the following header.
Code:
#import <UIKit/UISliderControl.h> @interface UISlider : UISliderControl @property float value; // default 0.0. this value will be pinned to min/max @property float minimumValue; // default 0.0. the current value may change if outside new min value @property float maximumValue; // default 1.0. the current value may change if outside new max value @property(retain) UIImage *minimumValueImage; // default is nil. image that appears to left of control (e.g. speaker off) @property(retain) UIImage *maximumValueImage; // default is nil. image that appears to right of control (e.g. speaker max) @end Code:
/*
HelloSlider.app
main.m
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
// include for the sdk compiler and open toolchain header
#ifndef UIKIT_UIFont_UIColor_H
#define UIKIT_UIFont_UIColor_H
typedef float CGFloat;
#import <UIKit/UIFont.h>
#import <UIKit/UIColor.h>
#endif
#ifndef UIKIT_UISlider_H
#define UIKIT_UISlider_H
#import <UIKit/UISliderControl.h>
@interface UISlider : UISliderControl
@property float value; // default 0.0. this value will be pinned to min/max
@property float minimumValue; // default 0.0. the current value may change if outside new min value
@property float maximumValue; // default 1.0. the current value may change if outside new max value
@property(retain) UIImage *minimumValueImage; // default is nil. image that appears to left of control (e.g. speaker off)
@property(retain) UIImage *maximumValueImage; // default is nil. image that appears to right of control (e.g. speaker max)
@end
#endif
@interface HelloSlider : UIApplication
{
UIWindow *window;
UIImageView *imgView;
UIView *mainView;
UISlider *slider;
}
- (void) handleSlider: (id)unused;
@end
@implementation HelloSlider
- (void) applicationDidFinishLaunching: (NSNotification *)aNotification
{
CGRect rect = [UIHardware fullScreenApplicationContentRect];
rect.origin.x = rect.origin.y = 0.0f;
window = [[UIWindow alloc] initWithContentRect: rect];
mainView = [[UIView alloc] initWithFrame:rect];
imgView = [[UIImageView alloc] initWithImage:[UIImage imageAtPath:@"/System/Library/CoreServices/SpringBoard.app/Activate.png"]];
[imgView setBackgroundColor:[UIColor clearColor]];
[mainView addSubview: imgView ];
[imgView setOrigin:CGPointMake(112,0)];
slider = [[UISlider alloc] initWithFrame:CGRectMake(20, 380, 280, 40)];
[slider setShowValue:NO];
[slider addTarget:self action:@selector(handleSlider:) forEvents:7]; // 7=drag, 2=up
slider.minimumValue = 0.0;
slider.maximumValue = 10.0;
slider.value = 1.0;
[mainView addSubview:slider];
[mainView becomeFirstResponder];
[window setContentView: mainView];
[window orderFront: self];
[window makeKeyAndVisible];
}
- (void) handleSlider: (id)unused
{
if (slider.value == 0.0) {
[mainView setBackgroundColor:[UIColor whiteColor]];
}
else if (slider.value <= 1.0) {
[mainView setBackgroundColor:[UIColor grayColor]];
}
else if (slider.value <= 2.0) {
[mainView setBackgroundColor:[UIColor redColor]];
}
else if (slider.value <= 3.0) {
[mainView setBackgroundColor:[UIColor greenColor]];
}
else if (slider.value <= 4.0) {
[mainView setBackgroundColor:[UIColor blueColor]];
}
else if (slider.value <= 5.0) {
[mainView setBackgroundColor:[UIColor cyanColor]];
}
else if (slider.value <= 6.0) {
[mainView setBackgroundColor:[UIColor yellowColor]];
}
else if (slider.value <= 7.0) {
[mainView setBackgroundColor:[UIColor magentaColor]];
}
else if (slider.value <= 8.0) {
[mainView setBackgroundColor:[UIColor orangeColor]];
}
else if (slider.value <= 9.0) {
[mainView setBackgroundColor:[UIColor purpleColor]];
}
else if (slider.value <= 10.0) {
[mainView setBackgroundColor:[UIColor brownColor]];
}
else {
[mainView setBackgroundColor:[UIColor whiteColor]];
}
}
@end
int main(int argc, char *argv[]) {
int returnCode;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
returnCode = UIApplicationMain(argc, argv, [HelloSlider class]);
[pool release];
return returnCode;
}
Last edited by javacom; 05-09-2008 at 03:13 AM. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|