@@ -421,6 +421,58 @@ rpc_status rpc_recv_applicationSentData(rpc_t self, const plist_t args) {
421421 return ret ;
422422}
423423
424+ /*
425+ _rpc_applicationUpdated: <dict>
426+ <key>WIRApplicationBundleIdentifierKey</key>
427+ <string>com.apple.WebKit.WebContent</string>
428+ <key>WIRHostApplicationIdentifierKey</key>
429+ <string>PID:409</string>
430+ <key>WIRApplicationNameKey</key>
431+ <string></string>
432+ <key>WIRIsApplicationProxyKey</key>
433+ <true/>
434+ <key>WIRIsApplicationActiveKey</key>
435+ <integer>0</integer>
436+ <key>WIRApplicationIdentifierKey</key>
437+ <string>PID:536</string>
438+ </dict>
439+
440+ OR
441+
442+ <key>WIRApplicationBundleIdentifierKey</key>
443+ <string>com.apple.mobilesafari</string>
444+ <key>WIRApplicationNameKey</key>
445+ <string>Safari</string>
446+ <key>WIRIsApplicationProxyKey</key>
447+ <false/>
448+ <key>WIRIsApplicationActiveKey</key>
449+ <integer>0</integer>
450+ <key>WIRApplicationIdentifierKey</key>
451+ <string>PID:730</string>
452+ */
453+ rpc_status rpc_recv_applicationUpdated (rpc_t self , const plist_t args ) {
454+ char * app_id = NULL ;
455+ char * dest_id = NULL ;
456+ rpc_status ret ;
457+ if (!rpc_dict_get_required_string (args , "WIRHostApplicationIdentifierKey" , & app_id )) {
458+ if (!rpc_dict_get_required_string (args , "WIRApplicationIdentifierKey" , & dest_id ) &&
459+ !self -> on_applicationUpdated (self , app_id , dest_id )) {
460+ ret = RPC_SUCCESS ;
461+ } else {
462+ ret = RPC_ERROR ;
463+ }
464+ } else if (!rpc_dict_get_required_string (args , "WIRApplicationNameKey" , & app_id ) &&
465+ !rpc_dict_get_required_string (args , "WIRApplicationIdentifierKey" , & dest_id ) &&
466+ !self -> on_applicationUpdated (self , app_id , dest_id )) {
467+ ret = RPC_SUCCESS ;
468+ } else {
469+ ret = RPC_ERROR ;
470+ }
471+ free (app_id );
472+ free (dest_id );
473+ return ret ;
474+ }
475+
424476rpc_status rpc_recv_msg (rpc_t self , const char * selector , const plist_t args ) {
425477 if (!selector ) {
426478 return RPC_ERROR ;
@@ -449,6 +501,10 @@ rpc_status rpc_recv_msg(rpc_t self, const char *selector, const plist_t args) {
449501 if (!rpc_recv_applicationSentData (self , args )) {
450502 return RPC_SUCCESS ;
451503 }
504+ } else if (!strcmp (selector , "_rpc_applicationUpdated:" )) {
505+ if (!rpc_recv_applicationUpdated (self , args )) {
506+ return RPC_SUCCESS ;
507+ }
452508 }
453509
454510 // invalid msg
0 commit comments