MediaTek Camera RAW enablement — analyze and patch libmtkcam_metastore.so
Project description
mtkcam-raw
Analyze and patch libmtkcam_metastore.so to expose RAW capture
capabilities and RAW16 stream configurations on MediaTek camera HALs.
Install
git clone https://github.com/ReCoreShift/mtkcam-raw.git
cd mtkcam-raw
pip install -e .
Quick start
# Place the stock library in bin/ (or project root)
cp /path/to/stock/libmtkcam_metastore.so bin/
# Patch it with main sensors + RAW16 stream entries
bash bin/patch.sh
# Output: bin/libmtkcam_metastore.patched.so
# Push to device and test
bash bin/test_live.sh
Subcommands
| Command | Description |
|---|---|
inspect |
Show ELF structure, sections, and segment layout |
analyze |
Find and describe all patch sites per sensor |
patch |
Apply capabilities and/or stream config patches |
verify |
Compare original and patched binary byte-for-byte |
gen-config |
Generate a default patch.toml from a library |
Patch configuration (bin/patch.toml)
main_sensors = ["S5KJN1", "S5K3L6"]
tier = ["RAW", "MANUAL_POST_PROCESSING", "PRIVATE_REPROCESSING",
"READ_SENSOR_SETTINGS_2", "HIGH_SPEED_VIDEO"]
stream = true
[sensor_streams]
S5KJN1 = [{width = 4080, height = 3072}]
S5K3L6 = [{width = 4208, height = 3120}]
| Field | Description |
|---|---|
main_sensors |
Sensor names that get first priority for cave space |
tier |
Capabilities to append to each sensor's block |
stream |
Whether to append RAW16 stream config entries |
sensor_streams |
Per-sensor stream entries (width, height) |
How it works
-
Capability append — finds each sensor's
ANDROID_REQUEST_AVAILABLE_CAPABILITIESinit block, appends missing capabilities (RAW, MANUAL_POST_PROCESSING, etc.) via trampolines written into unused ELF gaps (PLT cave or LOAD1–LOAD2 gap). -
Stream config append — finds each sensor's
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONSinit site and appends RAW16 stream entries via trampolines, extending LOAD2p_filesz/p_memszas needed. -
Space allocation — uses a priority-sorted allocator across three cave types: PLT[0] gap, LOAD1–LOAD2 gap (extended backward), and LOAD2 trailing zero-padding (extended forward).
License
MPL-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mtkcam_raw-0.1.0.tar.gz.
File metadata
- Download URL: mtkcam_raw-0.1.0.tar.gz
- Upload date:
- Size: 38.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
331793b1c07044363b5b3f61794384994ec7c1b8002ad1f679660bf30df9e6ad
|
|
| MD5 |
8f369d48d48dde438bec843b43092d4d
|
|
| BLAKE2b-256 |
b1a7b017703e340a306a529bf0aabee29f51e100ffb23e4b5b1aebef26a21647
|
Provenance
The following attestation bundles were made for mtkcam_raw-0.1.0.tar.gz:
Publisher:
release.yml on ReCoreShift/mtkcam-raw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mtkcam_raw-0.1.0.tar.gz -
Subject digest:
331793b1c07044363b5b3f61794384994ec7c1b8002ad1f679660bf30df9e6ad - Sigstore transparency entry: 2171894638
- Sigstore integration time:
-
Permalink:
ReCoreShift/mtkcam-raw@156c76a5c0b78eeb7d5738fddb687bc70d1dae08 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ReCoreShift
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@156c76a5c0b78eeb7d5738fddb687bc70d1dae08 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mtkcam_raw-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mtkcam_raw-0.1.0-py3-none-any.whl
- Upload date:
- Size: 38.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67aae33ac17ce36e4e44bcfb82c7ecb3e1822948d42bcde63dacc03873116760
|
|
| MD5 |
45d83b06f020c75e217ea2640ee0ed4d
|
|
| BLAKE2b-256 |
334620098fd4a4e492b6f91b66c7310cec72820d947a14e8ffb42dc02f3b85f4
|
Provenance
The following attestation bundles were made for mtkcam_raw-0.1.0-py3-none-any.whl:
Publisher:
release.yml on ReCoreShift/mtkcam-raw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mtkcam_raw-0.1.0-py3-none-any.whl -
Subject digest:
67aae33ac17ce36e4e44bcfb82c7ecb3e1822948d42bcde63dacc03873116760 - Sigstore transparency entry: 2171894665
- Sigstore integration time:
-
Permalink:
ReCoreShift/mtkcam-raw@156c76a5c0b78eeb7d5738fddb687bc70d1dae08 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ReCoreShift
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@156c76a5c0b78eeb7d5738fddb687bc70d1dae08 -
Trigger Event:
push
-
Statement type: