Created
July 9, 2023 09:28
-
-
Save haxrob/cf06f7960b8d321d3c96f8c19bb68851 to your computer and use it in GitHub Desktop.
Frida hook for HTTP data Meross Android
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 () { | |
let RequestBody = Java.use("okhttp3.RequestBody"); | |
RequestBody["create"].overload('okhttp3.MediaType', '[B').implementation = function (mediaType, bArr) { | |
console.log("\n"); | |
var ssresult = ""; | |
for(var i = 0; i < bArr.length; ++i) { | |
ssresult+= (String.fromCharCode(bArr[i] & 0xff)); | |
} | |
console.log(ssresult); | |
let result = this["create"](mediaType, bArr); | |
console.log(`RequestBody.create result=${result}`); | |
return result; | |
}; | |
let ServiceMethod = Java.use("retrofit2.ServiceMethod"); | |
ServiceMethod["toRequest"].implementation = function (objArr) { | |
console.log(`ServiceMethod.toRequest is called: objArr=${objArr}`); | |
let result = this["toRequest"](objArr); | |
console.log(`ServiceMethod.toRequest result=${result}`); | |
console.log("\n=====\n"); | |
return result; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment