Created
June 21, 2012 15:14
-
-
Save kylehowells/2966329 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; | |
function openApp(_app){ | |
[stack pushDisplay:_app]; | |
[stack2 popDisplay:_app]; | |
} | |
function addAppToHomescreen(_app){ | |
cleanupApp(); | |
openApp(_app); | |
csview = [[CSAppLiveView alloc] initWithApplication:_app]; | |
csview.subviews[1].hidden=1; | |
[w addSubview:csview]; | |
UIApp.statusBarHidden=1; | |
} | |
function cleanupApp(){ | |
[csview removeFromSuperview]; | |
csview = nil; | |
} | |
function setAppDisplayID(displayID){ | |
var app = [[SBApplicationController sharedInstance] applicationWithDisplayIdentifier:displayID]; | |
addAppToHomescreen(app); | |
} | |
// made for @unimp0rtanttech to use Launch Center as his home screen. | |
// [UIApp openURL:[NSURL URLWithString:"http://google.com"]]; is broken if the app isn't on the active stack. | |
// this makes it unusable | |
// A fix would be to hook "com.appcubby.launchpro" and forward openURL: methods using CPDistributedMessagingCenter to SpringBoard which always works. | |
// however this was a little test to see if I could get it working in Cycript, and I can't. | |
// | |
// You could just write the fix as a tweak and leave this as Cycript but my test failed (correction, it's possible in cycript but not easier in Logos). | |
// | |
// Another small note, the status bar keeps reappearing when you come back from an app. You'd need to hook -unscatter icons or something like that and reset: UIApp.statusBarHidden=1; | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment