frida-java-bridge icon indicating copy to clipboard operation
frida-java-bridge copied to clipboard

[FEATURE] promisify perform and performNow

Open londek opened this issue 3 years ago • 0 comments

Hey, It's been a long time since async functions were added into JS! Frida is still using callbacks, why not promises? All previous synchronous users could rewrite their code from this:

Java.perform(() => {
    ...
})

to this

Java.perform().then(() => {
    ...
})

or for backward compatibility we would not change internals of current functions, but create new, eg: Java.performAsync and Java.performNowAsync.

That would open new and smart ways for modern Frida scripting (ability to safely create async and cleaner code for modern users). I personally don't see any drawbacks other than backward compatibility, please let me know if there are any, probably you know your code better than me ;)

Let me know, I can PR changes if you want.

Best regards

londek avatar May 03 '22 21:05 londek