# kenthudoan/delta-force-automatic-reward-exchange architecture

> Architecture diagram of the GitHub repository kenthudoan/delta-force-automatic-reward-exchange, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kenthudoan/delta-force-automatic-reward-exchange
- Repository: https://github.com/kenthudoan/delta-force-automatic-reward-exchange

## Overview

Đây là tiện ích Chrome Manifest V3 đổi hàng loạt code Delta Force trên trang đổi quà Garena. Luồng chính: người dùng nhập hoặc nạp code trong popup, popup phân tích và gửi lệnh tới content script trên tab Garena; content script thao tác giao diện, theo dõi kết quả và lưu tiến trình/lịch sử cục bộ. Popup còn cung cấp nhật ký, CSV, cài đặt giao diện và lịch sử; nhánh QR tạo mã ủng hộ ngoại tuyến. Sơ đồ dựa trên README và các trích đoạn đã cung cấp; popup.html, manifest.json và một số kết nối giao diện chưa được kiểm tra trực tiếp.

Main entry points: [`extension/popup.js`](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/popup.js) (Popup điều khiển), [`extension/content.js`](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/content.js) (Điều phối đổi code), [`extension/page-hook.js`](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/page-hook.js) (Theo dõi phản hồi), [`extension/qr.js`](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/qr.js) (Tạo VietQR và SVG)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Điều khiển tác vụ"]
  node_popup["Popup điều khiển<br/>[popup.js]"]
  node_parser["Phân tích code<br/>[shared.js]"]
end

subgraph group_redeem["Đổi code Garena"]
  node_content["Điều phối đổi code<br/>[content.js]"]
  node_garena["Trang đổi quà"]
  node_hook["Theo dõi phản hồi<br/>[page-hook.js]"]
  node_worker["Hẹn giờ nền<br/>[background.js]"]
  node_result_map["Chuẩn hóa kết quả<br/>[shared.js]"]
end

subgraph group_local["Lưu trữ cục bộ"]
  node_browser_store[("Lưu trữ tiện ích")]
  node_settings["Cài đặt và bản nháp<br/>[popup.js]"]
  node_job["Tiến trình đổi<br/>[content.js]"]
  node_history["Lịch sử và CSV<br/>[popup.js]"]
end

subgraph group_donate["Ủng hộ ngoại tuyến"]
  node_qr_view["Giao diện QR<br/>[popup.js]"]
  node_vietqr["Tạo VietQR và SVG<br/>[qr.js]"]
  node_qr_core["Bộ sinh QR<br/>[qrcode.js]"]
  node_qr_utf8["Hỗ trợ UTF-8<br/>[qrcode_UTF8.js]"]
end

node_user(("Người dùng"))

node_user -->|"nhập code"| node_popup
node_popup -->|"phân tích danh sách"| node_parser
node_popup -->|"gửi lệnh"| node_content
node_content -->|"điều khiển giao diện"| node_garena
node_garena -->|"phát sinh request"| node_hook
node_hook -->|"gửi kết quả"| node_content
node_content -->|"chuẩn hóa phản hồi"| node_result_map
node_content -->|"hẹn giờ chờ"| node_worker
node_content -->|"đọc ghi tiến trình"| node_browser_store
node_popup -->|"đọc ghi trạng thái"| node_browser_store
node_popup -->|"quản lý cài đặt"| node_settings
node_settings -->|"lưu thiết lập"| node_browser_store
node_job -->|"lưu tiến trình"| node_browser_store
node_popup -->|"hiển thị lịch sử"| node_history
node_history -->|"lưu lịch sử"| node_browser_store
node_user -->|"mở mục ủng hộ"| node_qr_view
node_qr_view -->|"tạo mã chuyển khoản"| node_vietqr
node_vietqr -->|"mã hóa payload"| node_qr_core
node_qr_utf8 -->|"thiết lập UTF-8"| node_qr_core
node_qr_view -.->|"nạp tiện ích mã hóa"| node_qr_utf8

click node_popup "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/popup.js"
click node_parser "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/shared.js"
click node_content "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/content.js"
click node_hook "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/page-hook.js"
click node_worker "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/background.js"
click node_result_map "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/shared.js"
click node_settings "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/popup.js"
click node_job "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/content.js"
click node_history "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/popup.js"
click node_qr_view "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/popup.js"
click node_vietqr "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/qr.js"
click node_qr_core "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/qrcode.js"
click node_qr_utf8 "https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/qrcode_UTF8.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_popup,node_parser toneBlue
class node_content,node_garena,node_hook,node_worker,node_result_map toneAmber
class node_browser_store,node_settings,node_job,node_history toneMint
class node_qr_view,node_vietqr,node_qr_core,node_qr_utf8 toneRose
class node_user toneIndigo
```

## Components

### Điều khiển tác vụ

- [Popup điều khiển](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/popup.js): `extension/popup.js`
- [Phân tích code](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/shared.js): `extension/shared.js`

### Đổi code Garena

- [Điều phối đổi code](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/content.js): `extension/content.js`
- **Trang đổi quà**
- [Theo dõi phản hồi](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/page-hook.js): `extension/page-hook.js`
- [Hẹn giờ nền](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/background.js): `extension/background.js`
- [Chuẩn hóa kết quả](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/shared.js): `extension/shared.js`

### Lưu trữ cục bộ

- **Lưu trữ tiện ích**
- [Cài đặt và bản nháp](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/popup.js): `extension/popup.js`
- [Tiến trình đổi](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/content.js): `extension/content.js`
- [Lịch sử và CSV](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/popup.js): `extension/popup.js`

### Ủng hộ ngoại tuyến

- [Giao diện QR](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/popup.js): `extension/popup.js`
- [Tạo VietQR và SVG](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/qr.js): `extension/qr.js`
- [Bộ sinh QR](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/qrcode.js): `extension/qrcode.js`
- [Hỗ trợ UTF-8](https://github.com/kenthudoan/delta-force-automatic-reward-exchange/blob/main/extension/qrcode_UTF8.js): `extension/qrcode_UTF8.js`

### Other components

- **Người dùng**

## Connections

- Người dùng → Popup điều khiển: nhập code (evidence: `README.md`)
- Popup điều khiển → Phân tích code: phân tích danh sách (evidence: `extension/popup.js`)
- Popup điều khiển → Điều phối đổi code: gửi lệnh (evidence: `extension/popup.js`)
- Điều phối đổi code → Trang đổi quà: điều khiển giao diện (evidence: `extension/content.js`)
- Trang đổi quà → Theo dõi phản hồi: phát sinh request (evidence: `extension/page-hook.js`)
- Theo dõi phản hồi → Điều phối đổi code: gửi kết quả (evidence: `extension/page-hook.js`)
- Điều phối đổi code → Chuẩn hóa kết quả: chuẩn hóa phản hồi (evidence: `extension/content.js`)
- Điều phối đổi code → Hẹn giờ nền: hẹn giờ chờ (evidence: `extension/content.js`)
- Điều phối đổi code → Lưu trữ tiện ích: đọc ghi tiến trình (evidence: `extension/content.js`)
- Popup điều khiển → Lưu trữ tiện ích: đọc ghi trạng thái (evidence: `extension/popup.js`)
- Popup điều khiển → Cài đặt và bản nháp: quản lý cài đặt (evidence: `extension/popup.js`)
- Cài đặt và bản nháp → Lưu trữ tiện ích: lưu thiết lập (evidence: `extension/popup.js`)
- Tiến trình đổi → Lưu trữ tiện ích: lưu tiến trình (evidence: `extension/content.js`)
- Popup điều khiển → Lịch sử và CSV: hiển thị lịch sử (evidence: `extension/popup.js`)
- Lịch sử và CSV → Lưu trữ tiện ích: lưu lịch sử (evidence: `extension/popup.js`)
- Người dùng → Giao diện QR: mở mục ủng hộ (evidence: `README.md`)
- Giao diện QR → Tạo VietQR và SVG: tạo mã chuyển khoản (evidence: `extension/qr.js`)
- Tạo VietQR và SVG → Bộ sinh QR: mã hóa payload (evidence: `extension/qr.js`)
- Hỗ trợ UTF-8 → Bộ sinh QR: thiết lập UTF-8 (evidence: `extension/qrcode_UTF8.js`)
- Giao diện QR → Hỗ trợ UTF-8: nạp tiện ích mã hóa
