How do some apps overcome phone recording restrictions?

孤人 提交于 2019-11-28 16:12:53

I spent many weeks working on a Voicecall Recording App so I faced all your issues/questions/problems. Moreover: my project had a low-priority so I didn't spent much time every day on it, so I worked on this App for many months while Android was changing under the hood (minor an major releases).

I was developing always on the same Galaxy Note 5 using its stock ROM (without Root) but I discovered that on the same device the behaviour was changing from one Android release to another without any explanation. For example from Nougat 7.0 to 7.1.2 I was unable to record a voicecall using the same code as before.

Google has enforced_or_changed restrictions about voicecall recording many times. At the beginning it was sufficient to use use VOICE_CALL AudioSource. Then manufactures has started to interprete this Value as they wanted, and the result was that one implementation was working well but another was not. Then Reflection was needed to run undocumented/hidden methods to start voicecall recording. Then Google has added a Runtime check, so calling them directly was not more possible even using Reflection. However this method lack of stability because it was not guarantee that a method was using the same name on all devices.

Then I started to reverse-engineer currently working Apps that were working on newer Android version and I discovered that them were using a complete different and more secure approach. This takes me many weeks because all these Apps uses JNI Libraries trying to hide this method between Assembler code. When I succesfully create a Test App which was recording well I tried the SAME code in many different devices and ROMs/Versions and surprisely it was working well. This means that all those different methods you can see in these App Settings (I'm 98% sure about it) are just "fake" or just refers to OLD methods not more used.

A small different metion should be done for Rooted devices: these devices could change AudioRoutes so a different approach can be used in this case.

[1] There isn't any list or website listing all supported devices or best method to do a successfully voicecall record

[6] It's not possibile to know which device supports Voicecall Recording just using an API call. You have to try and catch Excepions...

[8] Recording by MIC+speaker suffers of many issues: (1) the caller will hear all your ambient sound so the privacy-bug is a big issue (2) the echo is a big problem (3) the recording volume is very low as the quality of recordered voice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!