1

I want to record a call that is called by my application for the call test purposes. We record a call and compare it with a high-quality WAV file to determine the call quality. But the call recording APIs are not working anymore in the latest Android. For testing, we provide a rooted device to the client. So, I am thinking if we can record a call at the system level.

I have already tried it with Superpowered SDK on Android Q but no luck.

I have found a Magisk Module called callrecorder-skvalex which is already doing what I need.

If anyone can list the steps that are required to achieve this goal, I will be very thankful to him.

Vatish Sharma
  • 1,001
  • 4
  • 21
  • 36
  • I'm not sure what do you mean by "Linux code" (do you mean code/script run on Linux, but not Android?), but take note that app development is off-topic on Android.SE since its focus is more to end-users, not developers. – Andrew T. Jan 09 '20 at 12:38
  • I mean a c executable(ELF shared object, 64-bit LSB arm64, dynamic (/system/bin/linker64), stripped) that can run on Android-Linux. – Vatish Sharma Jan 09 '20 at 13:39
  • 1
    The section 'Why SoX won't work?' of this answer may be helpful for you in understanding the background: https://android.stackexchange.com/a/217522/2241 – Robert Jan 09 '20 at 13:46
  • 1
    Permissions part can be handled with root access, so capturing mic should be possible from commandline. But the even more complex part (I think) would be the sharing of audio input and output devices (mic and earphone). Otherwise [email protected] which interfaces Android framework won't be able to capture and play. Sharing is possible using native tools (like ALSA's pcm.multi if I'm not wrong) but I don't think that would be possible without integrating with Android's native/Java framework. – Irfan Latif Jan 09 '20 at 17:54
  • 1
    A simple approach is to build/use a privileged app with CAPTURE_AUDIO_OUTPUT permission that uses Android's Java/native APIs and doesn't have to take care of sharing itself: https://developer.android.com/guide/topics/media/sharing-audio-input#voice_call_ordinary_app. That's what callrecorder-skvalex is doing. Some apps also make use of Accessibility feature. – Irfan Latif Jan 09 '20 at 17:55
  • I have made an app with Java MediaRecorder API and made my app a system app by following https://pastebin.com/jTDVyfLa and then reboot the system. When I start recording on call then I get these errors: https://pastebin.com/LuxkrX1X Do you have any suggestion to fix it? – Vatish Sharma Jan 31 '20 at 12:10

0 Answers0