objection icon indicating copy to clipboard operation
objection copied to clipboard

Fix error on missing method name for android sslpinning disable

Open TheDauntless opened this issue 1 month ago • 1 comments

The android sslpinning disable command fails if the class is found, but the target method is unavailable. This PR makes the hooks abort early if the target method isn't available. I've added it to all the ssl pinning hooks to be safe.

Error:

org.test.okhttp (run) on (Android: 14) [usb] # android sslpinning disable
(agent) Custom TrustManager ready, overriding SSLContext.init()
(agent) Found okhttp3.CertificatePinner, overriding CertificatePinner.check()
(agent) Found okhttp3.CertificatePinner, overriding CertificatePinner.check$okhttp()
A Frida agent exception has occurred.
TypeError: cannot read property 'overload' of undefined
    at <anonymous> (/src/index.js:20721)
    at <anonymous> (/src/index.js:13540)
    at <anonymous> (/src/index.js:2847)
    at perform (/src/index.js:13339)
    at <anonymous> (/src/index.js:13544)
    at Promise (native)
    at wrapJavaPerform (/src/index.js:13545)
    at okHttp3CertificatePinnerCheckOkHttp (/src/index.js:20735)
    at disable (/src/index.js:20846)

Alternatively I could update the catch() logic but that feels a bit weird since we would have to ignore type errors. Or I can throw a custom error, but that feels like overengineering.

TheDauntless avatar Nov 22 '25 02:11 TheDauntless

Thanks for the PR, looks good though bit too busy currently to test it.

IPMegladon avatar Nov 27 '25 09:11 IPMegladon