所以我有一个 LG P920 我想修改 TI FMrX 应用程序以添加命令以通过 tinymix 路由音频这里是 shell 命令
# tinymix 6 120 # tinymix 66 7 # tinymix 67 7 # tinymix 73 2 # tinymix 74 2
二进制文件位于/system/bin/tinymix
所以我试图在java中暗示它我不确定它是否正确,但它是
public static void RouteAudioOn()
{
String MIX = "tinymix";
int DL1 = 6;
int DL1Value = 120;
int FMvol = 66;
int Headsetvol = 67'
int RightCh = 73;
int LeftCh = 74;
int SoundValue = 7;
int HeadsetValue = 8;
int LineIn = 2
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
os.writeBytes(MIX+" "+DL1+" "+DL1Value"\n");
os.writeBytes(MIX+" "+FMvol+" "+SoundValue"\n");
os.writeBytes(MIX+" "+Headsetvol+" "+HeadsetValue"\n");
os.writeBytes(MIX+" "+RightCh+" "+LineIn"\n");
os.writeBytes(MIX+" "+LeftCh+" "+LineIn"\n");
os.writeBytes("exit\n");
os.flush();
os.close();
process.waitFor();
}
public static void RouteAudioOff()
{
String MIX = "tinymix";
int DL1 = 6;
int DL1Value = 0;
int FMvol = 66;
int Headsetvol = 67'
int RightCh = 73;
int LeftCh = 74;
int SoundValue = 0;
int HeadsetValue = 0;
int LineIn = 0
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
os.writeBytes(MIX+" "+DL1+" "+DL1Value"\n");
os.writeBytes(MIX+" "+FMvol+" "+SoundValue"\n");
os.writeBytes(MIX+" "+Headsetvol+" "+HeadsetValue"\n");
os.writeBytes(MIX+" "+RightCh+" "+LineIn"\n");
os.writeBytes(MIX+" "+LeftCh+" "+LineIn"\n");
os.writeBytes("exit\n");
os.flush();
os.close();
process.waitFor();
}