简体   繁体   English

我可以在扎根的Android上截听音频吗?

[英]Can I intercept audio on a rooted Android?

I understand it is not possible to redirect the audio output from a pre-existing Android app - say Spotify - to a USB sound card or a file for instance. 我了解无法将音频输出从先前存在的Android应用程序(例如Spotify)重定向到USB声卡或文件。 I believe this may have had something to do with privacy and recording telephone calls. 我相信这可能与隐私和录制电话有关。

I do not understand Linux very well but know that it is very flexible and often read about piping the output of one program to the input of another. 我不太了解Linux,但知道它非常灵活,经常阅读有关将一个程序的输出管道到另一个程序的输入的知识。 I also see that in the dev directory of some Androids some “files” with names like “audio”. 我还看到在某些Android的dev目录中,一些“文件”的名称类似于“音频”。

My question is - do any of these correspond to the raw audio output and if the tablet/phone was rooted could the stream be intercepted with some Linux magic? 我的问题是-这些信号是否与原始音频输出相对应,如果平板电脑/手机扎根,则可以使用Linux魔术来拦截流吗?

My motivation is to provide a higher quality audio output than the basic speaker / headphone / bluetooth options. 我的动机是提供比基本扬声器/耳机/蓝牙选项更高质量的音频输出。

Short answer is yes, you might be able to hack something together. 简短的答案是肯定的,您也许可以一起破解某些东西。 But the audio implementation on a particular handset is completely up to the manufacturer so there is no guarantee. 但是特定手机上的音频实现完全取决于制造商,因此无法保证。 It is unlikely to be as simple as you think. 它不可能像您想的那么简单。 There is no one-line command line magic for it. 没有它的单行命令行魔术。

Android doesn't use the usual Linux ALSA user space code so you can not generalize from Linux and say "if I can do it in Linux I can do it on rooted Android". Android不使用常规的Linux ALSA用户空间代码,因此您不能从Linux泛化,而是说“如果可以在Linux中进行操作,则可以在有根的Android上进行操作”。

I think that some Android implementations use TinyALSA but this is not a requirement. 我认为某些Android实现使用TinyALSA,但这不是必需的。 If this is the case you might be able to recompile TinyALSA with your own intercept logic or interpose your device some other way. 如果是这种情况,您也许可以使用自己的拦截逻辑重新编译TinyALSA或以其他方式插入设备。 Similarly if you are running an Android mod built from source you could modify it to intercept the audio at other levels such as in the Audio Flinger or at the interface to the HAL. 同样,如果您运行的是从源代码构建的Android mod,则可以对其进行修改以拦截其他级别的音频,例如Audio Flinger或HAL的接口。 This is less practical if you are just using a rooted device since manufacturers often modify system elements with customization that might make it difficult for you to interpose and intercept (just because you don't know what to substitute if the API has been modified). 如果您仅使用带根目录的设备,则此方法不太实用,因为制造商经常使用自定义功能修改系统元素,这可能使您难以进行插入和拦截(只是因为如果API被修改,您不知道要用什么替代)。

Much of the info in this answer I gleaned from reading the Andraudio mailing list . 我从阅读Andraudio邮件列表中收集了此答案中的许多信息。 You can check the archives to learn more. 您可以查看档案以了解更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何拦截Android设备上的音频流? - How can I intercept the audio stream on an android device? 拦截已扎根的Android(Jelly Bean)中的来电 - Intercept incoming call in a rooted Android (Jelly Bean) 如何将文件从根目录复制到无根android手机的另一个目录中? - How can i copy a file from a rooted directory to another directory in a non rooted android phone prorammatically? 如果我在Android上检测到植根电话,如何禁用Activesync? - How can I disable Activesync if I detect a rooted phone on Android? 在安卓手机上捕获系统音频 - Capture system audio on an android rooted phone 在有根 Android 设备上,如何打开 &lt; 1024 的端口? - On a rooted Android device, how can I open a port < 1024? 如何在有 root 权限的手机上使用 android.permission.SHUTDOWN? - How can I use android.permission.SHUTDOWN on a rooted phone? 如何在已扎根的android手机上以编程方式停止系统服务? - How can I stop a system service programmatically on a rooted android phone? 我可以在 Android 上安装 Node.js 吗? - Can I install Node.js on Android either rooted or not? 如何手动将GPS数据发送到Android手机上的“位置管理器”(已root) - How can I manually send GPS data to Location Manager on my android phone(rooted)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM