Muhou Camera (幕后录像) is an Android application focused on reliable background video recording with strong privacy, disguise, and keep-alive capabilities. It uses CameraX for high-quality capture and provides multiple ways to start/stop recording (in-app, quick settings tiles, desktop shortcuts) while supporting icon/name disguise, calculator UI camouflage, encrypted private album, loop/dashcam modes, floating preview, and extensive camera/audio settings.
Intended scope (legitimate use only):
- Personal continuous recording needs (e.g., personal security notes, travel documentation)
- Dashcam-style looping recording with optional collision lock
- Privacy-conscious local storage of recordings (private directory + optional AES encryption)
- Testing / development of CameraX + foreground service patterns on Android 9+
This project is not designed or licensed for illegal surveillance, unauthorized recording of others, or any activity that violates local laws. See the Disclaimer section.
- Background video recording via Foreground Service (
camera | microphonetype) - Support for back / front camera, optional lens type selection
- CameraX-based pipeline (Preview + VideoCapture)
- Configurable resolution (720P / 1080P / 2K / 4K), frame rate (30 / 60 / 120 fps), bitrate, encoder (H.264 / H.265 / VP8 / VP9)
- Focus mode, white balance (including manual Kelvin), night-mode strength, video stabilization, flash/torch
- Audio source selection (built-in mic / external / Bluetooth), sample rate, channels, gain, noise reduction, silent recording
- Max duration / max file size limits per segment
- Pause / resume, thermal throttle pause, low-battery / low-storage auto-stop
- Call handling (pause or continue muted)
- Loop recording & dashcam mode with configurable keep-count and collision lock (accelerometer)
- Privacy album: store videos in app-private directories (
hidden_videosor encryptedsecure) instead of public MediaStore / DCIM - Optional AES-GCM file encryption (PBKDF2 key derivation, custom
.Muhouformat) with password protection - Application password lock (with temporary lock after failed attempts)
- UI disguise: full calculator interface; long-press
=(with password if enabled) to enter real app - Launcher icon & label disguise via multiple
activity-aliasentries (Calculator, Clock, Weather, Card package, Email, Compass, Game Center, Notepad, E-book, Translator, Remote, Medical, Stock, Baidu/Xunfei/Sogou IME, etc.) - Notification icon & title disguise (same set of styles)
- Optional hiding of recording status text in notification
- Floating camera preview window (draggable, resizable, alpha adjustable) using system overlay
- Quick Settings tiles (Front / Back camera)
- Desktop pin shortcuts for front / back / toggle
- Keep-alive levels (balanced / stable / extreme) using wake lock, Wi-Fi lock, exact alarms, screen-off receiver, periodic monitor
- Boot auto-start (optional)
- One-tap permission / battery-optimization / auto-start / DND / overlay guidance
- Config export / import (JSON), log export
- Theme (follow system / light / dark), multi-language (system / Simplified Chinese / Traditional Chinese / English)
- Default: MediaStore / DCIM/Muhou (or legacy external on older Android)
- Custom SAF tree URI
- Private + encrypted paths when privacy album is enabled
| Item | Requirement |
|---|---|
| IDE | Android Studio (recent stable recommended) |
| Language | Kotlin |
| minSdk | 28 (Android 9) |
| targetSdk / compileSdk | 35 / 36 |
| JDK | 17 |
| Key libraries | CameraX 1.5.x, AndroidX (AppCompat, Material, Navigation, Preference, Lifecycle, DocumentFile, etc.), Gson |
| Permissions | CAMERA, RECORD_AUDIO, FOREGROUND_SERVICE(_CAMERA/_MICROPHONE), POST_NOTIFICATIONS, SYSTEM_ALERT_WINDOW, REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, ACCESS_NOTIFICATION_POLICY, RECEIVE_BOOT_COMPLETED, SCHEDULE_EXACT_ALARM / USE_EXACT_ALARM, storage media permissions (scoped), etc. |
Build with the provided app/build.gradle. Enable View Binding. Release minify is currently off; adjust ProGuard rules if you enable it.
-
Foreground Service + CameraX
CameraForegroundService(LifecycleService) hostsCameraManager. Recording runs in a camera/microphone-typed foreground service so the system is less likely to kill the process. Notification channel and small icon are dynamically chosen according to the selected disguise style. -
Camera binding & robustness
ProcessCameraProvider+Preview+VideoCapture<Recorder>. Lens facing / type changes trigger re-bind. Conflict / availability callbacks, retry logic, and thermal / battery / storage monitors improve reliability. Output can be File, FileDescriptor (SAF), or MediaStore. -
Privacy storage & encryption
When “privacy album” is on, files go to app-specific external dirs. If encryption is also on, temporary files are written then encrypted withFileEncryptor(AES/GCM/NoPadding, PBKDF2-HMAC-SHA256, 180k iterations, magic headerMUHOUENC1) and moved to a secure folder with.Muhouextension. Decryption requires the user password. -
Disguise
- Multiple disabled-by-default
activity-aliasentries in the manifest point toMainActivity. Only one is enabled at a time viaPackageManager.setComponentEnabledSetting. - Calculator layout (
activity_disguise.xml) intercepts normal launch; long-press on=(optionally after password entry) unlocks the real UI for the session. - Notification title/icon and shortcut icons follow the same style lists.
- Multiple disabled-by-default
-
Quick actions without UI
QuickActionActivity(translucent, noHistory, singleInstance) and Quick SettingsTileServices start the foreground service with the appropriate action, avoiding background-start restrictions on modern Android. -
Keep-alive
Partial wake lock always; higher keep-alive levels add Wi-Fi lock, exact alarms (KeepAliveReceiver), screen-off restart, and a periodic handler check.onTaskRemovedcan also restart the service under stable/extreme modes. -
Settings
Preference XML +SettingsManager(SharedPreferences-backed) drive almost all runtime behavior. Changes can be applied without full restart where possible.
# Clone / open the project in Android Studio
# Sync Gradle, then:
./gradlew :app:assembleDebug
# or install:
./gradlew :app:installDebugGrant camera, microphone, and (if used) overlay / notification / battery-optimization permissions. For best background reliability, also configure manufacturer auto-start and ignore battery optimization.
app/src/main/
├── AndroidManifest.xml # permissions, aliases, service, tiles, receivers
├── kotlin/com/muhou/mt/
│ ├── MainActivity.kt # entry, password, disguise, navigation, shortcuts
│ ├── CameraForegroundService.kt
│ ├── CameraManager.kt # CameraX + recording + sensors + loop/encrypt
│ ├── QuickActionActivity.kt
│ ├── KeepAliveReceiver.kt / BootReceiver / ShortcutReceiver
│ ├── privacy/FileEncryptor.kt
│ ├── shortcut/ShortcutServices.kt
│ ├── ui/ # Fragments (Camera, Gallery, Settings)
│ └── utils/ # SettingsManager, Logger, FloatingPreviewHelper
└── res/ # layouts, preferences, drawables, mipmap aliases, arrays
This software is provided for legitimate, personal, and educational purposes only.
- You are solely responsible for complying with all applicable laws and regulations in your jurisdiction regarding audio/video recording, privacy, and surveillance.
- Do not use this application to record people without their knowledge or consent where prohibited by law, to conduct illegal surveillance, or for any malicious purpose.
- The authors and contributors accept no liability for any misuse, data loss, device issues, legal consequences, or damages arising from use of this software.
- Disguise, encryption, and background features are intended for user privacy of the owner’s own recordings, not for concealing illegal activity.
- By building, installing, or using this project you agree that you understand the above and accept full responsibility.
Use at your own risk.
幕后录像(Muhou Camera) 是一款面向 Android 的专业后台录像应用,强调稳定后台录制、隐私保护与界面/图标伪装。基于 CameraX 实现高质量视频采集,支持前/后置摄像头、悬浮预览、循环/行车记录仪模式、碰撞锁定、加密隐私相册、应用密码、计算器界面伪装、通知栏与桌面图标伪装、快捷磁贴与桌面快捷方式等多种启动方式,并提供丰富的画质、音频与保活选项。
适用场景(仅限合法用途):
- 个人持续录像需求(如个人安全记录、旅行记录等)
- 类行车记录仪的循环录像 + 可选碰撞锁定
- 对录像文件进行本地隐私存储(应用私有目录 + 可选 AES 加密)
- 学习 / 验证 CameraX + 前台服务在现代 Android 上的实践
本项目并非为非法监控、未经同意录制他人或任何违法用途而设计。请务必阅读下方的免责声明。
- 通过前台服务(
camera | microphone类型)进行后台录像 - 支持后置 / 前置摄像头,可选镜头类型
- CameraX 管线(Preview + VideoCapture)
- 可配置分辨率(720P / 1080P / 2K / 4K)、帧率(30 / 60 / 120)、比特率、编码器(H.264 / H.265 / VP8 / VP9)
- 对焦、白平衡(含手动色温)、夜景强度、视频防抖、闪光灯/手电筒
- 音频来源(内置麦 / 外接 / 蓝牙)、采样率、声道、增益、降噪、无声录制
- 单段最大时长 / 最大文件体积限制
- 暂停 / 恢复、过热自动暂停、低电量 / 存储不足自动停止
- 通话处理(暂停或静音继续)
- 循环录制与行车记录仪模式(可配置保留数量 + 碰撞锁定,基于加速度传感器)
- 隐私相册:录像写入应用私有目录(
hidden_videos或加密secure),不进入系统相册 - 可选 AES-GCM 文件加密(PBKDF2 派生密钥,自定义
.Muhou格式)+ 密码验证 - 应用密码保护(连续错误会临时锁定)
- 界面伪装:完整计算器界面;长按
=(开启密码时需先输入正确密码)进入真实应用 - 启动图标与名称伪装:通过多个
activity-alias实现(计算器、时钟、天气、卡包、邮箱、指南针、游戏中心、记事本、电子书、翻译、万能遥控、泰康医疗、股票、百度/讯飞/搜狗输入法等) - 通知栏图标与标题伪装(同一套样式)
- 可关闭通知中的“正在录制/待机”等状态文字
- 悬浮相机预览窗(可拖动、缩放、调节透明度)
- 快捷设置磁贴(前置 / 后置)
- 桌面固定快捷方式(前置 / 后置 / 切换)
- 保活等级(均衡 / 稳定 / 极致):唤醒锁、Wi-Fi 锁、精确闹钟、息屏接收、定时检测
- 可选开机自启
- 一键权限 / 电池优化 / 自启动 / 勿扰 / 悬浮窗引导
- 配置导入导出(JSON)、日志导出
- 主题(跟随系统 / 浅色 / 深色)、多语言(系统 / 简中 / 繁中 / 英语)
- 默认:MediaStore 或 DCIM/Muhou(旧系统使用传统外部存储)
- 支持自定义 SAF 目录
- 开启隐私相册后使用私有路径(可加密)
| 项目 | 要求 |
|---|---|
| IDE | Android Studio(建议使用较新稳定版) |
| 语言 | Kotlin |
| minSdk | 28(Android 9) |
| targetSdk / compileSdk | 35 / 36 |
| JDK | 17 |
| 主要依赖 | CameraX 1.5.x、AndroidX(AppCompat、Material、Navigation、Preference、Lifecycle、DocumentFile 等)、Gson |
| 权限 | 相机、录音、前台服务(相机/麦克风)、通知、悬浮窗、忽略电池优化、通知策略、开机完成、精确闹钟、媒体读写等 |
使用项目内 app/build.gradle 构建。已开启 View Binding。当前 Release 未开启混淆,如需开启请自行完善 ProGuard 规则。
-
前台服务 + CameraX
CameraForegroundService(LifecycleService)持有CameraManager。录像在带有相机/麦克风类型的前台服务中运行,降低被系统杀进程的概率。通知渠道与小图标会根据用户选择的伪装样式动态创建与切换。 -
相机绑定与稳定性
使用ProcessCameraProvider+Preview+VideoCapture<Recorder>。镜头朝向/类型变化会触发重新绑定。结合相机可用性回调、重试逻辑、温度/电量/存储监控提升可靠性。输出支持 File、FileDescriptor(SAF)与 MediaStore。 -
隐私存储与加密
开启“隐私相册”后文件写入应用专属外部目录。若同时开启加密,则先写临时文件,再由FileEncryptor使用 AES/GCM/NoPadding + PBKDF2-HMAC-SHA256(约 18 万次迭代)加密,并加上魔法头MUHOUENC1,最终以.Muhou后缀存入安全目录。解密必须提供正确密码。 -
伪装机制
- Manifest 中声明多个默认禁用的
activity-alias,均指向MainActivity。运行时通过PackageManager.setComponentEnabledSetting只启用其中一个。 - 计算器布局拦截正常启动;长按
=(可选密码验证)后本会话进入真实界面。 - 通知标题/图标与快捷方式图标共用同一套伪装样式列表。
- Manifest 中声明多个默认禁用的
-
无界面快速启动
透明、无历史、单实例的QuickActionActivity以及 Quick Settings 的TileService负责启动前台服务并传入正确 Action,规避现代 Android 对后台启动服务的限制。 -
保活策略
始终持有部分唤醒锁;更高保活等级额外使用 Wi-Fi 锁、精确闹钟(KeepAliveReceiver)、息屏重启逻辑与定时检测。onTaskRemoved在稳定/极致模式下也会尝试重启服务。 -
设置驱动
Preference XML +SettingsManager(SharedPreferences)驱动几乎所有运行时行为,尽可能支持不重启应用即可生效。
# 用 Android Studio 打开工程并同步 Gradle 后:
./gradlew :app:assembleDebug
# 或直接安装:
./gradlew :app:installDebug请授予相机、麦克风权限,以及按需授予悬浮窗、通知、忽略电池优化等权限。为获得最佳后台稳定性,建议同时在厂商系统中开启自启动并忽略电池优化。
app/src/main/
├── AndroidManifest.xml # 权限、别名、服务、磁贴、广播接收器
├── kotlin/com/muhou/mt/
│ ├── MainActivity.kt # 入口、密码、伪装、导航、快捷方式
│ ├── CameraForegroundService.kt
│ ├── CameraManager.kt # CameraX 录制、传感器、循环与加密
│ ├── QuickActionActivity.kt
│ ├── KeepAliveReceiver.kt / BootReceiver / ShortcutReceiver
│ ├── privacy/FileEncryptor.kt
│ ├── shortcut/ShortcutServices.kt
│ ├── ui/ # Camera / Gallery / Settings 等 Fragment
│ └── utils/ # SettingsManager、Logger、FloatingPreviewHelper
└── res/ # 布局、偏好、图标、mipmap 别名、数组资源
本软件仅供合法、个人及学习研究用途。
- 使用者必须自行遵守所在地区关于录音录像、隐私与监控的全部法律法规。
- 禁止将本应用用于未经对方知情同意的录制(在法律禁止的情形下)、非法监控或任何恶意目的。
- 作者与贡献者对因使用本软件导致的任何滥用、数据丢失、设备问题、法律后果或损害不承担任何责任。
- 伪装、加密与后台相关功能仅用于保护用户本人录像的隐私,不得用于掩盖违法活动。
- 构建、安装或使用本项目即表示您已理解上述内容并愿意承担全部责任。
请自行承担使用风险。
Please add an appropriate open-source license (e.g. MIT, Apache-2.0) according to your preference. The original project does not embed a license file in the provided sources; you should decide and declare one before public distribution.
Issues and pull requests related to stability, CameraX compatibility, privacy improvements, and documentation are welcome. Please keep the focus on legitimate use cases and do not contribute features intended for illegal surveillance.
README generated from project source analysis. Last updated for the provided codebase snapshot.