Java.perform(function () {
console.log(
"Starting network request hooks..."
);
/
/
Hook Apache HttpClient (Commons HttpClient)
try
{
var HttpRequestBase
=
Java.use(
"org.apache.http.client.methods.HttpRequestBase"
);
HttpRequestBase.setURI.implementation
=
function (uri) {
console.log(
"[Apache HttpClient] URL: "
+
uri.toString());
return
this.setURI(uri);
};
} catch (e) {
console.log(
"Error hooking Apache HttpClient: "
+
e);
}
/
/
Hook Tigon (Facebook custom library)
try
{
var TigonRequest
=
Java.use(
"com.facebook.tigon.TigonRequest"
);
TigonRequest.toString.implementation
=
function () {
var requestInfo
=
this.toString();
console.log(
"[Tigon] Request: "
+
requestInfo);
return
requestInfo;
};
} catch (e) {
console.log(
"Error hooking Tigon: "
+
e);
}
/
/
Hook Proxygen (Facebook custom library)
try
{
var ProxygenRequest
=
Java.use(
"com.facebook.proxygen.HTTPRequestHandler"
);
ProxygenRequest.sendRequest.implementation
=
function () {
console.log(
"[Proxygen] sendRequest called"
);
return
this.sendRequest();
};
} catch (e) {
console.log(
"Error hooking Proxygen: "
+
e);
}
/
/
Hook Facebook specific networking classes (
if
any
found
in
decompiled APK)
try
{
/
/
Hook GraphQL
or
other specific networking
-
related classes
var GraphQLRequest
=
Java.use(
"com.facebook.graphql.GraphQLRequest"
);
GraphQLRequest.toString.implementation
=
function () {
var reqInfo
=
this.toString();
console.log(
"[GraphQLRequest] Request: "
+
reqInfo);
return
reqInfo;
};
} catch (e) {
console.log(
"Error hooking GraphQLRequest: "
+
e);
}
console.log(
"Network hooks setup completed."
);
});