Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intercept network call from Android Java/JNI

Hi i wish to intercept any network activity happening in android device. Say for example browser is opening http connection to some website or api.

If this is not possible then at least i wish to intercept browser url android say firefox chrome or opera.

So whenever user opens any url in browser i need to get call. I already know about providing an intent filter to activity and intercept. But this all happens if request goes to intent resolver which in browser case will not happen.

Similar question was opened here intercepting internet calls android but there was not any response on this.

If anyone has any solution or have similar requirement lets discuss.

Other resource https://gist.github.com/madeye/2297083 Proxy is also one solution but i have no clue about implementing it.

like image 976
silentsudo Avatar asked Oct 08 '16 13:10

silentsudo


1 Answers

you need to use something like vpn or proxy to do that. there is a link from google and an full project at the links below :

sample: https://android.googlesource.com/platform/development/+/master/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnService.java

full working project: https://github.com/hexene/LocalVPN

like image 131
Amir Ziarati Avatar answered Nov 16 '22 06:11

Amir Ziarati