--- /dev/null
+/* 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 <Foundation/Foundation.h>
+#import <CoreGraphics/CGGeometry.h>
+#import <UIKit/UIKit.h>
+
+#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;
+}
<string>WinterBoard</string>
<key>CFBundlePackageType</key>
- <string>BNDL</string>
+ <string>APPL</string>
+
+ <key>CFBundleShortVersionString</key>
+ <string>0.9</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.9</string>
- <key>NSPrincipalClass</key>
- <string>WinterBoard</string>
+ <key>SBUsesNetwork</key>
+ <integer>3</integer>
</dict>
</plist>
--- /dev/null
+/* 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 <objc/runtime.h>
+#include <objc/message.h>
+
+#import <Foundation/Foundation.h>
+
+#import <UIKit/UIColor.h>
+#import <UIKit/UIImage.h>
+#import <UIKit/UIImageView.h>
+
+#import <UIKit/UIView-Geometry.h>
+#import <UIKit/UIView-Hierarchy.h>
+#import <UIKit/UIView-Rendering.h>
+
+#import <SpringBoard/SBApplication.h>
+#import <SpringBoard/SBAppWindow.h>
+#import <SpringBoard/SBButtonBar.h>
+#import <SpringBoard/SBContentLayer.h>
+#import <SpringBoard/SBUIController.h>
+
+#import <CoreGraphics/CGGeometry.h>
+
+/* 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<WinterBoard> *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<WinterBoard> *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<WinterBoard> *self, SEL sel, UIColor *color) {
+ if (Wallpaper_ != nil)
+ return [self wb_setBackgroundColor:[UIColor clearColor]];
+ return [self wb_setBackgroundColor:color];
+}
+
+/*id SBButtonBar$initWithFrame$(SBButtonBar<WinterBoard> *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<WinterBoard> *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];
+}
--- /dev/null
+#!/bin/bash
+rm -f WinterBoard.dylib
+set -e
+rsync -SPaz 'saurik@carrier.saurik.com:menes/winterboard/WinterBoard{,.dylib}' .
+#killall SpringBoard
+++ /dev/null
-/* 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 <objc/runtime.h>
-#include <objc/message.h>
-
-#import <Foundation/Foundation.h>
-
-#import <UIKit/UIColor.h>
-#import <UIKit/UIImage.h>
-#import <UIKit/UIImageView.h>
-#import <UIKit/UIView-Hierarchy.h>
-
-#import <SpringBoard/SBApplication.h>
-#import <SpringBoard/SBAppWindow.h>
-#import <SpringBoard/SBContentLayer.h>
-#import <SpringBoard/SBUIController.h>
-
-#import <CoreGraphics/CGGeometry.h>
-
-/* 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<WinterBoard> *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<WinterBoard> *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<WinterBoard> *self, SEL sel, id color) {
- [self wb_setBackgroundColor:[UIColor clearColor]];
-}
-
-id SBContentLayer$initWithSize$(SBContentLayer<WinterBoard> *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];
-}
--- /dev/null
+Package: winterboard
+Priority: optional
+Section: Themes
+Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
+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) <saurik@saurik.com>
+Homepage: http://cydia.saurik.com/winterboard.html
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
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
--- /dev/null
+#!/bin/sh
+
+if [[ $1 == configure ]]; then
+ /Applications/WinterBoard.app/pledit /System/Library/LaunchDaemons/com.apple.SpringBoard.plist \
+ -a /Applications/WinterBoard.app/WinterBoard.dylib
+fi
--- /dev/null
+#!/bin/bash
+
+if [[ $1 == install ]]; then
+ /usr/libexec/cydia/move.sh /Library/Themes
+fi
+
+exit 0
--- /dev/null
+#!/bin/sh
+
+if [[ $1 == remove ]]; then
+ /Applications/WinterBoard.app/pledit /System/Library/LaunchDaemons/com.apple.SpringBoard.plist \
+ -r /Applications/WinterBoard.app/WinterBoard.dylib
+fi