An auto-porter that builds a HyperOS ROM for OnePlus phones. It supports HyperOS 2, 3 and 4 as the donor and combines it with a OnePlus stock ROM:
vendorandodmcome from the OnePlus stock ROM, so the hardware stack stays OnePlus.system,system_extandproductcome from the HyperOS donor, withmi_extmerged in.
The output is an uncompressed zip containing system.img, system_ext.img,
product.img, vendor.img and odm.img.
It runs the same way locally or from GitHub Actions. The device-specific values
(FOD geometry, resolution, density, marketname, camera) live in devices/, so
adding a device is a config file, not a code change.
Disclaimer: use this at your own risk. I am not responsible for any issues, data loss, or bricked phones that result from flashing these builds. Keep a working recovery/fastboot path and a backup before you flash.
| Device | Codename | Status |
|---|---|---|
| OnePlus 13 | PJZ110 |
✅ Fully Supported |
| OnePlus 15 | PLK110 |
Linux x86_64.
./requirements.shThis installs the dependencies on Arch, Debian, Ubuntu and Fedora and fetches
payload-dumper-rust. If it can't be fetched, the porter falls back to a
built-in Python payload extractor, so it still works offline.
./port.sh --device OnePlus13 --stock <oneplus-stock> --hyperos <hyperos-rom>--device is required (a folder name under devices/, e.g. OnePlus13 or OnePlus15).
--stock and --hyperos accept a URL, an OTA/fastboot/recovery zip, a
payload.bin, or a directory of raw .img files. The finished zip lands in
out/.
Options:
--device <name> target device (required): OnePlus13, OnePlus15
--name <basename> output zip basename (default: HyperOS-<device>-port)
--out <dir> output directory (default: out)
--work <dir> working directory (default: work)
--res <dir> overlay directory (default: RES)
--keep-work keep the working tree instead of cleaning it up
port.sh is the entry point. It's mostly Bash, and calls small Python helpers
under lib/ for the parts that are cleaner in Python — SELinux config synthesis
(lib/erofs_config.py), the payload fallback (lib/payload_extractor.py) and
the Google Drive download (lib/gdrive.py).
- Fork this repo.
- For the automatic pixeldrain upload, add your key under Settings → Secrets
and variables → Actions as
PIXELDRAIN_API_KEY. - Open the Actions tab, pick Build HyperOS for OnePlus, and Run workflow.
- Choose the device, then paste the OnePlus stock ROM link and the HyperOS link.
The finished zip is attached to the run as an artifact. The Upload to pixeldrain toggle (on by default) also uploads it and prints a share link; if the secret is missing or the upload fails, the build still succeeds.
Each device is a folder under devices/<name>/:
devices/OnePlus13/
device.conf # scalar values (below)
device_features.xml # copied to <ro.product.device>.xml
displayconfig/display_id_<panelid>.xml # brightness / refresh / density map
device.conf:
name=OnePlus 13
model=PJZ110
status=Fully Supported
density=600
miui_resolution=1440,3168,480
fod_location=628,2200
fod_size=184,184
fod_target=616,2388,824,2616
marketname=一加 13
camera_gdrive_id=<google drive id of that device's MiuiCamera.zip>The porter overlays the folder's displayconfig and device_features.xml (the
latter renamed to the port's detected ro.product.device), then writes the
scalar values into the right build.props (FOD, density and resolution) and the
odm attestation (marketname). To add a device, copy an existing folder and drop
in that device's verified values — FOD coordinates and the displayconfig are
panel-specific, and the displayconfig filename must be that device's real panel
id (read it from a dump). Reusing another device's values is what "untested"
means.
A straight port of HyperOS onto a OnePlus boots with several things broken. This porter bakes in the fixes:
- Under-display fingerprint (FOD). Adds the FOD geometry props, the
enrolment gate (
vendor.fingerprint.cali=1), the fingerprint permission xml labelledvendor_configs_file, and the SELinux property contexts so system_server can read the props and the fingerprint HAL can set its own. Without these there's no way to enrol, or enrolment dies withinvalid cali data. - 120 Hz. Vendor display props plus the product refresh-rate config and device-features flags.
- Brightness curve and boot hang. A brightness map that starts above the panel minimum makes the brightness spline blow up and the phone hang on the boot animation. The bundled display config starts at the real panel minimum.
- Status bar icon tint.
debug.layered.strategy.phone=99. - Camera. The ported MiuiCamera is replaced with a working build, which the
porter downloads into
RES/automatically (it's too big for git).
Not fixed here: face-unlock enrolment freeze (needs Settings.apk edits) and
slightly buggy fullscreen AOD.
- Extract OnePlus
vendorandodmfrom the stock ROM. - Extract HyperOS
system,system_ext,productandmi_ext. - Fold
mi_ext/productintoproductandmi_ext/systemintosystem/system. - Merge
mi_ext/etc/build.propintoproductandsystem/system, dropping the hugero.vendor.build.ab_ota_partitionsline. - Add MIUI home/dexopt props to
system/system/build.prop. - Tag
ro.mi.os.version.incremental. - Move
product/pangu/systemintosystem/system. - Append the OnePlus vendor props (the
# end of fileblock + FOD) tovendor/build.prop. - Add the Xiaomi attestation block to
odm/build.propand stripimportlines. - Remove
ro.vendor.oplus.sensor.high_pwm_rgb. - Add the density and status-bar props to
product/etc/build.prop. - Delete
system_ext/priv-app/qcrilmsgtunneland the portedproduct/priv-app/MiuiCamera.
Then it applies the RES/ overlays and the device overrides, regenerates the
EROFS fs_config / file_contexts, repacks each partition, and writes the zip.
RES/ holds files copied over the assembled tree, mirroring the partition
layout — RES/product/... goes into product, RES/vendor/... into vendor.
After the copy, the SELinux metadata is regenerated for the new files (a file
under vendor/etc/permissions correctly becomes vendor_configs_file). Line-
based edits (build.prop props, SELinux property contexts) live in fixes/ and
are shared by both front-ends.
- MIO Kitchen — the erofs and image tools in
bin/. - payload-dumper-rust — payload extraction (reads the ROM zip directly).
- XMAPort and HyperOS-Port-Python — references for the porting flow.
- tqmane — for some help.
Fixes worked out by palaziks. If you reuse them, keep the credit.
GPLv3. See LICENSE.