Skip to content

Commit

Permalink
Merge pull request #7 from doronz88/bugfix/pymobile_compatibility
Browse files Browse the repository at this point in the history
main: Fix pymobile compatibility
  • Loading branch information
netanelc305 authored Jul 25, 2023
2 parents 74b8802 + 6053265 commit 6f5b719
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions harlogger/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import click
from pymobiledevice3.cli.cli_common import Command
from pymobiledevice3.lockdown import LockdownClient
from pymobiledevice3.lockdown_service_provider import LockdownServiceProvider

from harlogger.sniffers import Filters, SnifferPreference, SnifferProfile

Expand All @@ -19,14 +19,16 @@ def cli():
@click.option('--response/--no-response', is_flag=True, default=True, help='show responses')
@click.option('-u', '--unique', is_flag=True, help='show only unique requests per image/pid/method/uri combination')
@click.option('--black-list/--white-list', default=True, is_flag=True)
def cli_profile(lockdown: LockdownClient, pids, process_names, color, request, response, images, unique, black_list):
def cli_profile(service_provider: LockdownServiceProvider, pids, process_names, color, request, response, images,
unique, black_list):
"""
Sniff using CFNetworkDiagnostics.mobileconfig profile.
This requires the specific Apple profile to be installed for the sniff to work.
"""
filters = Filters(pids, process_names, images, black_list)
SnifferProfile(lockdown, filters=filters, request=request, response=response, color=color, unique=unique).sniff()
SnifferProfile(service_provider, filters=filters, request=request, response=response, color=color,
unique=unique).sniff()


@cli.command('preference', cls=Command)
Expand All @@ -39,15 +41,16 @@ def cli_profile(lockdown: LockdownClient, pids, process_names, color, request, r
@click.option('--response/--no-response', is_flag=True, default=True, help='show responses')
@click.option('-u', '--unique', is_flag=True, help='show only unique requests per image/pid/method/uri combination')
@click.option('--black-list/--white-list', default=True, is_flag=True)
def cli_preference(lockdown: LockdownClient, out, pids, process_names, images, request, response, color, unique, black_list):
def cli_preference(service_provider: LockdownServiceProvider, out, pids, process_names, images, request, response,
color, unique, black_list):
"""
Sniff using the secret com.apple.CFNetwork.plist configuration.
This sniff includes the request/response body as well but requires the device to be jailbroken for
the sniff to work
"""
filters = Filters(pids, process_names, images, black_list)
SnifferPreference(lockdown, filters=filters, request=request, response=response, out=out, color=color,
SnifferPreference(service_provider, filters=filters, request=request, response=response, out=out, color=color,
unique=unique).sniff()


Expand Down

0 comments on commit 6f5b719

Please sign in to comment.