From 249202f9ab1b5cad121c654d643e9e098636c852 Mon Sep 17 00:00:00 2001 From: Yoav Shai Date: Sat, 12 Oct 2019 17:59:28 +0300 Subject: [PATCH] Add proxy setting script --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 72d0377..b420e23 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ * [`Enumerate loaded classes`](#enumerate-loaded-classes) * [`Class description`](#class-description) * [`Turn WiFi off`](#turn-wifi-off) +* [`Set proxy`](#set-proxy) * [`Get IMEI`](#get-imei) * [`Hook io InputStream`](#hook-io-inputstream) * [`Android make Toast`](#android-make-toast) @@ -812,6 +813,28 @@ TODO
[⬆ Back to top](#table-of-contents) +#### Set proxy + +It will set a system-wide proxy using the supplied IP address and port. + +```js +var ActivityThread = Java.use('android.app.ActivityThread'); +var ConnectivityManager = Java.use('android.net.ConnectivityManager'); +var ProxyInfo = Java.use('android.net.ProxyInfo'); + +var proxyInfo = ProxyInfo.$new('192.168.1.10', 8080, ''); // change to null in order to disable the proxy. +var context = ActivityThread.currentApplication().getApplicationContext(); +var connectivityManager = Java.cast(context.getSystemService('connectivity'), ConnectivityManager); +connectivityManager.setGlobalProxy(proxyInfo); +``` + +
+Output example +TODO +
+ +
[⬆ Back to top](#table-of-contents) + #### Get IMEI Can also hook & change IMEI.