简体   繁体   中英

Cycript script to run app in background

I have a cycript backboardd script that works great on iOS 7 for modifying an app to continue running in the background.

app = [BKProcess processForPid:$PID];
alive = [[BKProcessAssertion alloc] initWithReason:7 identifier:"AppKeepAlive"];
[alive setFlags:0xF];
[sc addAssertion:alive];

This is all that's needed. However on iOS 8 this does't work as BKProcess is now BKSProcess and BKProcessAssertion is now BKSProcessAssertion and they have different methods. There doesn't seem to be a way to attach the assertion to the app like on iOS 7 .

Can some please help me get this working under iOS 8 .

There is, however when I used this I simply used the initializer with the required PID .

- (id)initWithPID:flags:reason:name:withHandler:

Check out the BKSProcessAssertion header for reference.

If you want to see an implementation for reference, check out MessageBox (now deprecated, but for reference):

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM