Skip to content

fix: resolve Bluetooth breakage on 32-bit (armeabi-v7a) devices - #734

Open
invalidsudo wants to merge 1 commit into
librepods-org:mainfrom
invalidsudo:fix/bluetooth-32bit-hook
Open

fix: resolve Bluetooth breakage on 32-bit (armeabi-v7a) devices#734
invalidsudo wants to merge 1 commit into
librepods-org:mainfrom
invalidsudo:fix/bluetooth-32bit-hook

Conversation

@invalidsudo

@invalidsudo invalidsudo commented Aug 18, 2026

Copy link
Copy Markdown

Summary

Fixes Bluetooth breakage on 32-bit (armeabi-v7a) devices when the Xposed module is enabled and scopes are active.

Root cause

The native hook implementation (l2c_fcr_hook.cpp) used fixed 64-bit ELF structures (Elf64_Ehdr, Elf64_Shdr, etc.) to resolve function symbols in Bluetooth system libraries. On 32-bit devices, these structures are mismatched, resulting in incorrect symbol offsets. Applying hooks at these invalid addresses causes the Bluetooth process to crash or malfunction, preventing Bluetooth from being turned on. Additionally, redundant calls in the BTA_DmSetLocalDiRecord hook contributed to potential instability.

Changes

  • Introduced templated ELF parsing functions to support both Elf32 and Elf64 structures.
  • Updated hookLibrary to dynamically detect the library architecture via EI_CLASS before parsing.
  • Refactored fake_BTA_DmSetLocalDiRecord to eliminate redundant calls and ensure stable status returns.

Verification

  • Verified on an armeabi-v7a device: Bluetooth remains functional and switches on/off correctly with the Xposed module and Bluetooth/Settings scopes enabled.

@kavishdevar

Copy link
Copy Markdown
Member

I thought Google removed 32bit support starting A13 (the set minsdk of the app)

@invalidsudo

invalidsudo commented Aug 18, 2026

Copy link
Copy Markdown
Author

I thought Google removed 32bit support starting A13 (the set minsdk of the app)

True, but I believe it's still a useful fix for those running low-end hardware in 2026. For example, I'm running a LineageOS 23.2 arm32/binder64 GSI on a bootloader unlocked Sonim XP3+ flip phone.

Before these changes, enabling the Xposed module caused the Bluetooth process to crash because it was using 64-bit instructions on my 32-bit device, but now it should work on both arm64 and arm32. I can use LibrePods with AirPods Pro 2 on my flip phone, which I think is pretty cool :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants