Skip to content

Instantly share code, notes, and snippets.

@haxrob
Created July 9, 2023 09:28
Show Gist options
  • Save haxrob/cf06f7960b8d321d3c96f8c19bb68851 to your computer and use it in GitHub Desktop.
Save haxrob/cf06f7960b8d321d3c96f8c19bb68851 to your computer and use it in GitHub Desktop.
Frida hook for HTTP data Meross Android
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