L2CAP Connection Fails on Pixel 7a with Both Xposed and Magisk Methods
Device Information:
- Device: Google Pixel 7a
- Android Version: 16 (BP3A.250905.014)
- Root: Magisk
- Magisk Version 29
- Xposed Framework: ReLSPosed (v1.0.1)
- LibrePods started with v0.1.0-rc.4 and them moved to v0.2.0-alpha
Describe the bug: The LibrePods app is unable to establish an L2CAP connection to my AirPods Pro 2 on my Pixel 7a, despite trying both the recommended Xposed and Magisk module methods. The symptoms are slightly different depending on the method used.
I do have to say that own AirReps but that shouldn't be the issue here, it works fine on my Ubuntu 24.04 Maschine. And the "Pro 2 V5.2 TB" are also compatible with IOS so...
Steps to Reproduce & Troubleshooting Journey:
-
Initial State (No Fix):
- I had in ReLSPosed enabled Bluetooth (com.google.android.bluetooth) and Settings (com.google.android.settings) and used Magisks Zygisk
- The logcat shows
java.lang.SecurityException: ... has no android.permission.BLUETOOTH_PRIVILEGEDandandroid.bluetooth.BluetoothSocketException.
-
Method 1: Xposed Hook (Recommended):
- I just enabled Bluetooth and used ReZygisk dont know which fixed it
- the
BLUETOOTH_PRIVILEGEDsecurity exception is gone. - The system logs confirm the hook is active with the message:
I AirPodsHook: l2c_fcr_chk_chan_modes hooked, returning true. - Result: The connection now silently times out. The app shows the error "Your AirPods are connected via Bluetooth, but LibrePods couldn't connect to AirPods using L2CAP. Error: Socket created, but not connected." There is no longer a
No PSM availableorBLUETOOTH_PRIVILEGEDerror in the logs. This indicates the initial check is bypassed, but a deeper part of the stack is dropping the connection.
-
Method 2:
btl2capfixMagisk Module:- I disabled the Xposed module and installed the
btl2capfix(from you comment) Magisk module instead. - Result: The
BLUETOOTH_PRIVILEGEDerror is also resolved with this method. However, the connection now fails immediately with the errorandroid.bluetooth.BluetoothSocketException: No PSM available.
- I disabled the Xposed module and installed the
-
SELinux:
- I have also tested with SELinux set to
Permissive(setenforce 0), and it did not solve the issue in either case.
- I have also tested with SELinux set to
Thank you for your work on this project! Please let me know if there is any further information I can provide.
what is your setup when you collected the logs?
what is your setup when you collected the logs?
the log is with the btl2capfix Magisk module (https://github.com/kavishdevar/librepods/issues/67#issuecomment-2842353549) if that is what you ment
I am not really sure what's going on, but I can see neither of the two:
- App's logs (I can only see Bluetooth) logs,
- Something along the lines of
L2CAP Registered service classic PSM: 0x1001(0x1001 is the PSM that is used for controlling AirPods).
So, I doubt if my app is active and trying to connect. I doubt that your AirPods being fake matters, because I can't even see logs like Received Bluetooth connection broadcast. Could you try a clean install of the app, without the A16 module, and skip the onboarding (setting up hooks part). And, run the log collection?
I had a similar crash as well, this is the log I collected from your app:
_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251019_202438.txt
Could you check it out once? Im using airpods 4 on pixel 7a (A16) Also, I do get an error that the app isnt 16KB compatible. this is the screenshot:
Also I did get a notification with error that said, failed to establish connection: read failed, socket might closed or timeout, read ret: -1 Please let me know if you need any other logs! Thanks a lot for the hardwork! @kavishdevar
@shailantani you don't have the xposed hook active? There are no logs from the xposed module.
And, that 16KB alignment: i'll fix it. thanks for pointing it out! I don't run A16, and had dismissed the warning on Android Studio a long time ago.
@shailantani you don't have the xposed hook active? There are no logs from the xposed module.
I do have it enabled:
I can send logs from lsposed if that helps?
And, that 16KB alignment: i'll fix it. thanks for pointing it out! I don't run A16, and had dismissed the warning on Android Studio a long time ago.
haha no worries atall! :)
sorry, for the spam, i just opened the app and it randomly connected haha! I'll try to work out what I did. And let you know if I face a similar bug again :))
sorry, for the spam, i just opened the app and it randomly connected haha! I'll try to work out what I did. And let you know if I face a similar bug again :))
It's alright! You probably restarted your Bluetooth :) Anyway, enjoy!
I have this issue too, no PSM available, also 5.2 TB reps.
_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251118_182702.txt
_data_user_0_me.kavishdevar.librepods_files_logs_airpods_log_20251118_182702.txt
Same here, 5.4 Huilian reps, on LSPosed, it consistently complains about "MAC address must be 6 bytes"
@Xpl0itU please try https://github.com/kavishdevar/librepods/actions/runs/19412004970
@Xpl0itU please try https://github.com/kavishdevar/librepods/actions/runs/19412004970
Same notification, but app sometimes crashes when connecting to the airpods
LSPosed_2025-11-18T20_14_08.059414.zip
(Same error, just scrolling horizontally)
@Xpl0itU please try https://github.com/kavishdevar/librepods/actions/runs/19412004970
Same notification, but app sometimes crashes when connecting to the airpods
LSPosed_2025-11-18T20_14_08.059414.zip
(Same error, just scrolling horizontally)
![]()
![]()
Using LineageOS 23.0-20251114-NIGHTLY-lynx on a Pixel 7a btw, not stock OS
