Enter a device codename and public HTTPS link to your original oplus-services.jar, and click Start patch. Sign in to GitHub and submit the prefilled issue, then return to the patch service. The page automatically finds your submission and tracks the result; no request number needs to be copied.
Sign-in happens on github.com. The website never asks for, receives, or stores your GitHub password, and requests no access token or account permissions. GitHub login is needed to submit the request; viewing the site and downloading packages requires no login.
The job runs in this repository's GitHub Actions. Successful checks publish a public release such as rodin-mtp-patched-142.zip or rosemary-mtp-patched-143.zip, containing the patched JAR, its checksum, patch report, and usage notes. The codename names the package; it does not establish compatibility. Generated outputs are structurally checked and have not been device-tested by the service.
Requests, links, logs, and releases are public. Submit only files you can share publicly. The patch service accepts JARs without a known-input hash restriction and checks whether the source patch matches their code. Exact patch anchors and structural verification remain mandatory. The local CLI retains its default known-input hash gate. Keep your original JAR and test reversibly.
Google Drive links must allow Anyone with the link. Dropbox share links and direct HTTPS downloads are supported. Hosts that return a login, confirmation page, or virus-scan interstitial need a direct download link instead. See patch service guide for limits, deployment, and troubleshooting.
A source-only patcher for a specific compatible oplus-services.jar that fixes the native ColorOS/Oplus MTP / USB UI path on a tested POCO X7 Pro (rodin) ColorOS port.
The patch makes a real configured PC data connection appear as USB to the UI-facing Oplus battery broadcasts while keeping normal wall charging classified as AC. It does not change the real internal battery plug type.
Important
This is not a universal ColorOS patcher. The only fully verified input is the exact JAR SHA-256 listed below. Unknown builds are rejected by default.
On the tested ROM, MTP itself worked, but the native Oplus USB notification/dialog could disappear because SystemUI received chargeplugged = 1 (AC) even when the phone was connected to a PC as a data device.
This patch hooks the existing Oplus USB-state path and changes only the UI-facing value when the stock Oplus USB state reports a configured data connection.
- PC data connection: native USB/MTP notification and dialog work.
- Repeated unplug/replug: works consistently.
- Wall charger: remains AC and does not trigger the bogus USB/reverse popup observed before the fix.
- 90 W charging path remains intact on the tested build.
The proven patch flow is:
OplusUsbDeviceFeature stock USB-state receiver
|
| connected && configured
v
OplusBatteryService.neesUsbStateChanged(true)
|
v
UI-only chargeplugged: 1 (AC) -> 2 (USB)
|
v
Immediate Oplus battery UI broadcast refresh
|
v
Native ColorOS/Oplus USB UI sees a real USB connection
The patch intentionally does not use:
- SystemUI modifications
services.jarmodificationsframework.jarmodifications- Settings APK modifications
- sysfs polling
UsbManager.getPorts()polling- delayed timer retries
- permanent root-module runtime hooks
The actual internal mPlugType remains unchanged.
Known tested input SHA-256:
22f99bfdc5e9c1cab73c92ce787944c93f511e4637022c1e7a229b77d1ec3c9b
Historical proven device-tested V9 JAR SHA-256:
7df50700f7460970f434954d67b832774c38fecd66a3696eaedcdb039d9999fe
A locally rebuilt output can have a different binary SHA because smali/baksmali may emit semantically identical DEX files with different binary ordering/layout. The patcher therefore validates structural invariants and optionally performs an exact post-disassembly semantic comparison against a locally supplied proven V9 JAR.
Linux / WSL with:
bash
python3
unzip
sha256sum
smali
baksmali
Check the tools first:
python3 --version
smali --version
baksmali --versionClone the repo:
git clone https://github.com/NEESCHAL-3/NEES-OplusServices-MTP-Patcher.git
cd NEES-OplusServices-MTP-PatcherPlace your original file at:
input/oplus-services.jar
Then run:
chmod +x patch.sh
./patch.shOutput:
output/oplus-services-patched.jar
output/SHA256.txt
output/PATCH-INFO.txt
If you personally own the already device-tested V9 JAR, place it at:
reference/oplus-services-proven-v9.jar
Then run:
./patch.shFor the tested base, the strongest successful result is:
classes.dex SEMANTIC_SMALI_EXACT
classes2.dex SEMANTIC_SMALI_EXACT
SEMANTIC_REFERENCE_MATCH_OK
The reference JAR is deliberately ignored by Git and is not distributed by this repository.
By default an unknown input hash is rejected. To deliberately test another compatible build:
ALLOW_UNTESTED=1 ./patch.shThis only bypasses the known-input SHA gate. Exact smali anchors and structural validation still have to pass.
Warning
ALLOW_UNTESTED=1 does not mean the output is known safe for your ROM. Back up the original JAR and test carefully. A framework JAR mismatch can cause boot failure or system-server instability.
The patcher checks that:
- the input is a valid JAR/ZIP;
classes.dexandclasses2.dexexist;- exact expected smali anchors exist before patching;
- only
classes.dexandclasses2.dexchange; classes3.dexandclasses4.dexremain byte-for-byte unchanged when present;- the final JAR remains readable;
- an optional local proven-V9 comparison produces identical disassembled smali for target DEX files.
The final tested fix evolved through a V8 -> V9 correction. The patcher intentionally reproduces that source transformation in two stages so the public patch source follows the same logic that was device-tested.
See docs/TECHNICAL.md for the technical explanation.
The Git repository contains source only; proprietary inputs, references, and generated binaries must never be committed. The optional public patch service publishes user-requested generated packages as GitHub Release assets after verification. Only submit inputs you can share publicly. Release assets are separate from the source license and can be removed by the maintainer.
Do not commit:
input/oplus-services.jar- generated output JARs
- the local proven reference JAR
- extracted DEX files
The patcher source is released under the MIT License.
Android, ColorOS, Oplus/OPPO, POCO, Xiaomi and other names/trademarks belong to their respective owners. This project is an independent community modification and is not affiliated with or endorsed by those companies.