ios - Setting a BBSectionInfo using BBSettingsGateway fails for unclear reason -
i’m attempting create solution end-to-end testing suite set user permissions (contacts, photos, notifications, etc.) on simulator. reason doing because permission alerts displayed springboard, , interfere testing suite.
i’ve tried using xcuitest suite, not work expected regarding springboard alerts, , inconvenient use in general.
so idea modify system files in order set permissions on-demand. found tcc database, , seems pretty straightforward. noticed notification permissions saved under different file, /library/bulletinboard/sectioninfo.plist
. file cached bbserver
object in springboard process. managed change file, , if springboard terminated, changes file accepted. want change happen during tested app’s process runtime.
after digging, noticed when settings app (preferences) makes change notification settings, uses xpc connection notify has made change.
i trying accomplish same thing in tested process. create bbsectioninfo
object contains settings notifications, , try notify bulletinboard server of change using bbsettingsgateway
, internally uses xpc connection. not work, , not sure why not, because not error.
perhaps it’s entitlement issue? annoys me no error given system, nothing happens.
in debugger, bringing xpc connection, this:
(lldb) po [inv.target valueforkey:@“connection”] <nsxpcconnection: 0x60000011bcf0> connection service named com.apple.bulletinboard.settingsconnection
the internal connection not disclose issues:
(lldb) po [[inv.target valueforkey:@"connection"] valueforkey:@"xpcconnection"] <os_xpc_connection: connection[0x6000001a6200]: { refcnt = 2, xrefcnt = 1, name = com.apple.bulletinboard.settingsconnection, type = named, state = init-done, error = 0x0 mach = true, privileged = false, bssend = 0x6f07, recv = 0x6d0b, send = 0x7003, pid = 0, euid = 4294967295, egid = 4294967295, asid = 4294967295 } <connection: 0x6000001a6200> { name = com.apple.bulletinboard.settingsconnection, listener = false, pid = 0, euid = 4294967295, egid = 4294967295, asid = 4294967295 }>
so seems good. difference can find between connections in process, state init-done
, while in preferences process, state checked in
:
(lldb) po [[[quiethoursstatecontroller sharedcontroller] bbgateway] valueforkey:@"connection"] <nsxpcconnection: 0x6180001160b0> connection service named com.apple.bulletinboard.settingsconnection (lldb) po [[[[quiethoursstatecontroller sharedcontroller] bbgateway] valueforkey:@"connection"] valueforkey:@"xpcconnection"] <os_xpc_connection: connection[0x6180001a3fe0]: { refcnt = 2, xrefcnt = 1, name = com.apple.bulletinboard.settingsconnection, type = named, state = checked in, error = 0x0 mach = true, privileged = false, bssend = 0x9d03, recv = 0x9817, send = 0x9e03, pid = 17877, euid = 26053515, egid = 20, asid = 100046 } <connection: 0x6180001a3fe0> { name = com.apple.bulletinboard.settingsconnection, listener = false, pid = 17877, euid = 26053515, egid = 20, asid = 100046 }>
i don’t have enough experience xpc connections, maybe missing something? bbsettingsgateway
seems manage own connection, , not expose methods managing connection.
i don’t mind other creative solutions, solution simulator. have added jailbreak
tag discoverability, looking simulator-only solutions.
turns out security related. bbserver
implements listener:shouldacceptnewconnection:
method (which defined in nsxpclistenerdelegate), has whitelist of entitlements accepted. otherwise, connection not accepted, not terminated either. since simulator, added com.apple.bulletinboard.settings
entitlement app, , indeed solved issues, , able set section info using bbsettingsgateway
.
Comments
Post a Comment