Skip to content

Commit

Permalink
(chore) formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
leonjza committed Apr 6, 2021
1 parent bb33bce commit 7724481
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 22 deletions.
1 change: 1 addition & 0 deletions objection/api/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from flask import Flask

from . import rpc
from . import script

Expand Down
11 changes: 6 additions & 5 deletions objection/commands/android/hooking.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fnmatch

import click
import frida
import fnmatch

from objection.state.connection import state_connection
from objection.utils.helpers import clean_argument_flags
Expand Down Expand Up @@ -283,8 +284,8 @@ def search_class(args: list) -> None:
click.secho('Usage: android hooking search classes <name>', bold=True)
return

click.secho('Note that Java classes are only loaded when they are used,'
' so if the expected class has not been found, it might not have been loaded yet.', fg='yellow')
click.secho('Note that Java classes are only loaded when they are used,'
' so if the expected class has not been found, it might not have been loaded yet.', fg='yellow')

search = args[0]
found = 0
Expand Down Expand Up @@ -318,8 +319,8 @@ def search_methods(args: list) -> None:
class_filter = args[1] if len(clean_argument_flags(args)) > 1 else None
found = 0

click.secho('Note that Java classes are only loaded when they are used,'
' so if the expected class has not been found, it might not have been loaded yet.', fg='yellow')
click.secho('Note that Java classes are only loaded when they are used,'
' so if the expected class has not been found, it might not have been loaded yet.', fg='yellow')

if not class_filter:
click.secho('Warning, searching all classes may take some time and in some cases, '
Expand Down
1 change: 1 addition & 0 deletions objection/commands/android/proxy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import click

from objection.state.connection import state_connection


Expand Down
1 change: 1 addition & 0 deletions objection/commands/ios/monitor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from objection.state.connection import state_connection


def crypto_enable(args: list = None) -> None:
"""
Attempts to enable ios crypto monitoring.
Expand Down
2 changes: 1 addition & 1 deletion objection/commands/memory.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import json
import os

import click
from tabulate import tabulate
Expand Down
3 changes: 2 additions & 1 deletion objection/commands/mobile_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def patch_android_apk(source: str, architecture: str, pause: bool, skip_cleanup:
# ensure that we have all of the commandline requirements
if not patcher.are_requirements_met():
return

# ensure we have the latest apk-tool and run the
if not patcher.is_apktool_ready():
click.secho('apktool is not ready for use', fg='red', bold=True)
Expand Down Expand Up @@ -229,6 +229,7 @@ def patch_android_apk(source: str, architecture: str, pause: bool, skip_cleanup:
'Copying final apk from {0} to {1} in current directory...'.format(patcher.get_patched_apk_path(), destination))
shutil.copyfile(patcher.get_patched_apk_path(), os.path.join(os.path.abspath('.'), destination))


def sign_android_apk(source: str, skip_cleanup: bool = True) -> None:
"""
Zipaligns and signs an Android APK with the objection key.
Expand Down
2 changes: 1 addition & 1 deletion objection/state/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Android(Device):

class Ios(Device):
""" Represents iOS specific configurations. """

name = 'ios'
path_seperator = '/'

Expand Down
14 changes: 7 additions & 7 deletions objection/utils/assets/javahookmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class JavaHookManager {
validMethod(method) {
if (!this.available_methods.includes(method)) {
return false;
}
}
return true;
}

Expand All @@ -74,11 +74,11 @@ class JavaHookManager {
return true;
} else {
return false;
};
};
}

hook(m, f = null) {
if (!this.validMethod(m)) {
if (!this.validMethod(m)) {
this.print(`Method ${m} is not valid for this class.`);
return;
}
Expand All @@ -92,11 +92,11 @@ class JavaHookManager {
var r = [];
this.target[m].overloads.forEach(overload => {
if (f == null) {
overload.replacement = function() {
overload.replacement = function () {
return overload.apply(this, arguments);
}
} else {
overload.implementation = function() {
overload.implementation = function () {
var ret = overload.apply(this, arguments);
return f(arguments, ret);
}
Expand All @@ -105,11 +105,11 @@ class JavaHookManager {
r.push(overload);
});

this.hooking.push({method: m, replacements: r});
this.hooking.push({ method: m, replacements: r });
}

unhook(method) {
if (!this.validMethod(method)) {
if (!this.validMethod(method)) {
this.print(`Method ${method} is not valid for this class.`);
return;
}
Expand Down
10 changes: 5 additions & 5 deletions objection/utils/assets/objchookmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ObjCHookManager {
validMethod(method) {
if (!this.available_methods.includes(method)) {
return false;
}
}
return true;
}

Expand All @@ -52,11 +52,11 @@ class ObjCHookManager {
return true;
} else {
return false;
};
};
}

hook(m, enter = null, leave = null) {
if (!this.validMethod(m)) {
if (!this.validMethod(m)) {
this.print(`Method ${m} is not valid for this class.`);
return;
}
Expand All @@ -80,11 +80,11 @@ class ObjCHookManager {
},
});

this.hooking.push({method: m, listener: l});
this.hooking.push({ method: m, listener: l });
}

unhook(method) {
if (!this.validMethod(method)) {
if (!this.validMethod(method)) {
this.print(`Method ${method} is not valid for this class.`);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions objection/utils/patchers/base.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json
import os
import shlex
import shutil
from subprocess import list2cmdline

import click
import shlex
from subprocess import list2cmdline

from .github import Github

Expand Down

0 comments on commit 7724481

Please sign in to comment.