Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open crash in ios6.x #2

Open
haohaodlam opened this issue Feb 16, 2013 · 7 comments
Open

open crash in ios6.x #2

haohaodlam opened this issue Feb 16, 2013 · 7 comments

Comments

@haohaodlam
Copy link

open crash in ios6.x

@itskemo
Copy link

itskemo commented Feb 18, 2013

Any chance this get's fixed ? Using Open in terminal on iOS 6.x and always keep Springboard to crash.
Thanks for your effort.

@haohaodlam
Copy link
Author

iOS 6.0bete in itouch4
iOS 6.1 in ipad2 wifi old cpu
always keep Springboard to crash

@conradev
Copy link
Owner

Yes, this does not work on iOS 6.0+, yes I will get around to fixing it.

@Orochica
Copy link

Orochica commented Mar 7, 2013

please fix it.
I will donate for it :D

@torarnv
Copy link

torarnv commented Mar 13, 2013

@conradev Any idea what's causing the crash?

@regcs
Copy link

regcs commented Mar 19, 2013

Hi,

I was playing around a bit in order to find a fix for this problem. It seems the problem is with the libdisplaystack. A possible workaround is to use the SBUIController Object instead of the libdisplaystack. The Tweak.xm should look like this (tested on iOS 6.1.2, iPhone 4S):

#import <SpringBoard/SpringBoard.h>
#import <AppSupport/CPDistributedMessagingCenter.h>
#import <SpringBoard/SBUIController.h>

%hook SBApplicationController

- (id)init {
    if ((self = %orig)) {

        CPDistributedMessagingCenter *messagingCenter = [CPDistributedMessagingCenter centerNamed:@"com.conradkramer.open.server"];
        [messagingCenter runServerOnCurrentThread];

        [messagingCenter registerForMessageName:@"open" target:self selector:@selector(handleOpenCommand:withUserInfo:)];
    }

    return self;
}


%new(@@:@@)
- (NSDictionary *)handleOpenCommand:(NSString *)name withUserInfo:(NSDictionary *)userInfo {

    NSString *identifier = [userInfo objectForKey:@"identifier"];
    SBApplication *application = [self applicationWithDisplayIdentifier:identifier];

    if (application) {

        // open application
        [[%c(SBUIController) sharedInstance] activateApplicationAnimated: application];

        return [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:0] forKey:@"status"];

    } else {

        return [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:1] forKey:@"status"];

    }

}

%end

But there is one downside to using SBUIController: It only launches the application when the device is opened on the homescreen. For me this is enough, so I won't dig further into this. But I thought it might be useful for anybody who is willing to and/or as a first bug fix version for the people waiting for the "open" command. ;)

Best regards,
Christian

@willbin
Copy link

willbin commented Apr 7, 2013

@regcs please send me one copy of your "open" to weiyoubin@gmail.com, i need this "open" command on iOS6.
thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants