Files
MAG160C/README.md
T

68 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MAG160C 热像仪统一工程
MAG160C 热像仪(160×12015fpsUSB VID `0x833C`)的逆向工程与双端实现:
**C 参考实现**Linux/Windows,源自官方 PC SDK 逆向)与**安卓统一 App**
Kotlin + Compose,适配 Android 16,整合官方 4 个 App 的功能)。
## 从这里开始(新接手者阅读顺序)
1. `docs/android_app/HANDOFF_DEVELOPMENT.md` — 安卓 App 总交接(必读)
2. `docs/android_app/session_state.md` — 会话心跳与待办(最新进度)
3. `analysis/README.md` — 逆向工程总目录索引(Linux/Windows/Android 三条线)
4. `analysis/magcx_official_flow.md`**权威 USB 协议结论**(官方源码逐行核对版)
5. `analysis/protocol_spec.md` — 早期 PC 端协议逆向(硬件验证记录)
6. `csdk/README.md` — C SDK 文档(构建/API/工具/测试)
## 仓库结构
| 路径 | 用途 |
|---|---|
| `android/` | **安卓统一 App**Kotlin + ComposeGradle 工程,package `com.mag160c.thermal`):实时预览、拍照 MDT、录像、媒体库、离线分析、PDF 报告、任务巡检、设置 |
| `csdk/` | 纯 C SDK(官方管线 C 复刻:渲染/温度/IR 会话/FFC 调度,见 `csdk/README.md`|
| `analysis/` | 逆向工程总目录(Linux/Windows/Android 三条 SDK 线的解包产物与结论,见 `analysis/README.md`|
| `IR_Camera_SDK-1.0.1/` | 原厂 Windows/Android/Linux SDK 原始包 |
| `app/` | 官方安卓 APK 存档(普通版/专业版/ThermoScope/demo|
| `build-artifacts/` | 构建产物(安卓 APK、PC demo3、DDT 标定数据)|
| `docs/android_app/` | 安卓 App 交接文档(HANDOFF / session_state / 逆向功能总表)|
| `vendor-docs/` | 厂商资料 |
| `tools/` | 会话恢复脚本 |
## 快速入口
### 安卓 App(构建/测试)
```powershell
cd C:\Project\MAG160C\android
$env:JAVA_HOME = "C:\Tools\jdk-21"
.\gradlew.bat :app:assembleDebug test --no-daemon
# 产物:build-artifacts\mag160c-app-debug.apk
```
### C 管线复刻 demo3
```powershell
gcc -O2 -w -DMAG160C_STATIC -I"csdk\third_party\libusb\win64" -I"csdk\include" -I"csdk\src" `
-o build-artifacts\mag160c_demo3.exe csdk\tools\mag160c_demo3.c `
csdk\src\mag160c_display.c csdk\src\mag160c_error.c `
csdk\third_party\libusb\win64\libusb-1.0.x64.a -lgdi32 -luser32
Start-Process "build-artifacts\mag160c_demo3.exe" -WorkingDirectory "build-artifacts"
```
## 硬件
- 设备:MAG160C 热像仪机芯,160×120 @15fps
- USBVID `0x833C` PID `0x0001`;端点 0x03 命令 / 0x82 响应 / 0x81 图像流 /
0x84 标定文件 / 0x05 标定上传
- 协议细节:`analysis/magcx_official_flow.md`(权威)
## 里程碑
- 2026-08:官方 PC SDKlibmagcore/CoreSDKLib)逆向 + C 管线逐像素复刻(demo3)
- 2026-09-06~09:安卓 App(纯 Kotlin,无 NDK):渲染管线移植(逐字节验证)、
USB 层(官方协议 Java 源码逐行复刻)、相机式 UI、拍照/录像/媒体库/分析/PDF
- 2026-09-10:真机联调打通(根因:USB 命令字节序反转,已修复并用单测锁死);
官方 App 全量解包入库(jadx + Ghidra
## 仓库说明
仓库包含官方 SDK、反编译产物、二进制样本和抓帧数据。部分内容可能受原厂许可
限制,仅用于本项目的互操作性研究和设备调试。