[CLOSED] Record phone call "downlink" side only? [WITH ROOT] - Android Software/Hacking General [Developers Only]

Hi,
I'm trying to record phone calls as .wav files but I want to record the other side only. I tried using Axet's Call Recorder, but I have many issues with it. I installed the recorder as a system app in /system/priv-app and gave it all permissions. However, I noticed that no matter what source I choose (be it "voice line", "auto" or "system RAW"), it always picks up my mic and the recording would be silent if I hit mute. I have seen other apps that supposedly give you more control over what is recorded but I have yet to find one that works as intended. My solution must: 1. record the actual audio output completely digitally and be purely the "downlink" side only, i.e. what plays through the earpiece/speaker but at the level before it actually plays, and 2. be compatible with all android versions regardless of what permissions it may need.
First, I'd like to know what the source should actually be - the digital source for the output audio that guarantees purity and highest quality.
Second, I'd like to know if there is an app that does just that or otherwise what do I need to create one myself.
Keep in mind full root access is available and modding too.
Any help is appreciated tremendously!

Note: Questions go in Q&A Forum
If you are posting a Question Thread post it in the Q&A forum. Technical discussion of Android development and hacking. No noobs, please. Device-specific releases should go under the appropriate device forum...
forum.xda-developers.com

Related

[Q] SIP / VoIP Client Codecs

Hi all,
This thread pertains to the inbuilt Internet Calling feature on Gingerbread. By default, it uses g.711 but I use an audio broadcast unit which requires g.722.
Is anyone able to help me, with finding out where the prefs are for the default SIP client, and how to enable g.722 as Mon codec de preference?
Many thanks
Perhaps I should post this in Dev...
Well, according to the rules, I'm not allowed to post a development based question in the dev forum. Apparently "If it's not about a ROM, it's not allowed in the development area" - perhaps the 'Dev' area should be renamed 'ROMs', and a separate Development Area should be opened?! That way, serious questions won't get overlooked and moved down so quick with the masses of repeated questions from new members.
Anyway - thats my rant...
Here's my actual question - reposted:
Hi folks
OK, this isn't ROM related as such, but it is definitely development related, hence posting here. I'm not a programmer, but I know my way around config files etc. usually. What I'm trying to find out, is this:
Can I adjust the 'built-in' VoIP Client to use a different codec? There's no options available in software, but the config for the client must be somewhere - question is, WHERE would it be? If anyone can point me in the right direction, I'll report my findings
There's a few VoIP things I want to customise, but using the native client, rather than a third party app.
I'm not after a spoon-fed solution - just the clues where to look so I can sort it out.
Many thanks
Just unzip any ROM and look inside,
That would spare you own phone and you can check every single file.
Btw, apk are zip files as well...
I've had a look around, but still haven't found the right things.
I guess the 'Internet Calling' function is part of the main 'phone' app, but I can't find any settings or config files for this.
It should be such a simple change to make; but I'm stuck at the first hurdle!!

[Completed] Helping the blind see with the vOICe for Android and external video camera

Hi there,
I'm new to this android stuff, I use a... Uh, okay I use a different phone...
I'm blind and am exploring android with one goal... To see again. Okay, maybe that was a little over blown but let me explain before asking for some help from you lovely people.
There is an app called 'the vOICe', by seeing with sound, their home page here:
(Noticed I can't post links, do a search for seeing with sound and the voice and you'll find the one, it's also on the app market, just don't mistake it for the app accompanying the TV series...)
Who are using a system to help blind see. In a nutshell, it scans an image from left to right and layers sound using different frequencies to represent the image. I'm sorry if I'm a bit vague about this as I've not really had a chance to fully experiment with it. In short, it turns visual images into sound and it would appear that some fantastic results are coming from it and actual stimulation of the visual cortex is happening. In effect, the android device is the a to d, and the user's brain is the d to a. Amazing.
The problem is, currently it's not very usable. It can process a live stream from a video camera built into an android device but, of course, no one wants to wonder around with a 6 inch sudo-tablet strapped to their forehead. There was some excitement with the idea of google glass, however, aside from it not coming to light, I'd not really want to spend several hundred pounds on a device which I can use for just one thing. Okay, now the specifics...
I want to be able to route a webcam, or a similar camera into an android device, the device to accept the images from the camera and to process them into sound using the vOICe app. From what I understand from the Doctor who is pushing this forward and the inventor of the system, android does not yet allow external cameras to act as the native camera device. Can you help?
My perfect rig, and I'm making the huge assumption that it's the rig that most blind people would settle for, is the phone in my pocket, a hat or headband containing a camera, and a pair of headphones, preferably bone conduction as they give better awareness.
My question, my request is for someone to help make my device accept a video camera through usb and use the vOICe app to process the image.
Thank you in advance.
Olz
PS... I'm new to all of this, so I apologise if I've posted in the wrong place. If admins could move this post to the right place if I have messed up, I'd be very grateful.
O
Hi, Thanks for using XDA assist
There is a general forum for android here http://forum.xda-developers.com/android/help where you can try to ask to get expert's help.
Good luck.

[DEV] Porting call audio injection behavior from Google Pixel Dialer to AOSP Dialer

I'm working on a personal modding project, where I take the AOSP Dialer and add some features that I'd like to have. Long story short, for a component of this, I need to figure out how Google has been able to inject arbitrary audio into the conversation/call audio stream.
For years, discussion online, and especially on Stack Overflow, has insisted that:
There are too many upstream limitations, this is impossible
This is impossible, you have to play it over the speaker and hope the microphone picks it up
You can't do this, even Google says so
Indeed, even Google's up-to-date MediaPlayer documentation clearly shoots this down and doesn't mince words:
You cannot play sound files in the conversation audio during a call.
Click to expand...
Click to collapse
However, we know this isn't true. At least, not anymore, and not on Pixel devices. Google's Call Screening feature can "talk" to someone calling your phone, but that synthesized audio is never played audibly to the user. In other words, Google has been able play a Text-To-Speech stream of audio to someone calling your device, doing so silently, clearly to the listener, and without requiring the handset speaker or user's microphone to be "on."
Despite the fact that this is "possible" by virtue of "it has already happened," I can't find any discussion, documentation, info, or anything helpful about how Google has been able to do this. So, what do you do?
The next logical step is to start decompiling the app, but that's easier said than done. I'm by no means an expert in reverse engineering Android apps. Admittedly, you could consider me a beginner. Still, I've found a few things that seem useful, so here's what I've been able to find:
First off, when compared to the AOSP Dialer, the Google Dialer requires an additional privapp-permission that may be of interest: android.permission.MODIFY_AUDIO_ROUTING. I can't find much about what this permission does or how it is used, but it's definitely used by the Google Dialer, and on a stock Pixel 3 XL ROM, that permission is defined in /product/etc/permissions/privapp-permissions-google-p.xml as a privapp-permission.
Next, when decompiling the app, one of the first things I noticed is that a special "IMPL" package containing a playInternal function is class injected/loaded dynamically, and it's adjacent to MediaPlayer code that seems to play audio over a certain channel. The class it tries to load is:
Code:
com/android/dialer/audio/impl/CallAudioPlayer
However, that package isn't present in the list of decompiled classes (there's no "audio" folder under "dialer"), and despite playInternal being explicitly called by a string, there aren't any other classes that seem to define the playInternal function.
I don't know where XDA stands on posting decompiled code, but if you're using JADX, the area of interest is in defpackage/bhk.java.
But if I'm correct, this means that:
You can use MediaPlayer to play over the call stream, contrary to Google's documentation; you just need a special IMPL that allows for that behavior
This (probably?) requires the aforementioned MODIFY_AUDIO_ROUTING permission
If one were to obtain/locate and re-implement CallAudioPlayer.java, you could probably reproduce this behavior in the AOSP Dialer, or any other system app with the necessary permissions
If I'm not correct, then chasing down CallAudioPlayer will be a dead end. Still, the fact stands that Google did this somehow, so the answer must be somewhere.
So... that's where I'm at with this. I don't feel like I'll get much further without some help from more knowledgeable people, since I don't know where this CallAudioPlayer class is located. If it's in the base apk, but obfuscated, I can't find it. And if it's in a system framework or overlay APK, it must be using a different name, since no instances of CallAudioPlayer or playInternal exists in any of the relevant .apks on my system.
If this requires more sophisticated Android system/API modifications, that's fine too. This will end up on a custom ROM, so even if part of this behavior extends outside of the APK, any potential solution can be implemented in an AOSP ROM to achieve this functionality.
If you have any advice on how this may have been done, I really appreciate any and all discussion I can get on this. And if you don't know, I encourage you to ask a friend or someone who might be more knowledgeable when it comes to reverse engineering. Even if no one outright knows the answer to this, I hope to get at least some recent discussion on this topic, so that people investigating this in the future will at least have some sort of starting point.
Thanks for reading!
Hi. I'm no expert on Android (far from that haha) or Reverse Engineering. Though, I'm making an assistant installed as system app in a rooted Android and can also be compiled with the hidden and internal methods and classes so they can be used, like ITelephony, for example (https://github.com/anggrayudi/android-hidden-api) - btw, have you tried to mess with those classes and methods? (Sorry for my ignorance, I've no idea how it is to code/recode a ROM, what you need to use and stuff.) And anyways, I found something you didn't mention up there, so I'm unsure if you already know or not. From what Google says here (https://support.google.com/phoneapp/answer/9118387) in the "Screen calls manually" section, "Your Google Assistant screens the call and ask who's calling and why. You'll get a real-time transcript of how the caller responds.". Though, if it's their assistant doing that, not sure why that permission is on Dialer and not only on the assistant. Anyways, maybe that could be a good place to look at?
EDIT: Maybe also you (or anyone, of course) could look at sending DTMF tones over the call (I only made a quick search on Google, but there may be more that could help on this?). I think it's the same thing as it's inserting audio into the call. Though I can't be sure - btw, if it's really sending audio, then any Dialer app can already do that! But may not be that simple, so no idea at all. Maybe that's hardware thing and not software (>95% probable?). Just trying to give to ideas on where more to research.
Here (https://issuetracker.google.com/issues/36906273#comment107) it's said "I found this app, that can send dtmf after the call is made and active: https://play.google.com/store/apps/details?id=mobi.drupe.app (...)" - name: "drupe - Contacts & Caller ID" (just in case the app gets deleted from PlayStore and then people don't have their name to search for, only the package). If it's audio that it's being injected then it's possible, since that app seems to do it already, and the answer could be there too and might be good to look for the keys' frequencies on the code? Again, sorry for my ignorance on anything wrong I said. As I said in the beggining, I'm far from expert/experienced on Android.
I'll also be trying to search on how to send DMFT tones over a phone call. Could help, maybe. And if only a frequency could be sent for any reason, at least it's already cool to send some beep haha (preferably different from the ones of the keys or it might be confused with a key press by the other side, depending on who we're calling).
Late reply, did you solve this? I would like to build call features on Aosp. Best!

[CLOSED] Forcing calls to go through A2DP in Android, while using the phone's built-in microphone.

Hello,
This issue has been driving me insane. It seems like some simple, artificial limitation that no one seems to circumvent. As the title suggests, I'm trying to force phone calls and especially VoiP calls (Discord, whatsapp..etc), to go through the high bitrate A2DP profile instead of the horrible HSP/HFP profile that butchers audio quality and uses the horrible bluetooth microphone.
For instance when music is streamed through a bot in Discord i have to listen to it in horrible earpiece-level phone call quality.
I feel like there's got to be a tweak, a Magisk module, a custom ROM functionality with root access that allow for this, something.. I found a couple old XDA posts about this but no solutions. Oh and also tried Lesser AudioSwitch on multiple Android versions, none worked.
It seems inherent to all bluetooth headphones which is a shame, they could cost 10k $, but the quality would still be sh*t in calls, both in and out, since mic is not close to the mouth.
I always loved Android for giving users more control, but sadly seems like this is more and more going away. What i want here, can very easily be done on PC.
Thank you for your time reading, really hope someone can help.
xdarobb said:
Hello,
This issue has been driving me insane. It seems like some simple, artificial limitation that no one seems to circumvent. As the title suggests, I'm trying to force phone calls and especially VoiP calls (Discord, whatsapp..etc), to go through the high bitrate A2DP profile instead of the horrible HSP/HFP profile that butchers audio quality and uses the horrible bluetooth microphone.
For instance when music is streamed through a bot in Discord i have to listen to it in horrible earpiece-level phone call quality.
I feel like there's got to be a tweak, a Magisk module, a custom ROM functionality with root access that allow for this, something.. I found a couple old XDA posts about this but no solutions. Oh and also tried Lesser AudioSwitch on multiple Android versions, none worked.
It seems inherent to all bluetooth headphones which is a shame, they could cost 10k $, but the quality would still be sh*t in calls, both in and out, since mic is not close to the mouth.
I always loved Android for giving users more control, but sadly seems like this is more and more going away. What i want here, can very easily be done on PC.
Thank you for your time reading, really hope someone can help.
Click to expand...
Click to collapse
Note: Questions go in Q&A Forum
If you are posting a Question Thread post it in the Q&A forum. Technical discussion of Android development and hacking. No noobs, please. Device-specific releases should go under the appropriate device forum...
forum.xda-developers.com

[CLOSED] Voice only interface on Android 12

Hello all,
Android 12 makes building a voice only interface tough. The user has to click the phone call button after I trigger the intent action. Does anyone know work arounds to this? I'm considering modifying my own ROM, but I wouldn't know where to start. My first place to look is PackageManager and ActivityManager. I might try and delete some of the safeguards. I am not making a mass market app, I'd like to modify the software then sell the hardware with my mod'd software on it to someone. I just want to make android run like alexa with some sauce, not trying to listen in unless the user wakes up the phone.
Thanks!
rpikus27 said:
Hello all,
Android 12 makes building a voice only interface tough. The user has to click the phone call button after I trigger the intent action. Does anyone know work arounds to this? I'm considering modifying my own ROM, but I wouldn't know where to start. My first place to look is PackageManager and ActivityManager. I might try and delete some of the safeguards. I am not making a mass market app, I'd like to modify the software then sell the hardware with my mod'd software on it to someone. I just want to make android run like alexa with some sauce, not trying to listen in unless the user wakes up the phone.
Thanks!
Click to expand...
Click to collapse
Note: Questions go in Q&A Forum
If you are posting a Question Thread post it in the Q&A forum. Technical discussion of Android development and hacking. No noobs, please. Device-specific releases should go under the appropriate device forum...
forum.xda-developers.com

Categories

Resources