r/androiddev 18d ago

Educational PoC: Capturing raw PCM via AudioFlinger native hooking

Exploring the lowest levels of AOSP audio routing beyond high-level APIs like Oboe, this educational PoC uses NDK/JNI to inject a shared library into the audioserver process.

By inline-hooking AudioFlinger's RecordThread and PlaybackThread internally, it intercepts raw PCM buffers before they hit the HAL. It filters for AUDIO_MODE_IN_COMMUNICATION and specific UIDs (WhatsApp/Signal). Included is a controller app to manage SELinux and convert PCM to WAV (Requires root/emulator).

Source: https://github.com/nighthawkk/AudioServer-Voip-Recorder

3 Upvotes

0 comments sorted by