描述
Commented on #188 as well, but creating a new issue as I have gathered some more potentially helpful info.
As zygisk does not work on rooted GrapheneOS, I can't (correct me if I'm wrong) use the Xposed framework. Thus I'm installing the btl2capfix module with Magisk.
I tried the module from #61 using the nightly build and got the same error mentioned in #188. I then tried investigating the module to see if it does what it has to. Android is not my expertise so my assumptions might be wrong but here are my findings (looking at the phones filesystem after module install and reboot):
- My phones bluetooth library is located at
/apex/com.android.bt/lib64/libbluetooth_jni.so. post-data-fs.shcreates an overlay mount from/data/adb/modules_update/btl2capfix/apex/com.android.bt/lib64to/apex/com.android.bt/lib64
Contents ofpost-data-fs.sh:#!/system/bin/sh mount -t overlay overlay -o lowerdir=/apex/com.android.bt/lib64,upperdir=/data/adb/modules_update/btl2capfix/apex/com.android.bt/lib64,workdir=/data/adb/modules_update/btl2capfix/apex/com.android.bt/work /apex/com.android.bt/lib64/data/adb/modules_update/does not exist, but/data/adb/modules/btl2capfix/does- With this info I tried patching the module to instead mount
/data/adb/modules/btl2capfix/apex/com.android.bt/lib64to/apex/.../lib64 - After installing the modified module I checked the sha512 hashes for both files and they didn't match +
mount | grep overlay | grep bluetoothandmount | grep apex.*btdidn't return anything to indicate an overlay mount to/apex/.../lib64 - I then tried to instead create a bind mount, that did not work as well. Then I tried the bind mount, but in
service.shinstead ofpost-data-fs.sh. This finally worked
By worked I mean the sha512 hashes of/data/adb/modules/btl2capfix/apex/com.android.bt/lib64/libbluetooth_jni.soand/apex/com.android.bt/lib64/libbluetooth_jni.somatched. I'm not sure that's the correct way to measure success in this case, but there was a change. - I copied the patched
libbluetooth_jni.sofile over to my computer to check if the patches were successful. I looked at the addresses dispalyed for both functions is the Magisk install log and both had a return at the start of the function - matching the hex incustomize.sh - Even with the now confirmed patched
libbluetooth_jni.sobind mounted into/apex/.../lib64, the same error of L2CAP connection failing persisted.
I captured troubleshooting logs with the module mentioned in #61: airpods_log_1759102497486.txt And the modified version with bind mounting and matching file hashes: airpods_log_1759102773514.txt
I am aware that this is a massive edge case as Pixel phones with A16 seem to work when using the Xposed framework. I might be the only person trying to run Librepods on a Pixel6 running rooted GrapheneOS.
I am very thankful for your continued work on this project. Let me know if I can provide any additional information.