Notifyd: Difference between revisions

From iPhone Development Wiki
m (Created page with 'notifyd is the daemon for exchanging Darwin notifications. == Receive current status of all listeners == With help of Cycript, the information of all listeners can easi…')
 
m (Unnecessary change inconsistent with standard)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[notifyd]] is the daemon for exchanging Darwin notifications.  
{{DISPLAYTITLE:notifyd}}
 
'''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>:
<source lang="javascript">
<source lang="javascript">
Line 17: Line 20:
"Please check /tmp/123.txt";
"Please check /tmp/123.txt";
</source>
</source>
Then, make <tt>notstat.cy</tt> executable and run it. The result should be stored in <tt>/tmp/123.txt</tt> and the content is like
Then, make <tt>notstat.cy</tt> executable and run it. The result should be stored in <tt>/tmp/123.txt</tt> and the content is like
<source lang="javascript">
  --- NAME com.apple.springboard.edgeEnabledChanged ---
  --- NAME com.apple.springboard.edgeEnabledChanged ---
  name: com.apple.springboard.edgeEnabledChanged
  name: com.apple.springboard.edgeEnabledChanged
Line 41: Line 47:
  gid: 0
  gid: 0
  ......
  ......
</source>
[[Category:Daemons]]

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
 ......