Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 34 additions & 27 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,45 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
pull_request:
branches: [ '**' ]
branches: [ "master" ]
paths:
- '.github/workflows/python-app.yml'
- 'pymobiledevice3/**'
- 'requirements.txt'
- 'pyproject.toml'
release:
types: [ created ]

jobs:
build:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

runs-on: ubuntu-latest
jobs:
test:
if: '! github.event.pull_request.draft'
runs-on: ${{ matrix.os }}

strategy:
matrix:
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8
run: |
pip install -U flake8
flake8 . --max-line-length=127
- name: Verify sorted imports
run: |
python -m pip install isort
isort . -m HANGING_INDENT -l 120 --check-only
- name: Test install
run: |
python3 -m pip install .
- name: Test show usage
run: |
python -m cfprefsmon --help
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pre-commit
- name: Run pre-commit hooks
run: |
pre-commit run --all-files
- name: Test install
run: |
python -m pip install -U '.'
- name: Test show usage
run: cfprefsmon --help
38 changes: 17 additions & 21 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# This workflow builds and uploads the Python package to PyPI when a release is created

name: Upload Python Package

on:
release:
types: [created]
types: [ created ]

jobs:
deploy:

permissions:
id-token: write
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine upload dist/*
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Build distributions
run: uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.2
hooks:
# Run the linter.
- id: ruff-check
# Run the formatter.
- id: ruff-format
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
# Description
# cfprefsmon

Simple utility to search for interesting preferences in macOS and connected iDevices.
## Overview

# Installation
`cfprefsmon` streams CFPreferences activity so you can spot interesting keys and values on a macOS host or a connected iOS device.

## Installation

```shell
python3 -m pip install -U cfprefsmon
```

# Usage
## Usage

```
Usage: cfprefsmon [OPTIONS] COMMAND [ARGS]...
```none
Usage: cfprefsmon [OPTIONS] COMMAND [ARGS]...

Options:
--help Show this message and exit.
Inspect CFPreferences activity on macOS hosts and iOS devices.

Commands:
host Sniff on macOS host
mobile Sniff on connected iOS device
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or customize the installation. │
│ --help Show this message and exit. │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ host Stream CFPreferences activity from the macOS host. │
│ mobile Stream CFPreferences activity from a connected iOS device. │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

# Examples
## Examples

In this example, where the value for each preference is `None`, this is probably some hidden feature we can maybe enable
on a jailbroken device.
In this example, several preferences resolve to `None`, which can hint at uninitialized or internal-only settings.

```
```none
➜ cfprefmon git:(master) ✗ cfprefsmon mobile
CFPreference[com.apple.springboard][kCFPreferencesAnyUser][SBDisableHomeButton] = 0 # Process: /System/Library/CoreServices/SpringBoard.app/SpringBoard
CFPreference[com.apple.springboard][kCFPreferencesAnyUser][SBStoreDemoAppLock] = 0 # Process: /System/Library/CoreServices/SpringBoard.app/SpringBoard
Expand All @@ -47,14 +53,14 @@ CFPreference[com.apple.coreservices.useractivityd][kCFPreferencesAnyUser][Enable
...
```

Filter only domain `com.apple.softwareupdateservicesd` and users `kCFPreferencescurrentUser` & `mobile`:
Filter to a single domain and specific users:

```shell
cfprefmon mobile --domain-filter 'com.apple.softwareupdateservicesd' --user-filter 'kCFPreferencescurrentUser' --user-filter 'mobile'
cfprefsmon mobile --domain 'com.apple.softwareupdateservicesd' --user 'kCFPreferencescurrentUser' --user 'mobile'
```

Output preferences for which value has changed during monitoring:
Only output entries when values change during monitoring:

```
cfprefmon mobile --value-change
```shell
cfprefsmon mobile --value-change
```
Loading