19 lines
746 B
JavaScript
19 lines
746 B
JavaScript
Java.perform(() => {
|
|
Java.use('okhttp3.Request').$init.overload('okhttp3.Request$Builder').implementation = function(builder) {
|
|
this.$init(builder);
|
|
let out = "-----------------------------------\n";
|
|
out += this.toString() + "\n\n";
|
|
out += this.method() + " " + this.url().toString() + "\n" + this.headers().toString();
|
|
if (this.body()) {
|
|
const buffer = Java.use('okio.Buffer').$new();
|
|
this.body().writeTo(buffer);
|
|
out += buffer.toString();
|
|
}
|
|
out += "\n-----------------------------------";
|
|
console.log(out);
|
|
|
|
//var jAndroidLog = Java.use("android.util.Log"), jException = Java.use("java.lang.Exception");
|
|
//console.log( jAndroidLog.getStackTraceString( jException.$new() ) );
|
|
};
|
|
});
|