Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ jobs:
- name: Get dependencies
run: flutter pub get

- name: Generate and check localizations
run: |
flutter gen-l10n
dart run tools/check_localizations.dart

- name: Analyze
if: runner.os == 'Linux'
run: flutter analyze --no-fatal-infos
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ coverage/
*.freezed.dart
*.mocks.dart
lib/generated_plugin_registrant.dart
lib/l10n/app_localizations.dart
lib/l10n/app_localizations_*.dart

# OS
Thumbs.db
Expand Down
70 changes: 70 additions & 0 deletions CHANGELOG.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Changelog

This file records significant changes to PM3 GUI. Version numbers follow [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Fixed

- Refresh retained command-card save confirmations after language changes,
preserving status clearing and error replacement. Replace stale translation
documentation links and describe the implemented HID reader-brute-force labels.

- Refresh retained connection errors when the language changes by storing
process error kinds and arguments, while keeping the process contract
Flutter-free and preserving terminal history without retrying the connection.

- Give HID Prox reader brute-force its own tab, heading and action labels,
without changing genuine key-recovery translations or PM3 command syntax.

- Render retained write-back status and per-block outcomes in the current
language, including active, finished, cancelled and connection-lost sequences,
without clearing results or rewriting raw terminal output.

- Report language-directory lookup failures as storage errors so startup
reaches Settings and queued saves can recover when the directory is available.

- Give the DESFire Applications tab its own resource while preserving the
editor's Apply action translation.

- Preserve the selected language when validating imported command-card drafts
and card data, without changing failed-import atomicity.

- Keep command-catalog synchronization runnable with standalone `dart run` by
adapting Flutter localizations outside the process layer.

- Keep feature-page subterminals displaying output until the page changes, a command is run again, or the page is disposed; output is no longer cut off after 5/8/10 seconds. The main terminal retains its existing display and history behavior.
- Fix commands being sent repeatedly from a single click on a feature page, and loading animations obscuring live output during execution.
- Use sequential client `rem` markers to determine when commands and the Windows handshake have completed, avoiding premature returns caused by silence, table borders and command echoes; reject concurrent sends, and no longer return partially successful results after an explicit timeout.
- Prevent invalid UTF-8 bytes from the Windows client from disconnecting the entire session.

### Added

- Added English and Simplified Chinese ARB localizations, localized framework
delegates, immediate language switching with a persistent system-default
option, locale-aware command help and dump analysis, translation checks,
bilingual UI coverage and an English README. The current catalogs contain
701 messages per language; native OS dialogs and raw client output are not
translated by the GUI.

- Synchronize 1033 terminal command entries from the current client's 96 help groups, and provide the `tools/sync_command_catalog.dart` update tool; preserve existing Chinese descriptions.

## [0.0.3] - 2026-09-04

### Added

- Add persistent desktop client settings, connection Session logs and reliable shutdown.
- Add the official Windows `pm3.bat` interactive entry point and support for connecting to physical PM3EASY512K devices.

### Changed

- Consolidate Windows/Linux builds and tag-based releases into one workflow; `v*` tags automatically generate Release artifacts for both platforms.
- Improve the download, contributing, security and GPL-3.0 licensing documentation.

### Fixed

- Fix: Correctly detect found MIFARE keys in `lib/parsers/output_parser.dart` (was incorrectly checking a numeric flag).
- Fix: Improve `sendCommandAndWait` in `lib/backend/desktop_cli/pm3_process.dart` to wait for table terminators (ensures `hf mf autopwn` full output including final key table is captured).

[Unreleased]: https://github.com/Babel36acl/Promark3-GUI/compare/v0.0.3...HEAD
[0.0.3]: https://github.com/Babel36acl/Promark3-GUI/compare/v0.0.3-alpha...v0.0.3
39 changes: 36 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,47 @@

### Fixed

- Refresh retained command-card save confirmations after language changes,
preserving status clearing and error replacement. Replace stale translation
documentation links and describe the implemented HID reader-brute-force labels.

- Refresh retained connection errors when the language changes by storing
process error kinds and arguments, while keeping the process contract
Flutter-free and preserving terminal history without retrying the connection.

- Give HID Prox reader brute-force its own tab, heading and action labels,
without changing genuine key-recovery translations or PM3 command syntax.

- Render retained write-back status and per-block outcomes in the current
language, including active, finished, cancelled and connection-lost sequences,
without clearing results or rewriting raw terminal output.

- Report language-directory lookup failures as storage errors so startup
reaches Settings and queued saves can recover when the directory is available.

- Give the DESFire Applications tab its own resource while preserving the
editor's Apply action translation.

- Preserve the selected language when validating imported command-card drafts
and card data, without changing failed-import atomicity.

- Keep command-catalog synchronization runnable with standalone `dart run` by
adapting Flutter localizations outside the process layer.

- 子终端持续显示输出,直到切换页面、重新执行命令或销毁页面;不再在 5/8/10 秒后截断,总终端保持原有显示与历史行为。
- 修复功能页面一次点击重复发送命令,以及执行中加载动画遮住实时输出的问题。
- 使用客户端 `rem` 顺序标记判断命令与 Windows 握手完成,避免静默、表格边框和命令回显导致提前返回;拒绝并发发送,显式超时不再返回部分成功结果。
- Windows 客户端的异常 UTF-8 字节不再导致整个会话断开。

### Added

- Added English and Simplified Chinese ARB localizations, localized framework
delegates, immediate language switching with a persistent system-default
option, locale-aware command help and dump analysis, translation checks,
bilingual UI coverage and an English README. The current catalogs contain
701 messages per language; native OS dialogs and raw client output are not
translated by the GUI.

- 从当前客户端 96 个帮助分组同步 1033 个终端命令条目,并提供 `tools/sync_command_catalog.dart` 更新工具;已有中文说明保留。

## [0.0.3] - 2026-09-04
Expand All @@ -32,6 +66,5 @@
- Fix: Correctly detect found MIFARE keys in `lib/parsers/output_parser.dart` (was incorrectly checking a numeric flag).
- Fix: Improve `sendCommandAndWait` in `lib/backend/desktop_cli/pm3_process.dart` to wait for table terminators (ensures `hf mf autopwn` full output including final key table is captured).

[Unreleased]: https://github.com/AKCX2002/Promark3-GUI/compare/v0.0.3...HEAD
[0.0.3]: https://github.com/AKCX2002/Promark3-GUI/compare/v0.0.3-alpha...v0.0.3

[Unreleased]: https://github.com/Babel36acl/Promark3-GUI/compare/v0.0.3...HEAD
[0.0.3]: https://github.com/Babel36acl/Promark3-GUI/compare/v0.0.3-alpha...v0.0.3
66 changes: 66 additions & 0 deletions CONTRIBUTING.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Contributing Guide

Thank you for contributing improvements to PM3 GUI. The project uses the GPL-3.0 license; by submitting a contribution, you confirm that you have the right to submit the content and agree to release it under that license.

## Before You Start

- Bug reports should include the operating system, Flutter version, Proxmark3 client source, reproduction steps and sanitized logs.
- For new features or significant behavior changes, consider opening an Issue first to describe the use case and expected interaction.
- For security issues, follow [SECURITY.en.md](./SECURITY.en.md). Do not publicly disclose vulnerability details, credentials, card UIDs or private device information.

## Local Development

```bash
flutter pub get
flutter run -d windows
```

For Linux development, change the device target to `linux`. When integrating with the official Proxmark3 distribution on Windows, select `pm3.bat` in the distribution's root directory.

Before submitting, run at least the checks relevant to your changes:

```powershell
flutter gen-l10n
dart run tools\check_localizations.dart
flutter analyze --no-pub --no-fatal-infos
flutter test --no-pub
```

Run `dart format` only on the Dart files changed in your contribution; do not change unrelated code to correct historical formatting. CI checks localization resources and builds the desktop application on both Windows/Linux; the full tests and static analysis run in the Linux job.

For changes to desktop packaging or platform code, also run `flutter build` for the corresponding platform. For changes involving real hardware behavior, state the device model, the scope of read-only/write operations and the actual validation results; do not describe simulated tests as successful real-device validation.

## Localization

English and Simplified Chinese resources are maintained in `lib/l10n/*.arb`.
Follow [the translation workflow](docs.en/localization.md), update both catalogs,
and run `flutter gen-l10n` and `dart run tools/check_localizations.dart` before
the existing analysis/tests. Never edit generated localization Dart files or
translate PM3 command syntax, protocol identifiers or raw hardware output.
Use distinct keys for different meanings even if their Chinese spelling is the
same (for example, DESFire Applications versus the editor Apply action).
New temporary model instances must inherit the active localizations before
validating user data.

Keep standalone Dart tools Flutter-free: `Pm3Process` accepts
`Pm3ProcessMessages`, while `DesktopCliBackend` injects the Flutter adapter.
Changes to its Chinese defaults must continue to match the ARB catalog.
Directory lookup/storage failures must remain visible in Settings and must not
prevent startup or poison later language saves.

Relevant regression coverage lives in `test/l10n/`, `test/ui/`,
`test/models/command_card_test.dart`, `test/services/locale_settings_store_test.dart`
and `test/tools/sync_command_catalog_test.dart`. Include the exact commands and
limitations of any validation in the PR; do not claim Linux or real-device
coverage based only on Windows widget/unit tests.

Update the corresponding HTML snapshot when changing `README.en.md` or
`docs.en/checklist_new_features.md`; regeneration instructions and document status
are in [docs.en/README.md](docs.en/README.md).

## Pull Request

- Keep changes focused, and explain the problem, solution and validation results.
- Preserve existing compatible behavior; explain the need for any new dependencies or platform differences.
- Update the affected README, CHANGELOG or architecture documentation.
- Do not commit build directories, Proxmark3 distributions, firmware, credentials or unsanitized Session logs.
35 changes: 33 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,45 @@ Linux 开发可将设备目标改为 `linux`。Windows 与官方 Proxmark3 发

提交前至少运行与改动相关的检查:

```bash
dart format --output=none --set-exit-if-changed lib test
```powershell
flutter gen-l10n
dart run tools\check_localizations.dart
flutter analyze --no-pub --no-fatal-infos
flutter test --no-pub
```

对本次修改的 Dart 文件单独运行 `dart format`;不要为修正历史格式而修改无关代码。CI 在 Windows/Linux 都检查本地化资源并构建桌面程序,完整测试和静态分析在 Linux job 执行。

涉及桌面打包或平台代码时,再执行对应平台的 `flutter build`。涉及真实硬件行为时,请说明设备型号、只读/写入范围和实际验证结果;不要把模拟测试写成实机通过。

## Localization

English and Simplified Chinese resources are maintained in `lib/l10n/*.arb`.
Follow [the translation workflow](docs/localization.md), update both catalogs,
and run `flutter gen-l10n` and `dart run tools/check_localizations.dart` before
the existing analysis/tests. Never edit generated localization Dart files or
translate PM3 command syntax, protocol identifiers or raw hardware output.
Use distinct keys for different meanings even if their Chinese spelling is the
same (for example, DESFire Applications versus the editor Apply action).
New temporary model instances must inherit the active localizations before
validating user data.

Keep standalone Dart tools Flutter-free: `Pm3Process` accepts
`Pm3ProcessMessages`, while `DesktopCliBackend` injects the Flutter adapter.
Changes to its Chinese defaults must continue to match the ARB catalog.
Directory lookup/storage failures must remain visible in Settings and must not
prevent startup or poison later language saves.

Relevant regression coverage lives in `test/l10n/`, `test/ui/`,
`test/models/command_card_test.dart`, `test/services/locale_settings_store_test.dart`
and `test/tools/sync_command_catalog_test.dart`. Include the exact commands and
limitations of any validation in the PR; do not claim Linux or real-device
coverage based only on Windows widget/unit tests.

Update the corresponding HTML snapshot when changing `README.md` or
`docs/checklist_new_features.md`; regeneration instructions and document status
are in [docs/README.md](docs/README.md).

## Pull Request

- 保持改动聚焦,并说明问题、解决方式和验证结果。
Expand Down
107 changes: 107 additions & 0 deletions PROJECT_ARCHIVE.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# PM3 GUI Project Archive — Development Notes
> Created: 2026-04-08 | This file records the project's development context to help future maintainers take over.

> **Historical snapshot, not a current feature list.** The directories, platforms,
> completion status and environment notes below are preserved from 2026-04-08;
> for current development, refer to the [README](README.en.md),
> [current architecture](docs.en/refactoring_plan.md) and [localization guide](docs.en/localization.md).

## Current Addendum After PR #27 (2026-10-22)

- The existing navigation contains 30 pages, and the interface supports Simplified Chinese and English rather than
being hard-coded for Chinese only; ARB resources and generation are in `lib/l10n/`, with 701 messages per language.
- The language can be switched immediately and is saved independently in `language.json`; import validation,
command help and Dump analysis use the selected language. Directory lookup/save failures appear in Settings,
and later saves can be retried.
- `Pm3Process` is now in `lib/backend/desktop_cli/`, supporting standalone command-help
synchronization through a pure Dart message contract; Flutter localization adaptation stays at the backend boundary.
- The officially supported desktop scope is Windows/Linux x64. Android, themes and unfinished items below are
historical records only; do not infer the current support scope or make renewed claims of completed real-device validation from them.

---

## Project Status Summary (Historical Record)

- ✅ Flutter project created, with all 19 Dart source files (3198 lines)
- ✅ Entire interface localized into Chinese
- ✅ Linux build validation passed
- ✅ Android USB OTG configuration completed
- ✅ Git repository (2 commits)
- ⚠️ Not actually run in an environment with a display (the remote headless environment lacks GPU drivers)

## Architecture

**CLI Wrapper** — The GUI does not implement the PM3 hardware protocol directly; it starts and interacts with the PM3 command line through `dart:io Process`.

```
User action → AppState → PM3Process.sendCommand(stdin)
↓
PM3 CLI stdout → OutputParser (regex)
↓
Structured data → notifyListeners → UI
```

**Advantage**: PM3 firmware/CLI updates do not affect GUI compatibility.

## Code Navigation

| Feature | Entry File | Description |
|------|----------|------|
| Application startup | `lib/main.dart` | Provider injection |
| Global state | `lib/state/app_state.dart` | Connection/terminal/card/theme |
| PM3 communication | `lib/services/pm3_process.dart` | Process pipes |
| Command templates | `lib/services/pm3_commands.dart` | All PM3 commands |
| Output parsing | `lib/parsers/output_parser.dart` | UID/ATQA/SAK/block/key regex |
| Dump parsing | `lib/parsers/dump_parser.dart` | Automatic .eml/.bin/.json detection |
| Data models | `lib/models/mifare_card.dart` | CardType + MifareCard |
| Access control | `lib/models/access_bits.dart` | Access-bit decoding |
| Home navigation | `lib/ui/home_page.dart` | Bottom navigation with 6 pages |
| Theme | `lib/ui/theme.dart` | Material 3 dark/light |

## Feature Pages

1. **Connection** — PM3 path + serial port selection + connection status
2. **Terminal** — Full-featured terminal + 7 shortcut buttons
3. **Dump Viewer** — Open/view/export MIFARE dump files
4. **High Frequency (Mifare)** — Detection/attacks/read and write/magic cards (4 tabs)
5. **Low Frequency** — General/EM4x05/T55xx (3 tabs)
6. **Settings** — Theme/path/about/maintenance

## To Do

- Signal waveform visualization (fl_chart added but not used)
- Dump file editing
- iClass / Legic / NTAG / DESFire pages
- Command autocomplete + persistent history
- Internationalization framework (currently hard-coded Chinese, no arb files)
- Unit tests
- Actual Windows/Android testing

## Environment Requirements

```bash
# Flutter
export PATH="/opt/flutter/bin:$PATH"
flutter pub get

# Linux build dependencies
pacman -S gtk3 # Arch

# Build
flutter build linux # Output build/linux/x64/release/bundle/
flutter build apk # Android

# Run
flutter run -d linux
```

## Notes

- The global gitignore (`~/.gitignore_global`) may exclude `lib/`; `!/lib/` at the end of the project's `.gitignore` overrides this.
- Android USB OTG configuration is in `android/app/src/main/AndroidManifest.xml` and `xml/usb_device_filter.xml`.
- PM3 VID:PID = `9ac4:4b8f`

## References

- [wh201906/Proxmark3GUI](https://github.com/wh201906/Proxmark3GUI) — Qt C++ reference implementation
- [RfidResearchGroup/proxmark3](https://github.com/RfidResearchGroup/proxmark3) — PM3 firmware/CLI
17 changes: 16 additions & 1 deletion PROJECT_ARCHIVE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
# PM3 GUI 项目存档 — 开发笔记
> 创建时间: 2026-04-08 | 此文件记录项目开发上下文,便于后续接手

> **历史快照,不是当前功能清单。** 下文保留 2026-04-08 的目录、平台、
> 完成状态与环境记录;当前开发请以 [README](README.md)、
> [架构现状](docs/refactoring_plan.md) 和 [本地化指南](docs/localization.md) 为准。

## PR #27 后的当前补充(2026-10-22)

- 现有导航包含 30 个页面,界面支持简体中文和英语,不再硬编码为仅中文;ARB
与生成流程位于 `lib/l10n/`,当前每种语言 701 条消息。
- 语言可立即切换并独立保存于 `language.json`;导入验证、命令帮助和 Dump
分析按所选语言工作。目录查找/保存失败会在设置页提示,后续保存可重试。
- `Pm3Process` 当前位于 `lib/backend/desktop_cli/`,通过纯 Dart 消息契约支持独立
命令帮助同步;Flutter 本地化适配保留在后端边界。
- 正式桌面范围是 Windows/Linux x64。下文 Android、主题和待完成条目只代表历史记录;
不能据此推断当前支持范围或重新声称已经完成实机验证。

---

## 项目状态总结
## 项目状态总结(历史记录)

- ✅ Flutter 项目创建完成,所有 19 个 Dart 源文件(3198 行)
- ✅ 界面全中文本地化
Expand Down
Loading