From: Jay Freeman (saurik) Date: Sat, 2 Aug 2008 15:22:48 +0000 (+0000) Subject: Uploading source code of the first release. X-Git-Tag: v0.9.3900~92 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/62b2dbad6360951766f085f50ce8d19c80756395 Uploading source code of the first release. --- diff --git a/Application.mm b/Application.mm new file mode 100644 index 0000000..2e129d7 --- /dev/null +++ b/Application.mm @@ -0,0 +1,114 @@ +/* WinterBoard - Theme Manager for the iPhone + * Copyright (C) 2008 Jay Freeman (saurik) +*/ + +/* + * Redistribution and use in source and binary + * forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the + * above copyright notice, this list of conditions + * and the following disclaimer. + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions + * and the following disclaimer in the documentation + * and/or other materials provided with the + * distribution. + * 3. The name of the author may not be used to endorse + * or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#import +#import +#import + +#define _trace() NSLog(@"_trace(%u)", __LINE__); + +@interface WBApplication : UIApplication < + UITableViewDataSource, + UITableViewDelegate +> { + UIWindow *window_; + UITableView *themesTable_; + NSArray *themesArray_; +} + +@end + +@implementation WBApplication + +- (void) dealloc { + [window_ release]; + [themesTable_ release]; + [themesArray_ release]; + [super dealloc]; +} + +- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero] autorelease]; + cell.text = [themesArray_ objectAtIndex:[indexPath row]]; + return cell; +} + +- (NSInteger) tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section { + return [themesArray_ count]; +} + +- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + NSString *theme = [themesArray_ objectAtIndex:[indexPath row]]; + + [[NSDictionary dictionaryWithObjectsAndKeys: + theme, @"Theme", + nil] writeToFile:[NSString stringWithFormat:@"%@/Library/Preferences/com.saurik.WinterBoard.plist", + NSHomeDirectory() + ] atomically:YES]; + + if (fork() == 0) { + execlp("killall", "killall", "SpringBoard", NULL); + exit(0); + } +} + +- (void) applicationDidFinishLaunching:(id)unused { + window_ = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].applicationFrame]; + [window_ makeKeyAndVisible]; + + NSFileManager *manager = [NSFileManager defaultManager]; + themesArray_ = [[manager contentsOfDirectoryAtPath:@"/Library/Themes" error:nil] retain]; + + themesTable_ = [[UITableView alloc] initWithFrame:window_.bounds]; + [window_ addSubview:themesTable_]; + + [themesTable_ setDataSource:self]; + [themesTable_ setDelegate:self]; + + [themesTable_ setSeparatorStyle:UITableViewCellSeparatorStyleSingleLine]; +} + +@end + +int main(int argc, char *argv[]) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + int value = UIApplicationMain(argc, argv, @"WBApplication", @"WBApplication"); + + [pool release]; + return value; +} diff --git a/Dock.png b/Dock.png new file mode 100644 index 0000000..4904b93 Binary files /dev/null and b/Dock.png differ diff --git a/Info.plist b/Info.plist index 3a0b6ea..ae9157f 100644 --- a/Info.plist +++ b/Info.plist @@ -19,7 +19,10 @@ WinterBoard CFBundlePackageType - BNDL + APPL + + CFBundleShortVersionString + 0.9 CFBundleSignature ???? @@ -27,8 +30,8 @@ CFBundleVersion 0.9 - NSPrincipalClass - WinterBoard + SBUsesNetwork + 3 diff --git a/Library.mm b/Library.mm new file mode 100644 index 0000000..992563c --- /dev/null +++ b/Library.mm @@ -0,0 +1,219 @@ +/* WinterBoard - Theme Manager for the iPhone + * Copyright (C) 2008 Jay Freeman (saurik) +*/ + +/* + * Redistribution and use in source and binary + * forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the + * above copyright notice, this list of conditions + * and the following disclaimer. + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions + * and the following disclaimer in the documentation + * and/or other materials provided with the + * distribution. + * 3. The name of the author may not be used to endorse + * or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#define _trace() NSLog(@"_trace(%u)", __LINE__); + +#include +#include + +#import + +#import +#import +#import + +#import +#import +#import + +#import +#import +#import +#import +#import + +#import + +/* WinterBoard Backend {{{ */ +#define WBPrefix "wb_" + +void WBInject(const char *classname, const char *oldname, IMP newimp, const char *type) { + Class _class = objc_getClass(classname); + if (_class == nil) + return; + if (!class_addMethod(_class, sel_registerName(oldname), newimp, type)) + NSLog(@"WB: failed to inject [%s %s]", classname, oldname); +} + +void WBRename(const char *classname, const char *oldname, IMP newimp) { + Class _class = objc_getClass(classname); + if (_class == nil) + return; + size_t namelen = strlen(oldname); + char newname[sizeof(WBPrefix) + namelen]; + memcpy(newname, WBPrefix, sizeof(WBPrefix) - 1); + memcpy(newname + sizeof(WBPrefix) - 1, oldname, namelen + 1); + Method method = class_getInstanceMethod(_class, sel_getUid(oldname)); + if (method == nil) + return; + const char *type = method_getTypeEncoding(method); + if (!class_addMethod(_class, sel_registerName(newname), method_getImplementation(method), type)) + NSLog(@"WB: failed to rename [%s %s]", classname, oldname); + unsigned int count; + Method *methods = class_copyMethodList(_class, &count); + for (unsigned int index(0); index != count; ++index) + if (methods[index] == method) + goto found; + if (newimp != NULL) + if (!class_addMethod(_class, sel_getUid(oldname), newimp, type)) + NSLog(@"WB: failed to rename [%s %s]", classname, oldname); + goto done; + found: + if (newimp != NULL) + method_setImplementation(method, newimp); + done: + free(methods); +} + +static NSString *Dylib_ = @"/Applications/WinterBoard.app/WinterBoard.dylib"; +/* }}} */ + +@protocol WinterBoard +- (NSString *) wb_pathForIcon; +- (NSString *) wb_pathForResource:(NSString *)resource ofType:(NSString *)type; +- (id) wb_initWithSize:(CGSize)size; +- (id) wb_initWithFrame:(CGRect)frame; +- (void) wb_setFrame:(CGRect)frame; +- (void) wb_setBackgroundColor:(id)color; +- (void) wb_setAlpha:(float)value; +- (void) wb_addSubview:(UIView *)addSubview; +@end + +NSString *Themes_ = @"/Library/Themes"; +NSString *theme_; +NSString *Wallpaper_; + +NSString *SBApplication$pathForIcon(SBApplication *self, SEL sel) { + if (theme_ != nil) { + NSFileManager *manager([NSFileManager defaultManager]); + + #define testForIcon(Name) \ + if (NSString *name = Name) { \ + NSString *path = [NSString stringWithFormat:@"%@/%@/Icons/%@.png", Themes_, theme_, name]; \ + if ([manager fileExistsAtPath:path]) \ + return path; \ + } + + testForIcon([self displayName]); + testForIcon([self bundleIdentifier]); + } + + return [self wb_pathForIcon]; +} + +NSString *NSBundle$pathForResource$ofType$(NSBundle *self, SEL sel, NSString *resource, NSString *type) { + if (theme_ != nil && [resource isEqualToString:@"SBDockBG"] && [type isEqualToString:@"png"]) { + NSFileManager *manager([NSFileManager defaultManager]); + NSString *path = [NSString stringWithFormat:@"%@/%@/Dock.png", Themes_, theme_]; + if ([manager fileExistsAtPath:path]) + return path; + } + + return [self wb_pathForResource:resource ofType:type]; +} + +void SBAppWindow$setBackgroundColor$(SBAppWindow *self, SEL sel, UIColor *color) { + if (Wallpaper_ != nil) + return [self wb_setBackgroundColor:[UIColor clearColor]]; + return [self wb_setBackgroundColor:color]; +} + +/*id SBButtonBar$initWithFrame$(SBButtonBar *self, SEL sel, CGRect frame) { + self = [self wb_initWithFrame:frame]; + if (self == nil) + return nil; + if (Wallpaper_ != nil) + [self setBackgroundColor:[UIColor clearColor]]; + return self; +}*/ + +id SBContentLayer$initWithSize$(SBContentLayer *self, SEL sel, CGSize size) { + self = [self wb_initWithSize:size]; + if (self == nil) + return nil; + + if (Wallpaper_ != nil) + if (UIImage *image = [[UIImage alloc] initWithContentsOfFile:Wallpaper_]) + [self addSubview:[[[UIImageView alloc] initWithImage:image] autorelease]]; + + return self; +} + +extern "C" void WBInitialize() { + /* WinterBoard FrontEnd {{{ */ + if (NSClassFromString(@"SpringBoard") == nil) + return; + NSLog(@"WB: installing WinterBoard..."); + + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + char *dil = getenv("DYLD_INSERT_LIBRARIES"); + if (dil == NULL) + NSLog(@"WB: DYLD_INSERT_LIBRARIES is unset?"); + else { + NSArray *dylibs = [[NSString stringWithUTF8String:dil] componentsSeparatedByString:@":"]; + int index = [dylibs indexOfObject:Dylib_]; + if (index == INT_MAX) + NSLog(@"WB: dylib not in DYLD_INSERT_LIBRARIES?"); + else if ([dylibs count] == 1) + unsetenv("DYLD_INSERT_LIBRARIES"); + else { + NSMutableArray *value = [[NSMutableArray alloc] init]; + [value setArray:dylibs]; + [value removeObjectAtIndex:index]; + setenv("DYLD_INSERT_LIBRARIES", [[value componentsJoinedByString:@":"] UTF8String], !0); + } + } + /* }}} */ + + WBRename("SBApplication", "pathForIcon", (IMP) &SBApplication$pathForIcon); + WBRename("NSBundle", "pathForResource:ofType:", (IMP) &NSBundle$pathForResource$ofType$); + WBRename("SBAppWindow", "setBackgroundColor:", (IMP) &SBAppWindow$setBackgroundColor$); + WBRename("SBContentLayer", "initWithSize:", (IMP) &SBContentLayer$initWithSize$); + + if (NSDictionary *settings = [[NSDictionary alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/Library/Preferences/com.saurik.WinterBoard.plist", NSHomeDirectory()]]) { + [settings autorelease]; + theme_ = [[settings objectForKey:@"Theme"] retain]; + + NSFileManager *manager([NSFileManager defaultManager]); + NSString *path = [NSString stringWithFormat:@"%@/%@/Wallpaper.png", Themes_, theme_]; + if ([manager fileExistsAtPath:path]) + Wallpaper_ = [path retain]; + } + + [pool release]; +} diff --git a/Test.sh b/Test.sh new file mode 100755 index 0000000..e8e48d9 --- /dev/null +++ b/Test.sh @@ -0,0 +1,5 @@ +#!/bin/bash +rm -f WinterBoard.dylib +set -e +rsync -SPaz 'saurik@carrier.saurik.com:menes/winterboard/WinterBoard{,.dylib}' . +#killall SpringBoard diff --git a/Wallpaper.png b/Wallpaper.png new file mode 100644 index 0000000..685b952 Binary files /dev/null and b/Wallpaper.png differ diff --git a/WinterBoard.mm b/WinterBoard.mm deleted file mode 100644 index 131624c..0000000 --- a/WinterBoard.mm +++ /dev/null @@ -1,188 +0,0 @@ -/* WinterBoard - Theme Manager for the iPhone - * Copyright (C) 2008 Jay Freeman (saurik) -*/ - -/* - * Redistribution and use in source and binary - * forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the - * above copyright notice, this list of conditions - * and the following disclaimer. - * 2. Redistributions in binary form must reproduce the - * above copyright notice, this list of conditions - * and the following disclaimer in the documentation - * and/or other materials provided with the - * distribution. - * 3. The name of the author may not be used to endorse - * or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include - -#import - -#import -#import -#import -#import - -#import -#import -#import -#import - -#import - -/* WinterBoard Backend {{{ */ -#define WBPrefix "wb_" - -void WBInject(const char *classname, const char *oldname, IMP newimp, const char *type) { - Class _class = objc_getClass(classname); - if (_class == nil) - return; - if (!class_addMethod(_class, sel_registerName(oldname), newimp, type)) - NSLog(@"WB: failed to inject [%s %s]", classname, oldname); -} - -void WBRename(const char *classname, const char *oldname, IMP newimp) { - Class _class = objc_getClass(classname); - if (_class == nil) - return; - size_t namelen = strlen(oldname); - char newname[sizeof(WBPrefix) + namelen]; - memcpy(newname, WBPrefix, sizeof(WBPrefix) - 1); - memcpy(newname + sizeof(WBPrefix) - 1, oldname, namelen + 1); - Method method = class_getInstanceMethod(_class, sel_getUid(oldname)); - if (method == nil) - return; - const char *type = method_getTypeEncoding(method); - if (!class_addMethod(_class, sel_registerName(newname), method_getImplementation(method), type)) - NSLog(@"WB: failed to rename [%s %s]", classname, oldname); - unsigned int count; - Method *methods = class_copyMethodList(_class, &count); - for (unsigned int index(0); index != count; ++index) - if (methods[index] == method) - goto found; - if (newimp != NULL) - if (!class_addMethod(_class, sel_getUid(oldname), newimp, type)) - NSLog(@"WB: failed to rename [%s %s]", classname, oldname); - goto done; - found: - if (newimp != NULL) - method_setImplementation(method, newimp); - done: - free(methods); -} - -static NSString *Dylib_ = @"/System/Library/PrivateFrameworks/WinterBoard.framework/WinterBoard.dylib"; -/* }}} */ - -@protocol WinterBoard -- (NSString *) wb_pathForIcon; -- (NSString *) wb_pathForResource:(NSString *)resource ofType:(NSString *)type; -- (id) wb_initWithSize:(CGSize)size; -- (void) wb_setBackgroundColor:(id)color; -@end - -NSString *Themes_ = @"/System/Library/Themes"; -NSString *theme_ = @"Litho"; - -NSString *SBApplication$pathForIcon(SBApplication *self, SEL sel) { - NSFileManager *manager([NSFileManager defaultManager]); - NSString *path; - path = [NSString stringWithFormat:@"%@/%@/Icons/%@.png", Themes_, theme_, [self displayName]]; - if ([manager fileExistsAtPath:path]) - return path; - path = [NSString stringWithFormat:@"%@/%@/Icons/%@.png", Themes_, theme_, [self bundleIdentifier]]; - if ([manager fileExistsAtPath:path]) - return path; - return [self wb_pathForIcon]; -} - -NSString *NSBundle$pathForResource$ofType$(NSBundle *self, SEL sel, NSString *resource, NSString *type) { - if ([resource isEqualToString:@"SBDockBG"] && [type isEqualToString:@"png"]) { - NSFileManager *manager([NSFileManager defaultManager]); - NSString *path = [NSString stringWithFormat:@"%@/%@/Dock.png", Themes_, theme_]; - if ([manager fileExistsAtPath:path]) - return path; - } - - return [self wb_pathForResource:resource ofType:type]; -} - -void SBAppWindow$setBackgroundColor$(SBAppWindow *self, SEL sel, id color) { - [self wb_setBackgroundColor:[UIColor clearColor]]; -} - -id SBContentLayer$initWithSize$(SBContentLayer *self, SEL sel, CGSize size) { - self = [self wb_initWithSize:size]; - if (self == nil) - return nil; - - NSFileManager *manager([NSFileManager defaultManager]); - NSString *path = [NSString stringWithFormat:@"%@/%@/Wallpaper.png", Themes_, theme_]; - if ([manager fileExistsAtPath:path]) - if (UIImage *image = [[UIImage alloc] initWithContentsOfFile:path]) { - /*window_ = [[UIWindow alloc] initWithContentRect:CGRectMake(0, 0, 320, 480)]; - [window_ setHidden:NO];*/ - UIImageView *view = [[[UIImageView alloc] initWithImage:image] autorelease]; - //[view setFrame:CGRectMake(0, -10, 320, 480)]; - [self addSubview:view]; - } - - return self; -} - -extern "C" void WBInitialize() { - /* WinterBoard FrontEnd {{{ */ - if (NSClassFromString(@"SpringBoard") == nil) - return; - NSLog(@"WB: installing WinterBoard..."); - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - char *dil = getenv("DYLD_INSERT_LIBRARIES"); - if (dil == NULL) - NSLog(@"WB: DYLD_INSERT_LIBRARIES is unset?"); - else { - NSArray *dylibs = [[NSString stringWithUTF8String:dil] componentsSeparatedByString:@":"]; - int index = [dylibs indexOfObject:Dylib_]; - if (index == INT_MAX) - NSLog(@"WB: dylib not in DYLD_INSERT_LIBRARIES?"); - else if ([dylibs count] == 1) - unsetenv("DYLD_INSERT_LIBRARIES"); - else { - NSMutableArray *value = [[NSMutableArray alloc] init]; - [value setArray:dylibs]; - [value removeObjectAtIndex:index]; - setenv("DYLD_INSERT_LIBRARIES", [[value componentsJoinedByString:@":"] UTF8String], !0); - } - } - /* }}} */ - - WBRename("SBApplication", "pathForIcon", (IMP) &SBApplication$pathForIcon); - WBRename("NSBundle", "pathForResource:ofType:", (IMP) &NSBundle$pathForResource$ofType$); - WBRename("SBAppWindow", "setBackgroundColor:", (IMP) &SBAppWindow$setBackgroundColor$); - WBRename("SBContentLayer", "initWithSize:", (IMP) &SBContentLayer$initWithSize$); - - [pool release]; -} diff --git a/control b/control new file mode 100644 index 0000000..05ffc8e --- /dev/null +++ b/control @@ -0,0 +1,11 @@ +Package: winterboard +Priority: optional +Section: Themes +Maintainer: Jay Freeman (saurik) +Architecture: iphoneos-arm +Version: 0.9.2498-1 +Description: open-source SummerBoard replacement + This tool lets you apply SummerBoard themes. Themes are taken from /Library/Themes. Right now the tool is /very/ simplistic: I spent a single night coding it so that we would have some stronger theme support on iPhone 2.x. After you install or uninstall this package you will have to reboot your phone to it to take effect. More work will be done on this package in the very near future to make it actually have an interface ;P. (Also, the wallpaper is cut off at the bottom under the dock. I'm working on that still.) +Name: WinterBoard +Author: Jay Freeman (saurik) +Homepage: http://cydia.saurik.com/winterboard.html diff --git a/make.sh b/make.sh index 49b6930..e9a3ce6 100755 --- a/make.sh +++ b/make.sh @@ -3,4 +3,4 @@ set -e export PKG_ARCH=${PKG_ARCH-iphoneos-arm} PATH=/apl/n42/pre/bin:$PATH /apl/tel/exec.sh com.saurik.winterboard make "$@" export CODESIGN_ALLOCATE=$(which arm-apple-darwin9-codesign_allocate) -/apl/tel/util/ldid -S WinterBoard.dylib +/apl/tel/util/ldid -S WinterBoard WinterBoard.dylib diff --git a/makefile b/makefile index d4deec3..291a633 100644 --- a/makefile +++ b/makefile @@ -4,12 +4,25 @@ else target := $(PKG_TARG)- endif -all: WinterBoard.dylib +all: WinterBoard WinterBoard.dylib clean: - rm -f WinterBoard.dylib + rm -f WinterBoard WinterBoard.dylib -WinterBoard.dylib: WinterBoard.mm makefile - $(target)g++ -dynamiclib -g3 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -framework CoreFoundation -framework Foundation -lobjc -init _WBInitialize -I/apl/inc/iPhoneOS-2.0 -framework UIKit +WinterBoard.dylib: Library.mm makefile + $(target)g++ -dynamiclib -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -framework UIKit -framework CoreFoundation -framework Foundation -lobjc -init _WBInitialize -I/apl/inc/iPhoneOS-2.0 -.PHONY: all clean +WinterBoard: Application.mm makefile + $(target)g++ -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -framework UIKit -framework Foundation -framework CoreFoundation -lobjc -framework CoreGraphics + +package: + rm -rf winterboard + mkdir -p winterboard/DEBIAN + mkdir -p winterboard/Applications/WinterBoard.app + mkdir -p winterboard/Library/Themes/com.saurik.WinterBoard.Nature + cp -a control preinst postinst prerm winterboard/DEBIAN + cp -a Test.sh WinterBoard.dylib WinterBoard Info.plist ../pledit/pledit winterboard/Applications/WinterBoard.app + cp -a Wallpaper.png Dock.png winterboard/Library/Themes/com.saurik.WinterBoard.Nature + dpkg-deb -b winterboard winterboard_0.9.2498-1_iphoneos-arm.deb + +.PHONY: all clean package diff --git a/postinst b/postinst new file mode 100755 index 0000000..6b94318 --- /dev/null +++ b/postinst @@ -0,0 +1,6 @@ +#!/bin/sh + +if [[ $1 == configure ]]; then + /Applications/WinterBoard.app/pledit /System/Library/LaunchDaemons/com.apple.SpringBoard.plist \ + -a /Applications/WinterBoard.app/WinterBoard.dylib +fi diff --git a/preinst b/preinst new file mode 100755 index 0000000..357b50c --- /dev/null +++ b/preinst @@ -0,0 +1,7 @@ +#!/bin/bash + +if [[ $1 == install ]]; then + /usr/libexec/cydia/move.sh /Library/Themes +fi + +exit 0 diff --git a/prerm b/prerm new file mode 100755 index 0000000..dbb80b8 --- /dev/null +++ b/prerm @@ -0,0 +1,6 @@ +#!/bin/sh + +if [[ $1 == remove ]]; then + /Applications/WinterBoard.app/pledit /System/Library/LaunchDaemons/com.apple.SpringBoard.plist \ + -r /Applications/WinterBoard.app/WinterBoard.dylib +fi