Merge pull request #10 from gergesh/add-proxy

Add proxy setting script
This commit is contained in:
iddoeldor 2019-10-16 14:10:16 +03:00 committed by GitHub
commit 0e473c1e95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,7 @@
* [`Enumerate loaded classes`](#enumerate-loaded-classes) * [`Enumerate loaded classes`](#enumerate-loaded-classes)
* [`Class description`](#class-description) * [`Class description`](#class-description)
* [`Turn WiFi off`](#turn-wifi-off) * [`Turn WiFi off`](#turn-wifi-off)
* [`Set proxy`](#set-proxy)
* [`Get IMEI`](#get-imei) * [`Get IMEI`](#get-imei)
* [`Hook io InputStream`](#hook-io-inputstream) * [`Hook io InputStream`](#hook-io-inputstream)
* [`Android make Toast`](#android-make-toast) * [`Android make Toast`](#android-make-toast)
@ -875,6 +876,28 @@ TODO
<br>[⬆ Back to top](#table-of-contents) <br>[⬆ 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);
```
<details>
<summary>Output example</summary>
TODO
</details>
<br>[⬆ Back to top](#table-of-contents)
#### Get IMEI #### Get IMEI
Can also hook & change IMEI. Can also hook & change IMEI.