如何发布破解的应用

1,找到以下路径 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS(version number).sdk/SDKSettings.plist 。修改文件中的CODE_SIGNING_REQUIRED的值为NO。跳过使用code provision。(注明version number 为sdk的版本号码)

2,xcode中的code signing identity不使用任何的code signing。

3,下载ldid可执行文件,放在/usr/bin/目录下。下载链接

4,复制一份Release配置,命名为Cydia。

5, xcode中的target 添加run script 。脚本如下

 

 

if [ ${CONFIGURATION}='Cydia' ]; then

echo ${TARGET_BUILD_DIR}/${TARGET_NAME}.app

/usr/bin/ldid -S ${TARGET_BUILD_DIR}/${TARGET_NAME}.app/${TARGET_NAME}

fi

 

Share
Posted in Uncategorized at November 14th, 2011. No Comments.

how to implement a slider switch (with some three20)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#define SliderWidth 116
#define SliderHeight 28

-------------------ScreenCapture.h-------------------

#import
@interface ScreenCapture : NSObject {

}
+(ScreenCapture*)capture;
- (UIImage *)captureView:(UIView *)view;
@end


-------------------ScreenCapture.m-------------------
#import "ScreenCapture.h"
@implementation ScreenCapture

+(ScreenCapture*)capture{
    return [[[ScreenCapture alloc] init] autorelease];
}

- (UIImage *)captureView:(UIView *)view {  
    CGRect screenRect = view.frame;
    UIGraphicsBeginImageContext(screenRect.size);
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    [[UIColor whiteColor] set];
    CGContextFillRect(ctx, screenRect);
    [view.layer renderInContext:ctx];  
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return newImage;
}


-------------------GlobalStyleSheet.h-------------------
#import
#import "extThree20CSSStyle/extThree20CSSStyle.h"

@interface GlobalStyleSheet : TTDefaultCSSStyleSheet {

}
@end


-------------------GlobalStyleSheet.m-------------------
#import "GlobalStyleSheet.h"
#import "Three20Style/UIColorAdditions.h"

 

-(UIImage*)slideSwitchLeftImage{
    TTView *segmentView = [[[TTView alloc] initWithFrame:CGRectMake(0, 0, SliderWidth , SliderHeight)] autorelease];
    UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(10, 0, 80, 20)] autorelease];
    label.text = LocalizedString(@"B", @"B");
    label.textColor = [UIColor redColor];
    [segmentView addSubview:label];
    segmentView.backgroundColor = [UIColor blackColor];
    return [[[ScreenCapture capture] captureView:segmentView] stretchableImageWithLeftCapWidth:1 topCapHeight:0];
}

-(UIImage*)slideSwitchRightImage{
    TTView *segmentView = [[[TTView alloc] initWithFrame:CGRectMake(0, 0, SliderWidth  ,SliderHeight)] autorelease];
    UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(30, 0, 80, 20)] autorelease];
    label.text = LocalizedString(@"A", @"A");
    label.textColor = [UIColor redColor];
    [segmentView addSubview:label];
    segmentView.backgroundColor = [UIColor blueColor];
    return [[[ScreenCapture capture] captureView:segmentView] stretchableImageWithLeftCapWidth:1 topCapHeight:0];
}

-(UIImage*)slideSwitchThumbImage{
    TTView *thumbView = [[[TTView alloc] initWithFrame:CGRectMake(0, 0, SliderHeight, SliderHeight)] autorelease];
    thumbView.backgroundColor = [UIColor redColor];
    return  [[ScreenCapture capture] captureView:thumbView] ;
}

@end

---------------------------------testController.m----------------------

-(void)viewDidLoad{
    [super viewDidLoad];
   
    CGRect frame = CGRectMake(10.0, 50.0, 116, 28);
    CGRect thumb = CGRectMake(0.0, 0.0, 28, 28);
    UISlider *slideSwitch = [[UISlider alloc] initWithFrame:frame];
    [slideSwitch addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventTouchUpInside];
    slideSwitch.backgroundColor = [UIColor clearColor];
    [slideSwitch setThumbImage:TTSTYLEVAR(slideSwitchThumbImage) forState:UIControlStateNormal];
    [slideSwitch setMinimumTrackImage:TTSTYLEVAR(slideSwitchLeftImage) forState:UIControlStateNormal];
    [slideSwitch setMaximumTrackImage:TTSTYLEVAR(slideSwitchRightImage) forState:UIControlStateNormal];
    [slideSwitch thumbRectForBounds: thumb trackRect: frame value: slideSwitch.value];
    slideSwitch.minimumValue = 0.0;
    slideSwitch.maximumValue = 1.0;
    slideSwitch.continuous = YES;
    slideSwitch.value = 0.0;
    [self.view addSubview:slideSwitch];
}
Share
Posted in Uncategorized at July 14th, 2011. No Comments.

NSValue is a wrap

An NSValue object is a simple container for a single C or Objectie-C
data item. It can hold any of the scalar types such as int, float, and
char, as welll as pointers, structures, and object ids. "
– from "Number and Value Programming Topics for Cocoa"

Share
Posted in Uncategorized at June 6th, 2010. No Comments.

iphone 2g 悲剧,android运行可能

David Wong 使用了openiboot成功引导Android系统。在早期就,dev team中的planetbeing就成功将Linux2.6内核引进到苹果平台中的第一二代的iphone和第一代的ipod touch中的,但是还是缺乏一些硬件驱动。

现在david开发了一些驱动程序,使适应iphone缺少部分物理键盘的情况。

此次的对于苹果来说应该说是一场灾难。估计乔布斯见到视频后会抓狂。

Share
Posted in Uncategorized at April 23rd, 2010. No Comments.