[MOD][Magisk]MI MIX2 MIUI9 LDAC Backport Module[Abandoned]

aarwwefdds

Member
Dec 29, 2015
26
15
0
UPDATE: Download suspended due to FC with LDAC device.
UPDATE2: Status change to abandoned

Hello everyone,

I'm trying to port the LDAC capability to any MIX2 MIUI Oreo ROM. Finally I have made a Magisk Module that at least not breaking my MIX2's BT functionality and seems working on my phone. I'm on Global latest MIUI9 Dev.

Compatibility in theory:
SHOULD work on any MIX2 Oreo-based MIUI system. 8.1.18+ dev or 9.5+ stable. China or Global. Not really test it in other system yet(
Magisk 15+

Tested working codec(on my phone):
SBC
AAC
aptX
aptX HD
I can see LDAC is loaded and priority is 5001. Everything looks good except....I don't have any LDAC headset. I can't actually test LDAC.

So I hope someone with good knowledge and has LDAC headset could help me TEST THIS UNFINISH AND UNTESTED module. Thanks.

How to use it:
Install the ZIP in Magisk Manager or in recovery with Magisk installed.
Clear the "Bluetooth" cache in App manager for caution.

p.s. 1.Some detail: Started on 8.1.18 MIUI already included LDAC encoder in their ROM. But for some reason the encoder is disabled in public dev / stable ROM. The encoder is not using hardware offload(unlike SBC/AAC/aptX) so it might decrease battery life when LDAC is running. Consider what xiaomi said that's probably the reason why it disabled.
This module is done by backport the BT framework from the latest ROM.
2. Don't try it on shopping mall's DEMO headphone. For some reason those headphones in DEMO mode are forced in SBC mode.


Some story:
I bought a WH1000XM2 for module test so now I have the conditions to test the module. LDAC indeed enabled but unfortunately the bluetooth crashed second after pairing. After I dig down I found there is a small issue in the core framework: the codec append a postfix ".ldac_a2dp" in the BT headset address but the framework in the older MIUI ROM consider it's not a valid address then crash. In the latest ROM they fix it simply by allow the framework to accept this kind of address, which just a few lines of code.

However no matter how small the changes are. Patch the base framework in ART environment is almost equal to rebuild the whole system. It's like take down a building and rebuild it just for a nail. Another approach is using xposed but I don't like it because it will break safetynet. Plus clearly there're really not much people interest it so I decide abandon this project.

Anyone wish to use LDAC in MIUI can upgrade their ROM to the latest MIUI10.



WARNING: THIS IS AN UNFINISHED PROJECT, NOT FULLY TESTED AND MAY BRICK / DAMAGE YOUR DEVICES OR EVEN WORSE
By download this module you're accept following terms:

THIS MODULE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

I(Module author) am NOT RESPONSIBLE FOR ANY CONSEQUENT FROM ANYTHING YOU DONE WITH YOUR PHONE, include but not limited to bricked devices, lost warranty, lost data, dead SD cards, * thermonuclear war, or you getting fired because the alarm app failed.

This module is ONLY FOR TEST propose. Please DO NOT REDISTRIBUTE this module.

PLEASE DO NOT USE IT IF YOU NOT KNOW HOW TO SAVE YOUR PHONE FROM BRICK/BOOTLOOP.

 
Last edited: