[Android] XPosed module causes bluetooth to crash, and a few bugs in the UI
Thank you very much for developing this software.
However, I encountered some issues while using it. Specifically, after connecting my AirPods Pro 2, the app freezes and shows a white screen. I've recorded a screen capture for you to check.
https://drive.google.com/file/d/1-18340XgRy8e5Qk22XaWIyGmrHf-Nzjy/view?usp=sharing
I'm using the latest version of KernelSU for root management and have already flashed the Bluetooth module. My system is ColorOS 15, based on Android 15.
Additionally, I have already granted all the necessary permissions, including root access.
Hey!
Could you please share the logs? Use logcat to get all logs.
Force kill the app, disconnect airpods, open app, start logs, and the connect your airpods. Wait for a few seconds and then stop the logs.
Use logcat >> /sdcard/aln.txt to save logs to a file
I tried to reproduce the issue and captured the logs. Please check if they are helpful.
https://drive.google.com/file/d/1glQ8cfpI-mJaabLQ3gWgjek0AcRmLgj7/view?usp=sharing
Also, since I don't have any Apple devices, the firmware of my AirPods Pro 2 has never been updated.
Ah, seems like the module isn't actually taking any effect. Please try this LSPosed version. Uninstall the module, and the existing app, and then install this. you will need to give the app root permissions first, and then enable the recommended scopes in the LSPosed app. You might need to reboot after installing and going through the onboarding process.
Also, please share files by uploading it here - and not google drive. thanks!
Thank you for your reply. However, the LSP module still cannot function properly.
Here are the steps I followed: I extracted the installation package you sent, installed the APK, authorized it in LSPosed, granted it root access, rebooted the phone, opened the app, granted all the requested permissions, and then tried connecting my AirPods Pro 2. However, after installing the module, my AirPods Pro 2 could no longer connect properly to the phone. In the system’s Bluetooth settings, it kept showing "Connecting."
When I tried to connect the earbuds, the app did trigger a pop-up, but the battery level still showed as 0%. I recorded a video and captured logs for your reference. the logs:
the captures:
https://github.com/user-attachments/assets/e5b8dc93-6b5c-4bfb-861c-aaba0d3e87c4
Additionally, before trying the LSP module, I had already tested the Magisk module on another phone, but it still didn’t work properly. The steps I followed were: flashing the Bluetooth module, installing the APK, rebooting the phone, granting the necessary permissions to the APK, opening the app, and then turning on the AirPods Pro 2. Although this phone didn't experience the white screen issue, it still constantly showed that the earbuds were not connected. A pop-up would appear, but the battery level was displayed as 0%. I recorded a video for your reference. Similarly, I captured logs using ADB for your reference. Since I don't have any Android development experience, I followed instructions from GPT to learn how to capture the logs, so the log files might be quite large — I apologize for any inconvenience. This phone is running hyperos 1.0, which is based on Android 13. Additionally, I have confirmed that my AirPods Pro 2 are genuine.
the logs:
the capture:
https://github.com/user-attachments/assets/a315c272-ffc0-46bf-aa11-62b3f6eae906
the logs are perfect. here's what you could try for the lsposed version:
run su -c setprop persist.aln.cfg_req_offset ''. and reboot your phone.
And for the hyperos, try this apk.
p.s. the app is called LibrePods now.
I tried running this command with root privileges and confirmed that the value is now empty. However, after rebooting, the issue still persists, with the exact same behavior as before (on Android 15). new log:
Additionally, I just tried updating the app (LibrePods) and confirmed that the value(persist.aln.cfg_req_offset) is still empty. However, it still doesn't work properly. I still can't connect to my earbuds — when trying to connect, the system’s Bluetooth service automatically restarts. The app does show a pop-up(sometime not show), but the battery level is not displayed. Overall, the symptoms are exactly the same as before. P.S. The new app icon looks great!
I did some more testing over the past couple of days and finally discovered the reason why the app isn't working — it seems to conflict with two specific modules:
Zygisk Next: https://github.com/Dr-TSNG/ZygiskNext
Shamiko: https://github.com/LSPosed/LSPosed.github.io/releases (a root-hiding module developed by the LSPosed team)
If Shamiko is enabled, AirPodsLikeNormal cannot function properly under any circumstances. If Zygisk Next is enabled with the “Enforce DenyList” option checked, AirPodsLikeNormal also cannot work properly no matter what I try. Only when Zygisk Next is enabled without the “Enforce DenyList” option checked, and the device is rebooted, can AirPodsLikeNormal function correctly.
However, disabling “Enforce DenyList” causes root to be detected by many apps, which leads to various security-sensitive apps (such as banking apps) no longer working properly.
I understand this may not be an issue directly caused by AirPodsLikeNormal itself, but I still wanted to ask: is there any possible workaround? Is there any way for AirPodsLikeNormal to work alongside these two modules? Thank you very much for your help.
P.S. I tested both the latest release version (Magisk module) and the Xposed module you shared with me in this issue, and both have compatibility issues with the above-mentioned modules.
That's very weird. Honestly, I have never needed Shamiko for anything, so I had not tested it. But, I do have ZygiskNext installed; with the enforce denylist enabled and it did work.
And from the logs - the Bluetooth process kept on crashing with BUS_ADRALN. So, I'm curious how ZN and Shamiko could possibly mess in a way that it crashes this way. In hindsight, it might be possible that the function(s) hooking might have different signatures; but it seems unlikely that OnePlus/Oppo would modify the stack to this extent.
If you are able to, then could you please test out the latest nightly release with the root module with denylist enforced in ZN, but shamiko disabled? Thanks!
I tested the latest nightly version, and the issue still persists. When I enable Zygisk Next with the “Enforce DenyList” option checked (and Shamiko disabled), AirPodsLikeNormal still freezes with a white screen after launching.
However, when I disable the “Enforce DenyList” option and reboot the phone, AirPodsLikeNormal works successfully.
I recorded a video and captured logs—hopefully they’ll be helpful. It seems that the nightly version didn’t include an updated module, so I only updated the app itself.
logs:
alnnightly1.txt alnnightly2.txt
https://github.com/user-attachments/assets/5a86b599-8461-4e4e-af0f-6d316a0ccfd0
what's the second log? seems neither the module nor the xposed module were active.
It seems that the nightly version didn’t include an updated module, so I only updated the app itself.
Yeah, just the nightly app, with the root module from v0.0.3 (not xposed)
Both of these logs were captured while using the nightly version, during which the app failed to work properly—I recorded the issue twice.
I’ve confirmed that the Magisk module was activated. If the logs show it as not activated, I suspect it might be due to a conflict with the Zygisk Next module.
In this situation, as long as I disable the “Enforce DenyList” option in Zygisk Next and reboot the phone, AirPodsLikeNormal starts working normally.
The latest release still has this issue. Even after I disabled all other modules except for LSPosed and the Zygisk Next module (with “Respect denylist” unchecked), it still doesn't work.
All the tests mentioned below were performed with all unrelated Xposed modules disabled, root access granted to LibrePods, and only LSPosed and the Zygisk Next module enabled (again, with “Respect denylist” unchecked).
After enabling the module, my AirPods can no longer connect to my phone. Every time I try to connect them via Bluetooth, the Bluetooth service automatically restarts. Also, LibrePods shows a popup, but it doesn't display any battery level.
Here’s the log:
Is there any chance this issue could be fixed? How can I help? I’m happy to assist with testing or provide logs.
I haven't really changed anything in the release. It's basically the same hook as I shared here before. And, as expected the problem remains the same - a SIGBUS (SIG_ADRALN). I would've loved to help with this. But I am just not sure why this is happening.
Also, does the app now not work even with ZN's Enforce denylist disabled and the Shamiko module disabled? Because I really haven't changed the xposed part of the code.
Yes, it’s really strange. I just tested the Xposed version you previously shared in this issue, and it no longer works either. My phone recently received a system update, and I’m not sure if that’s what caused it.
I really want to do something for help, but I don’t know much about Android development. If there’s anything I can do, please let me know.
Hi, I'm having the same issues with the blank screen on the following device: M2012K11AG (Poco F3), Android 13 TKQ1.220829.002 (MIUI by xiaomi.eu 14.0.8.0.TKHCNXM), Magisk 28.1 + Zygisk - LSPosed v1.10.1 (7115) + ReZygisk v1.0.0 RC1. Zygisk + Enforce DenyList are activated. Airpods 4 ANC
When I toggle off the Endorce DenyList option in Magisk, aln/librepods opens and can detect my airpods, but nothing works inside the app
Is there anything I can do to help troubleshoot this problem?
Hi, I'm having the same issues with the blank screen on the following device: M2012K11AG (Poco F3), Android 13 TKQ1.220829.002 (MIUI by xiaomi.eu 14.0.8.0.TKHCNXM), Magisk 28.1 + Zygisk - LSPosed v1.10.1 (7115) + ReZygisk v1.0.0 RC1. Zygisk + Enforce DenyList are activated. Airpods 4 ANC
When I toggle off the Endorce DenyList option in Magisk, aln/librepods opens and can detect my airpods, but nothing works inside the app
Is there anything I can do to help troubleshoot this problem?
Could you share logs? Just with logcat >> /sdcard/l2c.txt.
Yes, it’s really strange. I just tested the Xposed version you previously shared in this issue, and it no longer works either. My phone recently received a system update, and I’m not sure if that’s what caused it.
Possibly because of the update.
I really want to do something for help, but I don’t know much about Android development. If there’s anything I can do, please let me know.
I would love to help too, but there isn't much I can do with heavily modified skins like hyperos... :(
But, given that it worked at least once, it probably means that a system update probably messed up something. You could try patching it yourself and disabling the xposed module because that is probably what is causing the problem (data type error) and see how that goes. (You could share the lib and I'll give you the root module.)
~I had this issue on my CMF Phone too. I fixed it for me by setprop persist.librepods.peer_info_req_offset "". I am not quite sure why this could be causing a problem, but do give it a try, @fsoceityC!~
Nevermind, I changed something else too that fixed, removing this prop is not going to fix it. Please try the latest release and let me know if it works. Thanks!
Thank you so much for your help—the latest version is amazing! It is working properly now.
I did notice a few bugs:
1.If I open the app first and then connect the earbuds, the AirPods popup still appears without showing any battery level. Also, the app still shows that the earbuds are not connected. I have to close and reopen the app for it to detect them properly. (So the earbuds need to be connected before launching the app.)
2.The in-ear detection feature only works while the app is in the foreground. If I switch it to the background for more than five seconds (without killing the process), removing the earbuds no longer pauses the music.
3.It seems that “Conversational Awareness” and the “Pause music while talking” feature aren’t working as expected.
4.I tried flashing the without patch version of the module, hoping it would enable battery display—but it still didn’t work. Then I uninstalled it and tried to flash the with patch version instead, but the installation failed. Maybe I misunderstood how to use it?
5.The Noise Control off option disappeared after a while.Now I only see three modes available. I remember there used to be four. I'm not sure if this is a bug.
Since the main issue is resolved now, should I open a new issue for these bugs?
Also, could you tell me how the main issue was fixed? I’d love to learn more about Android development.
Finally, thank you so much!
Thank you so much for your help—the latest version is amazing! It is working properly now.
Great to see that!
1.If I open the app first and then connect the earbuds, the AirPods popup still appears without showing any battery level. Also, the app still shows that the earbuds are not connected. I have to close and reopen the app for it to detect them properly.
Got it. I usually never keep my app open unless I need to poke around settings, so I completely missed this – will fix it in the next release. And, same for the popup. I made sure that it didn't show old saved battery information when the popup is shown. And only show it if the new battery info is available/sent by the AirPods.
(So the earbuds need to be connected before launching the app.)
They do not need to be, just the app (UI) doesn't need to be open. The service will detect it anyway.
2.The in-ear detection feature only works while the app is in the foreground. If I switch it to the background for more than five seconds (without killing the process), removing the earbuds no longer pauses the music.
Might be your OS. Try to disable battery optimizations.
3.It seems that “Conversational Awareness” and the “Pause music while talking” feature aren’t working as expected.
What's exactly do you mean by "Conversational Awareness doesn't work"? Maybe try toggling that setting from the AirPods settings.
4.I tried flashing the without patch version of the module, hoping it would enable battery display—but it still didn’t work. Then I uninstalled it and tried to flash the with patch version instead, but the installation failed. Maybe I misunderstood how to use it?
What do you mean by "battery display"? In the popup? Also, sicne the xposed version works, please do not use the with-patch variant. :)
5.The Noise Control off option disappeared after a while.Now I only see three modes available. I remember there used to be four. I'm not sure if this is a bug.
Not a bug! Just enable the Off listening mode settings in the AirPods settings screen and it will show up in the main settings, and "Press and Hold" as well.
Since the main issue is resolved now, should I open a new issue for these bugs?
Nah, It's alright. I think this would be a great opportunity to use the Sub-issues features :D
Also, could you tell me how the main issue was fixed? I’d love to learn more about Android development.
Basically I had added a few lines that uses the parameter passed to the l2c_fcr_chk_chan function. It used to work for me, but it probably doesn't work because google might've changed something, or I accidentally messed up :|
The culprit: https://github.com/kavishdevar/librepods/commit/58dfed97b333107e0e13d9c88fa0af23e9d120d5#diff-2a24647fa5344a835e470bb9ead95bab72faf40c148385cd5ff18521eec1f98cL134
Finally, thank you so much!
Thank you for helping out with the logs!
@krugdenis try the latest release and let me know if it works.
@krugdenis try the latest release and let me know if it works.
Tried it, the app no longer freezes, but airpods connected to bluetooth only after a few attempts.
Battery level and other options are inactive.
How can I filter the logcat output to provide you only what's needed to debug this?
Maybe it's because app supports only AirPods Pro (2nd Gen)
@krugdenis did you try rebooting after installing and going through the setup process? Also, try resetting hook offsets from the app settings.
How can I filter the logcat output to provide you only what's needed to debug this?
Just do logcat >> /sdcard/librepods.txt. Disconnect, force stop, start logs, open the app, and connect your airpods.
Maybe it's because app supports only AirPods Pro (2nd Gen)
No, it is not because of that. :]
Also, please create a new issue. Because this seems to be fixed for the OP.
They do not need to be, just the app (UI) doesn't need to be open. The service will detect it anyway.
Does this mean the app can auto-start? Even though I’ve granted it auto-start permission, I still have to manually open the app once after each reboot to make it work properly.
(It would be great if features like auto-start, background keep-alive, and hiding from the recent apps view could be added.)
Might be your OS. Try to disable battery optimizations
This was indeed the issue, thanks for pointing it out.
What's exactly do you mean by "Conversational Awareness doesn't work"? Maybe try toggling that setting from the AirPods settings.
~~The "Conversational Awareness" option is described in the app as reducing media volume and background noise when speaking.~~ The "Pause Music" option is described as pausing music when speaking. ~~However, with both options enabled, speaking does not trigger any of these effects.~~ Sorry, it seems that only the "Pause Music While Talking" feature is not working. "Conversational Awareness" does work when using the Adaptive mode.
What do you mean by "battery display"? In the popup? Also, sicne the xposed version works, please do not use the with-patch variant. :)
According to the description on the release page, the purpose of the Magisk module is to send battery information to the system so that the battery status can be viewed in the system UI (this is the battery display I’m referring to). If the "without patch" version doesn’t work, I thought the "with patch" variant might be needed. Maybe I misunderstood how it’s supposed to work.
found a few more bugs:
-
Removing both earbuds disconnects the Bluetooth connection, and normally they should reconnect automatically when put back on. However, sometimes they fail to reconnect unless I manually turn Bluetooth off and on again. Could you add a toggle to disable the automatic disconnection when both earbuds are removed, and only keep the single-ear pause music behavior?
-
The UI in the control center seems to have incorrect proportions — I suspect this is a bug. Also, the top and bottom popups are quite unstable: sometimes they show up, sometimes they don’t, and their proportions look off as well. Could you provide a toggle to disable these popups?
EDIT: Removed redundant photo (It took too long to scroll :/ )
Does this mean the app can auto-start? Even though I’ve granted it auto-start permission, I still have to manually open the app once after each reboot to make it work properly. (It would be great if features like auto-start, background keep-alive, and hiding from the recent apps view could be added.)
You can remove the app from recents. And there is a on boot listener, you can check the permissions. It should show run on boot.
Removing both earbuds disconnects the Bluetooth connection, and normally they should reconnect automatically when put back on. However, sometimes they fail to reconnect unless I manually turn Bluetooth off and on again. Could you add a toggle to disable the automatic disconnection when both earbuds are removed, and only keep the single-ear pause music behavior?
Yeah, the Bluetooth stack gets pretty confused if device with A2DP profile available is connected, but it is not actually connected to audio. I'll add that option.
The UI in the control center seems to have incorrect proportions — I suspect this is a bug. Also, the top and bottom popups are quite unstable: sometimes they show up, sometimes they don’t, and their proportions look off as well. Could you provide a toggle to disable these popups?
Weird. I'll do some testing. Thanks for pointing it out!
According to the description on the release page, the purpose of the Magisk module is to send battery information to the system so that the battery status can be viewed in the system UI (this is the battery display I’m referring to). If the "without patch" version doesn’t work, I thought the "with patch" variant might be needed. Maybe I misunderstood how it’s supposed to work.
By "if the without patch doesn't work" I meant, if the XPosed backed hooking didn't work. After installing the module without patch, can you reboot and see if you are able to uninstall the app? System apps should not be uninstallable.
Sorry, it seems that only the "Pause Music While Talking" feature is not working. "Conversational Awareness" does work when using the Adaptive mode.
I suspect the status/packet AirPods send when transparency is enabled might be different that if adaptive. You might be able to see that status difference in the debug screen.
For reference, here's how the control center thingy looks on my device-
You can remove the app from recents.
I can't close it — once I do, all features stop working. For example, in-ear detection stops functioning, and the battery display in the notification bar disappears as well.
(I also encountered a bug causing extremely high resource usage. I’ll open a separate issue for that.)
By "if the without patch doesn't work" I meant, if the XPosed backed hooking didn't work. After installing the module without patch, can you reboot and see if you are able to uninstall the app? System apps should not be uninstallable
Yes, I checked — it cannot be uninstalled and has become a system app. However, the battery display still doesn’t show up in the system’s Bluetooth interface.
For reference, here's how the control center thingy looks on my device
That looks much better!
I can't close it — once I do, all features stop working. For example, in-ear detection stops functioning, and the battery display in the notification bar disappears as well.
Probably another hyperos thing. check dontkillmyapp.com. I am also quite new to Android development. I am not sure if there something specific that needs to be done app-side to prevent this. It works just fine on stock Android.
Yes, I checked — it cannot be uninstalled and has become a system app. However, the battery display still doesn’t show up in the system’s Bluetooth interface.
Could run dumpsys package me.kavishdevar.librepods | grep BLUETOOTH_PRIV and tell me if it shows granted?