Difference between revisions of "Notifyd"

From iPhone Development Wiki
Jump to: navigation, search
m (Formatting.)
m (Unnecessary change inconsistent with standard)
 
Line 3: Line 3:
 
'''notifyd''' is the daemon for exchanging Darwin notifications.  
 
'''notifyd''' is the daemon for exchanging Darwin notifications.  
  
= Receive current status of all listeners =
+
== Receive current status of all listeners ==
  
 
With help of [[Cycript]], the information of all listeners can easily be obtained. First, store the following file as <tt>notstat.cy</tt>:
 
With help of [[Cycript]], the information of all listeners can easily be obtained. First, store the following file as <tt>notstat.cy</tt>:

Latest revision as of 02:50, 11 April 2016


notifyd is the daemon for exchanging Darwin notifications.

Receive current status of all listeners

With help of Cycript, the information of all listeners can easily be obtained. First, store the following file as notstat.cy:

#!/usr/bin/cycript -p notifyd

if (!dlfun) {
  function dlfun(fn, encoding, altname) { var f = new Functor(dlsym(RTLD_DEFAULT, fn), encoding); if (f) this[altname || fn] = f; return f; }
  dlfun("fprint_status", "v^v");
  dlfun("fopen", "^v**");
  dlfun("fclose", "i^v");
}
var f = fopen("/tmp/123.txt", "w");
fprint_status(f);
fclose(f);
"Please check /tmp/123.txt";

Then, make notstat.cy executable and run it. The result should be stored in /tmp/123.txt and the content is like

 --- NAME com.apple.springboard.edgeEnabledChanged ---
 name: com.apple.springboard.edgeEnabledChanged
 uid: 0
 gid: 0
 access: 333
 refcount: 1
 slot: -unassigned-
 val: 1
 state: 0 
 
 client_id: 2261
 session: 0x0000e1bb
 pid: 4349
 lastval: 0
 notify: port
 mach port: 0x00003343
 token: 98 
 
 --- NAME SBDidTurnOffDisplayNotification ---
 name: SBDidTurnOffDisplayNotification
 uid: 0
 gid: 0
 ......