Prevent XPC message from being sent/received during respring

Questions and Answers about all things *OS (macOS, iOS, tvOS, watchOS)

Prevent XPC message from being sent/received during respring

Postby wizages » Wed Apr 05, 2017 7:49 pm

Hello all,

I am currently working on a tweak that allows you to listen to music during resprings. How we are doing this currently:

First we prevent the application from being terminated from within by preventing clientSystemApplicationTerminated from executing. After the preventing of that from killing the app we prevent launchd from killing the application because springboard calls a termination of all the apps that are running still. Now after springboard starts up again we reattach the application to backboardd. Than we send a message using frontboard to springboard which will reattach the process to the springboard. Than we create a new scene for the app that allows the app to run correctly.

Now to get into the issue that is causing us to struggle.

Right now we are observing BTServer crashes fairly common and we can't track down where the crash is coming from. The crash is specific to iOS 10 only and not iOS 9 and as you can observe with the attached crash log the crash report isn't symbolic. I have been digging down many holes to find out how to fix this somehow and the only thing I could find was an interesting log that would be present every time the crash would occur.

Code: Select all
BTServer[32625] <Notice>: Received XPC message "CBMsgIdScan" from session "com.spotify.client-central-32607-0"

I assume this is what is causing the crash because it is called every time the crash happens and when this call doesn't happen (it just happens once every 5 sec) BTServer doesn't crash.

The reason why I am posting here is I am trying to find out how to prevent the XPC message from being sent and the only person that has been successful on reading XPC messages is Jonathan Levin.

Also if you have any other insight on what might be going on or would like access to the source code please let me know.

BTServer crash log:
Posts: 2
Joined: Wed Apr 05, 2017 7:23 pm

Re: Prevent XPC message from being sent/received during resp

Postby wizages » Sat Apr 08, 2017 9:20 pm

Finally solved.

We ended up using MSHook functions and we were lucky the functions are the same names as the Mac libraries. This can be closed.
Posts: 2
Joined: Wed Apr 05, 2017 7:23 pm

Return to Questions and Answers

Who is online

Users browsing this forum: No registered users and 3 guests