https://kotlinlang.org logo
Title
n

Nikhil

01/16/2020, 9:17 AM
Can I intercept a network requests made by my library in an app level (without adding any code to android library) ? I’m not using okhttp and don’t want to use it.
t

Trym Nilsen

01/16/2020, 1:07 PM
Do you know which domains you are looking for requests to?
You can set up something like charles/proxyman to sniff the traffic, but this will require a change to your manifest and installing a certificate on the device.
n

Nikhil

01/16/2020, 7:08 PM
I’m already using charles/mitmproxy. I’m asking if I can intercept network on device ?
z

Zach Klippenstein (he/him) [MOD]

01/16/2020, 9:38 PM
How are you making requests on the device? E.g. with
HttpURLConnection
directly, some other client library?
n

Nikhil

01/17/2020, 6:07 AM
not with any client library. with HttpURLConnection. Consider, I don’t want to include any line of code in my library to intercept a network request made through library. Is there anything to achieve this in the app which implements this library as module dependency?
z

Zach Klippenstein (he/him) [MOD]

01/17/2020, 9:03 PM
I don’t think that
HttpURLConnection
provides that sort of functionality itself, i don’t see anything that looks relevant in the javadoc.
n

Nikhil

01/18/2020, 6:14 AM
Hmm. Is there any other way around ?