Skip to content

Instantly share code, notes, and snippets.

@DickyT
Last active December 20, 2019 06:39
Show Gist options
  • Save DickyT/b1f7c2d434e288e4edb8455b58015085 to your computer and use it in GitHub Desktop.
Save DickyT/b1f7c2d434e288e4edb8455b58015085 to your computer and use it in GitHub Desktop.
Use NSNotificationName for addObserverForName in frida
const nCenter = ObjC.classes.NSNotificationCenter.defaultCenter();
const addEventListener = nCenter['- addObserverForName:object:queue:usingBlock:'];
const onConnect = new ObjC.Block({
retType: 'void',
argTypes: ['object'],
implementation: function () {
console.log('OK');
},
});
addEventListener('UIScreenDidConnectNotification', null, null, onConnect);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment