Last active
August 26, 2022 18:37
-
-
Save aancw/dd5f57f5a71af27141ad035d6685642b to your computer and use it in GitHub Desktop.
debug ssl error frida
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Java.perform(function () { | |
const UnverifiedCertError = Java.use('javax.net.ssl.SSLPeerUnverifiedException'); | |
UnverifiedCertError.$init.implementation = function (str) { | |
const stackTrace = Java.use('java.lang.Thread').currentThread().getStackTrace(); | |
const exceptionStackIndex = stackTrace.findIndex(stack => | |
stack.getClassName() === "javax.net.ssl.SSLPeerUnverifiedException" | |
); | |
const callingFunctionStack = stackTrace[exceptionStackIndex + 1]; | |
const className = callingFunctionStack.getClassName(); | |
const methodName = callingFunctionStack.getMethodName(); | |
console.log(` =================`); | |
console.log(` Debugging Stack Trace for SSLPeerUnverifiedException`); | |
console.log(` Thrown by ${className}->${methodName}`); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment