Skip to content

Instantly share code, notes, and snippets.

@kylehowells
kylehowells / gist:1111952
Created July 28, 2011 17:00
Modern Version of a 3 year old tutorial
%hook SBApplicationIcon
-(void)launch{
UIAlertView* __launchView = [[[UIAlertView alloc] init] autorelease];
__launchView.title = @"No way muchacho";
__launchView.message = @"You can't touch dis!";
[__launchView addButtonWithTitle:@"Dismiss"];
[__launchView show];
}
@kylehowells
kylehowells / gist:1208338
Created September 10, 2011 13:58
Add Page to SpringBoard
static UIView *greenView = nil;
%hook SBIconScrollView
// Make it wider
-(void)setContentSize:(CGSize)size{
if (!greenView) {
greenView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height)] autorelease];
greenView.backgroundColor = [UIColor greenColor];
@kylehowells
kylehowells / gist:1462582
Created December 11, 2011 20:31
Launch SBApplication's (iOS 5.x)
/* References:
* http://iky1e.tumblr.com/post/13985531616/raw-log-sbdisplay-settings
* http://iphonedevwiki.net/index.php/SBDisplay
* http://iphonedevwiki.net/index.php/SBDisplayStack
* http://code.google.com/p/iphone-tweaks/wiki/DevelopmentNotes
*/
#!/usr/bin/cycript
var lb =[LibDisplay sharedInstance];
var displayStacks = lb.displayStacks;
var stack = displayStacks[0]; //activate stack
var stack2 = displayStacks[1]; // suspended stack
var app = [[SBApplicationController sharedInstance] applicationWithDisplayIdentifier:"com.appcubby.launchpro"];
var w = [SBUIController sharedInstance].window;
var csview = nil;
@kylehowells
kylehowells / UIScrollView-auto-height.mm
Created March 19, 2013 22:46
Automatically set the height of a UIScrollView to fit it's content.
CGFloat scrollViewHeight = 0.0f;
CGFloat scrollViewWidth = 0.0f;
for (UIView *view in scrollView.subviews) {
CGFloat height = (view.frame.size.height + view.frame.origin.y);
scrollViewHeight = ((height > scrollViewHeight) ? height : scrollViewHeight);
CGFloat width = (view.frame.size.width + view.frame.origin.x);
scrollViewWidth = ((width > scrollViewWidth) ? width : scrollViewWidth);
}
@kylehowells
kylehowells / Animation.vb
Last active December 18, 2015 22:38
Little Animation controller written in Visual Basic I wrote for a simple game I had to do for College. (Why does VB not have animations built in?)
Public Class Animation
' Property delegate property for each animation
Private _delegate As AnimationFinished
Public Property didFinishDelegate() As AnimationFinished
Get
Return _delegate
End Get
Set(ByVal value As AnimationFinished)
@kylehowells
kylehowells / gist:7208084
Created October 29, 2013 02:07
SpringBoard iOS 6 & iOS 7 get icon badge image.
//SBIconBadgeImage = UIImage subclass
__NSMallocBlock__ *block(NSString *string) = [SBIconBadgeImage creationBlockForText:nil];
/** Test Results: **/
block();
//Error: incorrect number of arguments to ffi function
@kylehowells
kylehowells / gist:7620645
Created November 23, 2013 22:12
Get application snapshot image path iOS 5 & 6
var name = [app _currentDefaultPNGName];
@"UIApplicationAutomaticSnapshotDefault"
[app defaultImagePathForCurrentOrientationWithName:name];
@"/var/mobile/Library/Caches/Snapshots/com.apple.weather/UIApplicationAutomaticSnapshotDefault-Portrait@2x.png"
@kylehowells
kylehowells / gist:8550985
Created January 21, 2014 23:57
Pseudo code for the function which launches iOS apps in SpringBoard on iOS 7.
function sub_10001d783 {
r12 = rdi;
r13 = *objc_msgSend;
rax = [*(r12 + 0x20) bundleIdentifier];
r14 = rax;
rax = [*(r12 + 0x20) isWebApplication];
if (rax != 0x0) {
r13 = *objc_msgSend;
rax = (r13)(*(r12 + 0x20), @selector(displayIdentifier));
rax = (r13)(rax, *objc_sel_copy);
@kylehowells
kylehowells / gist:8625390
Last active November 26, 2023 05:51
Pseudo code for creating a notification on iOS 7 in SpringBoard
//SBBulletinBannerController
-(BBBulletinRequest*)showTestBanner:(NSString*)something {
//r14 = self
//r15 = something
static NSInteger testCount = 0;
BBBulletinRequest *request = [[BBBulletinRequest alloc] init];
[request setBulletinID:something];
[request setTitle:something];
[request setMessage:[NSString stringWithFormat:@"Fake iTunes notification %ld", testCount]];