The SpringBoard class only exists in the SpringBoard process therefore %c(SpringBoard)
or objc_getClass("SpringBoard")
will return nil on any other process.
To get the current bundle name of the applications you are hooking, you can use [[NSBundle mainBundle] bundleIdentifier]
. You'd have to use some form of IPC/XPC to send this information as well as additional information regarding the session that you want to know about. The receiving end could be either the SpringBoard process or a personal daemon so as to not clog SpringBoard with additional tasks.
As for your question "Isn't AVCaptureSession
API used by other apps ?", it is possible that some applications use other classes to capture images/video rendering this hook useless. As a jailbreak developer I have found, as many others, that Apple programmers don't adhere to a strict coding style. There can also be other lower level functions that achieve the same purpose, in which case you would have more work to do as there is no class-dump parallel to C functions.