The master's voice monitoring menu sends COMMAND_AUDIO; the client opens a ConnAuth sub-connection with TOKEN_AUDIO_START, the server opens CAudioDlg and answers COMMAND_NEXT, then audio flows both ways. The protocol matches the Windows client, so the server needs no changes. The server's ACM format was read from Audio.cpp and AudioDlg.cpp first: WAVE_FORMAT_GSM610, 8000 Hz mono, 65-byte blocks of 320 samples (40 ms), about 1625 B/s. libgsm 1.0.13 (AOSP external/libgsm mirror) is vendored under cpp/gsm and built with -DSASR -DWAV49 so its MS-GSM packing is byte-identical to ACM GSM610. Encode and decode use separate gsm states because frame_index/frame_chain live in the state. Uplink packets are always exactly 1000 bytes: CAudio::PlayBuffer copies 1000 bytes from the buffer start regardless of packet length, so a short packet would over-read. Since 1000 is not a multiple of 65, blocks straddle packets; the stream is continuous and codec state carries over. AudioMonitor.kt owns AudioRecord (8 kHz/16-bit/mono, 320 samples a read) and AudioTrack playback of decoded downlink PCM. RECORD_AUDIO is requested with POST_NOTIFICATIONS before the projection dialog, and CaptureService adds the microphone FGS type only when held, falling back on failure. An 8-second dialog wait or missing microphone reports a tip to the master instead of failing silently. Verified on an Android 15 emulator against the Debug server: dialog opened, uplink started, server receive counter grew at ~1.6 KB/s. Downlink playback was not exercised (the test machine has no recording device); that path is code-reviewed only. Co-Authored-By: deepseek-flash
83 lines
3.7 KiB
XML
83 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||
|
||
<uses-permission android:name="android.permission.INTERNET" />
|
||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
|
||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
|
||
<!-- 语音监听(COMMAND_AUDIO):AudioRecord 采集麦克风;后台采集要求前台服务带
|
||
microphone 类型(Android 11+),类型权限在上面的 FOREGROUND_SERVICE_MICROPHONE -->
|
||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||
<!-- 在线升级:走 PackageInstaller 会话安装服务端下发的 APK,仍需系统安装器人工确认 -->
|
||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||
<!-- 卸载主机(TOKEN_UNINSTALL):ACTION_DELETE 拉系统卸载确认框,缺这个权限
|
||
UninstallerActivity 会直接报 "does not have REQUEST_DELETE_PACKAGES" 并退出 -->
|
||
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
|
||
<!-- 升级完成/需要人工确认时的提示通知(Android 13+ 是运行时权限) -->
|
||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||
|
||
<application
|
||
android:allowBackup="false"
|
||
android:extractNativeLibs="false"
|
||
android:icon="@mipmap/ic_launcher"
|
||
android:roundIcon="@mipmap/ic_launcher_round"
|
||
android:label="YAMA"
|
||
android:supportsRtl="true"
|
||
android:theme="@style/Theme.YAMA">
|
||
|
||
<activity
|
||
android:name=".MainActivity"
|
||
android:exported="true">
|
||
<intent-filter>
|
||
<action android:name="android.intent.action.MAIN" />
|
||
<category android:name="android.intent.category.LAUNCHER" />
|
||
</intent-filter>
|
||
</activity>
|
||
|
||
<!-- 远程交谈(COMMAND_CHAT):单实例,会话进行中重复拉起只走 onNewIntent -->
|
||
<activity
|
||
android:name=".ChatActivity"
|
||
android:exported="false"
|
||
android:launchMode="singleTop" />
|
||
|
||
<service
|
||
android:name=".CaptureService"
|
||
android:foregroundServiceType="dataSync|mediaProjection|microphone"
|
||
android:exported="false" />
|
||
|
||
<service
|
||
android:name=".ControlService"
|
||
android:description="@string/accessibility_service_description"
|
||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
|
||
android:exported="true">
|
||
<intent-filter>
|
||
<action android:name="android.accessibilityservice.AccessibilityService" />
|
||
</intent-filter>
|
||
<meta-data
|
||
android:name="android.accessibilityservice"
|
||
android:resource="@xml/accessibility_service_config" />
|
||
</service>
|
||
|
||
<!-- 安装会话状态回执(PendingIntent 指向本 receiver) -->
|
||
<receiver
|
||
android:name=".InstallResultReceiver"
|
||
android:exported="false">
|
||
<intent-filter>
|
||
<action android:name="com.yama.client.INSTALL_STATUS" />
|
||
</intent-filter>
|
||
</receiver>
|
||
|
||
<!-- 覆盖安装完成后,提醒用户打开 App 重新授权录屏 -->
|
||
<receiver
|
||
android:name=".ReplacedReceiver"
|
||
android:exported="false">
|
||
<intent-filter>
|
||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
|
||
</intent-filter>
|
||
</receiver>
|
||
|
||
</application>
|
||
|
||
</manifest>
|