-
Notifications
You must be signed in to change notification settings - Fork 874
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added command to setup proxy via objection (#439)
- Loading branch information
1 parent
03b4194
commit 91d1311
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { wrapJavaPerform } from "./lib/libjava"; | ||
import { colors as c } from "../lib/color"; | ||
import { qsend } from "../lib/helpers"; | ||
|
||
export namespace proxy { | ||
|
||
export const set = (host: string, port: string): Promise<void> => { | ||
return wrapJavaPerform(() => { | ||
var proxyHost = host; | ||
var proxyPort = port; | ||
|
||
var System = Java.use("java.lang.System"); | ||
|
||
if(System != undefined) { | ||
send(c.green(`Setting properties for a proxy`)); | ||
System.setProperty("http.proxyHost", proxyHost); | ||
System.setProperty("http.proxyPort", proxyPort); | ||
|
||
System.setProperty("https.proxyHost", proxyHost); | ||
System.setProperty("https.proxyPort", proxyPort); | ||
|
||
send(`${c.green(`Proxy configured to ` + proxyHost + ` ` + proxyPort)}`); | ||
} | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import click | ||
from objection.state.connection import state_connection | ||
|
||
|
||
def android_proxy_set(args: list = None) -> None: | ||
""" | ||
Sets a proxy specifically within the application. | ||
:param args: | ||
:return: | ||
""" | ||
|
||
if len(args) != 2: | ||
click.secho('Usage: android proxy set <ip address> <port>', bold=True) | ||
return | ||
|
||
api = state_connection.get_api() | ||
api.android_proxy_set(args[0], args[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters