├── .theos ├── fakeroot └── packages │ └── com.whomer.WeeAppTest-0.0.1 ├── theos ├── layout ├── System │ └── Library │ │ └── WeeAppPlugins │ │ └── WeeAppTest.bundle │ │ ├── InfoPlist.strings │ │ ├── Info.plist │ │ ├── WeeAppBackground.png │ │ └── WeeAppBackground@2x.png └── DEBIAN │ └── control ├── Makefile ├── BBWeeAppController-Protocol.h ├── README └── WeeAppTest.mm /.theos/fakeroot: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /theos: -------------------------------------------------------------------------------- 1 | /Users/will/iPhone/theos -------------------------------------------------------------------------------- /.theos/packages/com.whomer.WeeAppTest-0.0.1: -------------------------------------------------------------------------------- 1 | 0.0.1-19 -------------------------------------------------------------------------------- /layout/System/Library/WeeAppPlugins/WeeAppTest.bundle/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | "Test_Widget" = "Hello World Widget"; -------------------------------------------------------------------------------- /layout/System/Library/WeeAppPlugins/WeeAppTest.bundle/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devslashwill/WeeAppTest/HEAD/layout/System/Library/WeeAppPlugins/WeeAppTest.bundle/Info.plist -------------------------------------------------------------------------------- /layout/System/Library/WeeAppPlugins/WeeAppTest.bundle/WeeAppBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devslashwill/WeeAppTest/HEAD/layout/System/Library/WeeAppPlugins/WeeAppTest.bundle/WeeAppBackground.png -------------------------------------------------------------------------------- /layout/System/Library/WeeAppPlugins/WeeAppTest.bundle/WeeAppBackground@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devslashwill/WeeAppTest/HEAD/layout/System/Library/WeeAppPlugins/WeeAppTest.bundle/WeeAppBackground@2x.png -------------------------------------------------------------------------------- /layout/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: com.whomer.WeeAppTest 2 | Name: WeeAppTest 3 | Version: 0.0.1 4 | Architecture: iphoneos-arm 5 | Description: An awesome tool of some sort!! 6 | Maintainer: Will Homer 7 | Author: Will Homer 8 | Section: System 9 | Tag: role::hacker 10 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | export THEOS_DEVICE_IP=192.168.0.9 2 | SDKVERSION = 5.0 3 | include theos/makefiles/common.mk 4 | 5 | LIBRARY_NAME = WeeAppTest 6 | WeeAppTest_FILES = WeeAppTest.mm 7 | WeeAppTest_INSTALL_PATH = /System/Library/WeeAppPlugins/WeeAppTest.bundle 8 | WeeAppTest_FRAMEWORKS = UIKit CoreGraphics 9 | WeeAppTest_PRIVATE_FRAMEWORKS = BulletinBoard 10 | 11 | include $(THEOS_MAKE_PATH)/library.mk 12 | 13 | after-stage:: 14 | mv _/System/Library/WeeAppPlugins/WeeAppTest.bundle/WeeAppTest.dylib _/System/Library/WeeAppPlugins/WeeAppTest.bundle/WeeAppTest -------------------------------------------------------------------------------- /BBWeeAppController-Protocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by class-dump 3.3.3 (64 bit). 3 | * 4 | * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2010 by Steve Nygard. 5 | */ 6 | 7 | @protocol BBWeeAppController 8 | - (id)view; 9 | 10 | @optional 11 | - (float)viewHeight; 12 | - (void)viewWillAppear; 13 | - (void)viewDidAppear; 14 | - (void)viewWillDisappear; 15 | - (void)viewDidDisappear; 16 | - (void)willRotateToInterfaceOrientation:(int)arg1; 17 | - (void)willAnimateRotationToInterfaceOrientation:(int)arg1; 18 | - (void)didRotateFromInterfaceOrientation:(int)arg1; 19 | - (void)loadPlaceholderView; 20 | - (void)loadFullView; 21 | - (void)unloadView; 22 | - (void)loadView; 23 | - (id)launchURL; 24 | - (id)launchURLForTapLocation:(struct CGPoint)arg1; 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Custom Notification Center Widgets (WeeApps) by @WillFour20 2 | 3 | This is a very bare example of how to add a custom widget to the iOS 5 notification centre. 4 | 5 | All it really does is say 'Hello World' for now. 6 | 7 | Its pretty easy to understand, you create a class that implements the BBWeeAppController protocol. The only required function you must have is '- (UIView *)view' in which you must return the view that you want to appear. There are also other methods in the protocol for launching URLs when tapped and for rotation detection, view height, etc. 8 | 9 | The i is set by settings the 'AppBundleID' key in the Info.plist file to an app id. The icon will then be the icon for that app (e.g. Setting 'AppBundleID' to 'com.apple.mobilesafari' will make your widget have the Safari icon). The name is set in the 'InfoPlist.strings' file (Thanks @timwachter) 10 | 11 | Custom bundles are placed in /System/Library/WeeAppPlugins/ 12 | 13 | This is a pretty shitty example but i'm sure some great stuff can come out of this. -------------------------------------------------------------------------------- /WeeAppTest.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "BBWeeAppController-Protocol.h" 4 | 5 | @interface WeeAppTestController : NSObject 6 | { 7 | UIView *_view; 8 | } 9 | 10 | + (void)initialize; 11 | - (UIView *)view; 12 | 13 | @end 14 | 15 | @implementation WeeAppTestController 16 | 17 | + (void)initialize 18 | { 19 | 20 | } 21 | 22 | - (void)dealloc 23 | { 24 | [_view release]; 25 | [super dealloc]; 26 | } 27 | 28 | - (UIView *)view 29 | { 30 | if (_view == nil) 31 | { 32 | _view = [[UIView alloc] initWithFrame:CGRectMake(2, 0, 316, 71)]; 33 | 34 | UIImage *bg = [[UIImage imageWithContentsOfFile:@"/System/Library/WeeAppPlugins/WeeAppTest.bundle/WeeAppBackground.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:71]; 35 | UIImageView *bgView = [[UIImageView alloc] initWithImage:bg]; 36 | bgView.frame = CGRectMake(0, 0, 316, 71); 37 | [_view addSubview:bgView]; 38 | [bgView release]; 39 | 40 | UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 316, 71)]; 41 | lbl.backgroundColor = [UIColor clearColor]; 42 | lbl.textColor = [UIColor whiteColor]; 43 | lbl.text = @"Hello World"; 44 | lbl.textAlignment = UITextAlignmentCenter; 45 | [_view addSubview:lbl]; 46 | [lbl release]; 47 | } 48 | 49 | return _view; 50 | } 51 | 52 | - (float)viewHeight 53 | { 54 | return 71.0f; 55 | } 56 | 57 | @end --------------------------------------------------------------------------------