{"id":50447698,"url":"https://github.com/suyulin/afptool-rs","last_synced_at":"2026-05-31T22:32:09.961Z","repository":{"id":185199711,"uuid":"673150416","full_name":"suyulin/afptool-rs","owner":"suyulin","description":"About Tools for Rockchip image unpack tool","archived":false,"fork":false,"pushed_at":"2026-05-22T14:06:03.000Z","size":67,"stargazers_count":35,"open_issues_count":2,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-05-22T19:42:43.713Z","etag":null,"topics":["apftool","rk","rockchip","rust","tool"],"latest_commit_sha":null,"homepage":"https://afptool-rs.aihaven.top","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suyulin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-01T01:48:57.000Z","updated_at":"2026-05-22T14:06:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"277d3f1d-7354-41c8-b1c4-3e55761f01d6","html_url":"https://github.com/suyulin/afptool-rs","commit_stats":null,"previous_names":["suyulin/apftool-rs","suyulin/afptool-rs"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/suyulin/afptool-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyulin%2Fafptool-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyulin%2Fafptool-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyulin%2Fafptool-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyulin%2Fafptool-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suyulin","download_url":"https://codeload.github.com/suyulin/afptool-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suyulin%2Fafptool-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33752286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apftool","rk","rockchip","rust","tool"],"created_at":"2026-05-31T22:32:06.803Z","updated_at":"2026-05-31T22:32:09.954Z","avatar_url":"https://github.com/suyulin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# afptool-rs\n\nA Rust tool for unpacking and packing RockChip firmware images (RKFW and RKAF formats).\n\n## Features\n\n- Unpack RKFW firmware files\n- Extract embedded RKAF update images\n- Pack RKFW/RKAF files\n- Support for various RockChip chip families (RK29xx, RK30xx, RK31xx, RK32xx, RK3368, RK3326, RK3566, RK3562, PX30)\n- Cross-platform support (Windows, macOS, Linux)\n\n## Build\n\n### Standard build\n```bash\ncargo build --release\n```\n\n### Universal macOS binary\n```bash\n./build.sh\n```\n\n### GitHub Actions\nThis project includes automated CI/CD with GitHub Actions that builds binaries for:\n- Linux x86_64\n- Linux ARM64 (aarch64)\n- macOS x86_64\n- macOS ARM64 (Apple Silicon)\n- macOS Universal Binary\n- Windows x86_64\n\nReleases are automatically created when you push a version tag (e.g., `v1.0.0`).\n\n## Usage\n\n### Unpacking\n\n```bash\nafptool-rs unpack \u003cinput_file\u003e \u003coutput_directory\u003e\n```\n\n**Unpack RKFW firmware:**\n```bash\n$ afptool-rs unpack rk.img ./out\nRKFW signature detected\nversion: 1.0.0\ncode: 0x02000000\ndate: 2025-11-06 13:33:14 (Unix timestamp: 1762435994)\nfamily: RK3562\n00000066-00072a25 BOOT                       (size: 469440)\n00072a26-10495a29 embedded-update.img        (size: 272773124)\n```\n\n**Extract embedded RKAF update image:**\n```bash\n$ afptool-rs unpack ./out/embedded-update.img ./out\nFilesize: 272773124\nmanufacturer:  RK3562\nmodel:  RK3562\n00000800-000000fb ./out/package-file\n00001000-0000021d ./out/parameter.txt\n00001800-000729c0 ./out/MiniLoaderAll.bin\n00074800-00400000 ./out/uboot.img\n00074800-00400000 ./out/uboot.img\n00474800-0000c000 ./out/misc.img\n00480800-01084800 ./out/boot.img\n00480800-01084800 ./out/boot.img\n01505000-0df1e000 ./out/rootfs.img\n01505000-0df1e000 ./out/rootfs.img\n0f423000-00800000 ./out/oem.img\n0fc23000-00800000 ./out/userdata.img\n\nPartition metadata saved to: ./out/partition-metadata.txt\n```\n\n### Run Ignored Integration Suites\n\nSome integration-style tests exercise the full CLI binary and are marked with\n`#[ignore]` to avoid running them on every `cargo test`. You can run these\ntargeted suites when you have the mocked firmware files available:\n\n```bash\n# Advanced scenarios from tests/advanced_tests.rs\ncargo test advanced_tests -- --ignored\n\n# CLI level assertions from tests/cli_tests.rs\ncargo test cli_tests -- --ignored\n```\n\nThe helpers in `tests/advanced_tests.rs` and `tests/cli_tests.rs` will generate\ntemporary RKFW/RKAF mock artifacts under `tests/data/integration`, so no\nadditional setup is required beyond ensuring the output directory is writable.\n\n### Packing\n\n**Pack RKFW firmware:**\n```bash\nafptool-rs pack-rkfw \u003cinput_directory\u003e \u003coutput_file\u003e --chip \u003cchip\u003e --version \u003cversion\u003e --timestamp \u003cunix_timestamp\u003e --code \u003ccode_field_hex\u003e \n```\n\nExample:\n```bash\n$ afptool-rs pack-rkfw ./out ./repacked.img --chip RK3562 --version 1.0.0 --timestamp 1762435994 --code 0x02000000\nSuccessfully packed RKFW image:\n  Output: ./repacked.img\n  Version: 1.0.0\n  Date: 2025-11-06 13:33:14\n  Chip: RK3562 (code: 0x32)\n  BOOT size: 469440 bytes\n  Update image size: 272773124 bytes\n  MD5: 9574d7cdf6f6a45bfaaad62f171fd185\n  Total size: 273242698 bytes\n```\n\n**Pack RKAF update image:**\n```bash\nafptool-rs pack-rkaf \u003cinput_directory\u003e \u003coutput_file\u003e --model \u003cmodel\u003e --manufacturer \u003cmanufacturer\u003e\n```\n\nExample:\n```bash\n$ afptool-rs pack-rkaf ./out repacked-update.img --model RK3562 --manufacturer RK3562\nSuccessfully packed RKAF image:\n  Output: repacked-update.img\n  Model: RK3562\n  Manufacturer: RK3562\n  Parts: 12\n  Total size: 272773120 bytes\n```\n\n**Notes:**\n- When unpacking RKAF, partition metadata is saved to `partition-metadata.txt`. You need correct metadata to pack RKAF\n- Use `--timestamp` parameter to preserve the original build timestamp for byte-perfect matching\n\n## Supported Formats\n\n- **RKFW**: RockChip firmware wrapper format\n- **RKAF**: RockChip Android firmware package format\n\n## Supported Chip Families\n\n| Chip Code | Family | Description |\n|---|---|---|\n| 0x19 | RV1109 / RV1126 | Visual AI Processor (NPU) |\n| 0x30 | PX30 / RK3326 | Industrial/Vehicle / Commonly used in early retro handhelds |\n| 0x32 | RK3562 | Entry-level tablets/educational devices post-2023 |\n| 0x33 | RK3399 / RK3399Pro | Classic high-performance hexa-core (including Pro version with dedicated NPU) |\n| 0x35 | RK3588 / RK3588S | Flagship octa-core (8K, 6TOPS NPU) |\n| 0x36 | RK3326 | (Some versions compatible with 0x30, specific ID) |\n| 0x38 | RK3566 / RK3568 | Current mainstream mid-range AIoT |\n| 0x39 | RK3528 | 4K multimedia/TV box |\n| 0x41 | RK3368 | Early octa-core 64-bit series |\n| 0x48 | RK3308 | Voice/Audio dedicated SoC |\n| 0x50 | RK29xx | Very early single-core series |\n| 0x51 | RV1108 | Early visual processing SoC |\n| 0x60 | RK30xx / RK3066 | Dual-core era |\n| 0x70 | RK31xx / RK3188 | Early quad-core (28nm classic) |\n| 0x80 | RK32xx / RK3288 | 32-bit era performance flagship |\n\n## Testing\n\n### Run Unit Tests\n\n```bash\ncargo test\n```\n\n### Run All Tests (Including Integration Tests)\n\n```bash\ncargo test -- --include-ignored\n```\n\n### Run Specific Test\n\n```bash\ncargo test test_update_header_from_bytes\n```\n\n### Test Coverage\n\nThe test cases cover the following functionality:\n\n- Parsing RKFW and RKAF file headers\n- Unpacking RKFW and RKAF files\n- Command-line interface validation\n- Error handling\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuyulin%2Fafptool-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuyulin%2Fafptool-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuyulin%2Fafptool-rs/lists"}