diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 476ccdc..e4ec3ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,4 +60,4 @@ jobs: ${{ env.BUILD }}/build_armeabi-v7a/*.zip name: Partition Manager Tool Release ${{ env.BUILD_DATE }} tag_name: ${{ env.BUILD_DATE }} - body: "Read [RELEASE-TYPES.md](https://github.com/ShawkTeam/pmt-renovated/blob/main/RELEASE-TYPES.md) for getting more information." + body: "Read [Wiki - About Release Types](https://github.com/ShawkTeam/pmt-renovated/wiki/About-Release-Types) for getting more information." diff --git a/INSTALLING.md b/INSTALLING.md deleted file mode 100644 index bb3dccc..0000000 --- a/INSTALLING.md +++ /dev/null @@ -1,130 +0,0 @@ -# Installing And Using PMT via Termux or ADB - -This guide shows you how to use PMT with Termux and ADB. After that, you might want to read [USAGE.md](./USAGE.md)! - -## Using PMT via Termux - -This part of the guide explains how to download and install PMT with **Termux**. - ---- - -### πŸ“‹ Requirements -- Termux app from [F-Droid](https://f-droid.org/packages/com.termux) or [GitHub](https://github.com/termux/termux-app/releases). -- DO NOT INSTALL TERMUX FROM PLAY STORE! - ---- - -### πŸš€ Step-by-Step Usage - -#### 1️⃣ Prepare Termux - -If you haven't already, it's highly recommended that you allow internal storage usage. After all, I'm sure you'll want to keep your backups/flashbacks, etc., there. -```bash -termux-setup-storage -``` - -#### 2️⃣ Install PMT - -You can easily install PMT with the ready-made script! -```bash -# Download PMT's installer script for termux -curl -LSs "https://raw.githubusercontent.com/ShawkTeam/pmt-renovated/refs/heads/main/manager.sh" > manager.sh - -# Start script! -bash manager.sh install - -# Now, PMT is ready for usage if no error occurred. Try running: -pmt --help -``` - ---- - -### Do you want to uninstall...? - -Only run script via this command: -```bash -bash manager.sh uninstall -``` - ---- - -## Using PMT via ADB - -This part of the guide will show you how to use the **static** version of Partition Manager Tool (`pmt-static`) on your Android device through **ADB**. -It’s written for beginners β€” no advanced knowledge needed. - ---- - -### πŸ“¦ Why Static Version? -The **static** build of PMT contains everything it needs inside one single file. -This means you can run it directly on your Android device **without** installing extra libraries. -Perfect for quick tasks via ADB. - ---- - -### πŸ“‹ Requirements -- **ADB installed** on your computer - (Part of the Android SDK Platform Tools β€” [Download here](https://developer.android.com/studio/releases/platform-tools)) -- **USB Debugging enabled** on your phone - (Settings β†’ Developer options β†’ Enable USB debugging) -- Your **phone connected via USB** and recognized by ADB - ---- - -### πŸš€ Step-by-Step Usage - -#### 1️⃣ Get the Correct Binary -Download the **`pmt-static`** file that matches your device’s architecture: -- **`pmt-static-arm64-v8a`** β†’ For 64-bit devices -- **`pmt-static-armeabi-v7a`** β†’ For 32-bit devices - -Unzip the downloaded `.zip` file β€” you should now have a `pmt` binary. - ---- - -#### 2️⃣ Push the Binary to Your Device -Use ADB to copy the `pmt` file to your phone’s temporary folder: -```bash -# Rename for more easily usage -mv pmt_static pmt - -adb push pmt /data/local/tmp/pmt -``` - -#### 3️⃣ Open an ADB Shell -Access your device shell: -```bash -adb shell -``` - -#### 4️⃣ Change to the Directory -Move into the temporary directory where pmt is stored: -```bash -cd /data/local/tmp -``` - -#### 5️⃣ Give Execute Permission -Allow the binary to be executed: -```bash -chmod 755 pmt -``` - -#### 6️⃣ Run PMT -You can now run PMT directly from this directory: - -```bash -# Open root terminal -su - -./pmt --help -``` -Example β€” Back up the boot partition: - -```bash -./pmt backup boot -``` - -#### πŸ’‘ Tips -Commands must be run from /data/local/tmp unless you move pmt elsewhere.\ -The /data/local/tmp folder is cleared when you reboot your device.\ -Static builds are completely standalone β€” no missing library issues. diff --git a/README.md b/README.md index 1241dc1..37d6559 100755 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ PMT is designed for developers, technicians, and Android enthusiasts who need fi ## Documentation -Read [INSTALLING.md - Using PMT via Termux](./INSTALLING.md#using-pmt-via-termux) for learn installing to termux.\ -Read [INSTALLING.md - Using PMT via ADB](./INSTALLING.md#using-pmt-via-adb) for learn how to use PMT with ADB.\ -Detailed usage instructions and option references can be found in the [USAGE.md](./USAGE.md) file. +For all information about PMT, see the [wiki](https://github.com/ShawkTeam/pmt-renovated/wiki)\ +Read [Wiki - Using PMT via Termux or ADB](https://github.com/ShawkTeam/pmt-renovated/wiki/Using-PMT-via-Termux-or-ADB) for learn how to use PMT via Termux or ADB.\ +Detailed usage instructions and option references can be found in the [Wiki - Usage](https://github.com/ShawkTeam/pmt-renovated/wiki/Usage). --- diff --git a/RELEASE-TYPES.md b/RELEASE-TYPES.md deleted file mode 100644 index 69d2f7f..0000000 --- a/RELEASE-TYPES.md +++ /dev/null @@ -1,65 +0,0 @@ -# Release Types - -This project provides four different release packages, each tailored for specific Android device architectures and usage preferences. - ---- - -## The Four Release Files - -| File Name | Architecture | Bitness | Library Type | Description | -|---------------------------|-----------------|---------|----------------|----------------------------------------------------------| -| `pmt-arm64-v8a.zip` | ARM64 (ARMv8-A) | 64-bit | Dynamic (.so) | For 64-bit devices, uses dynamic libraries. Requires accompanying `.so` files (`libhelper` and `libpartition_map`). | -| `pmt-static-arm64-v8a.zip`| ARM64 (ARMv8-A) | 64-bit | Static (.a) | Fully static build for 64-bit devices. No external dependencies. Great for general use and ADB environments. | -| `pmt-armeabi-v7a.zip` | ARM (ARMv7) | 32-bit | Dynamic (.so) | For 32-bit devices, uses dynamic libraries. Requires `.so` files (`libhelper` and `libpartition_map`). | -| `pmt-static-armeabi-v7a.zip`| ARM (ARMv7) | 32-bit | Static (.a) | Fully static build for 32-bit devices. No external dependencies. Great for general use and ADB environments. | - ---- - -## Architecture & Bitness Explained - -- **ARM64 (arm64-v8a)**: - This is a 64-bit architecture used by newer Android devices. It can handle larger amounts of memory and generally runs faster for heavy tasks. - -- **ARM (armeabi-v7a)**: - This is a 32-bit architecture common on older or less powerful Android devices. It has some limitations compared to 64-bit but is still widely supported. - ---- - -## Dynamic vs Static Libraries - -The project relies on two helper libraries: -- **libhelper** -- **libpartition_map** - -### Dynamic Versions (`.so` files) - -- In the non-static (`pmt-arm64-v8a.zip` and `pmt-armeabi-v7a.zip`) packages, these libraries are **compiled as shared objects (`.so` files)**. -- This means that the main program (`pmt`) **depends on these libraries being present** on the device or alongside the executable to run correctly. -- If these libraries are missing, the program will fail to start. -- These builds are mostly for developers or users who want to customize or work closely with the libraries. - -### Static Versions (`.a` files) - -- The static packages (`pmt-static-arm64-v8a.zip` and `pmt-static-armeabi-v7a.zip`) **include these libraries inside the main executable** by linking them statically. -- This means the `pmt` binary is **completely self-contained** and **does not require any external `.so` files**. -- These versions are ideal for general users and especially convenient for ADB usage, where installing separate `.so` files might be cumbersome. - ---- - -## Which Should You Use? - -- If you want a hassle-free experience and don’t want to worry about missing libraries, **choose the static version** matching your device’s architecture. -- If you are a developer or want to experiment with the libraries separately, or save space by sharing `.so` files between multiple programs, the **dynamic version** is the way to go. - ---- - -## Summary - -| Release Type | Architecture | Dependencies | Best For | -|--------------|--------------|-----------------------|---------------------------| -| Static | 32-bit / 64-bit | None (fully standalone) | General users, ADB usage | -| Dynamic | 32-bit / 64-bit | Requires `.so` libs | Developers, advanced users | - ---- - -If you’re unsure which one to pick, try the **static version** first β€” it works out of the box on all supported devices. diff --git a/USAGE.md b/USAGE.md deleted file mode 100644 index 73470cf..0000000 --- a/USAGE.md +++ /dev/null @@ -1,253 +0,0 @@ -# Partition Manager Tool (PMT) - -**Partition Manager Tool** is a powerful command-line utility for **Android** devices, designed to perform various operations on partitions quickly, reliably, and efficiently. -This is the **renovated version** of PMT, rewritten in C++ for improved performance, stability, and usability compared to its older variant. - -It supports **asynchronous operations**, allowing multiple partitions to be processed in parallel, and includes safety measures to prevent a single error from breaking the entire operation batch. - ---- - -## Features - -- **Backup** partitions to files (with optional permissions fix for non-root access). -- **Flash** image files directly to partitions. -- **Erase** partitions by filling them with zero bytes. -- **Get** partition sizes in various units. -- **Display** partition information in plain text or JSON format. -- **Retrieve** real paths and symbolic link paths of partitions. -- **Identify** file system or image types by checking magic numbers. -- **Reboot** the device into different modes. -- **Test** sequential read/write speed of your memory. - ---- - -## Usage -Don't forget to check out how to use it with **ADB**! - -```bash -pmt [OPTIONS] [SUBCOMMAND] -``` - -### Global Options - -| Option | Long Option | Description | -|--------|------------------------|-------------| -| `-h` | `--help` | Print basic help message and exit. | -| | `--help-all` | Print full help message and exit. | -| `-S` | `--search-path TEXT` | Set the partition search path. | -| `-L` | `--log-file TEXT` | Set log file path. | -| `-f` | `--force` | Force the process to be executed even if checks fail. | -| `-l` | `--logical` | Specify that the target partition is **dynamic**. | -| `-q` | `--quiet` | Suppress output. | -| `-V` | `--verbose` | Enable detailed logs during execution. | -| `-v` | `--version` | Print version and exit. | - -**Example usages for global options:**\ -`pmt [SUBCOMMAND ...] --quiet`\ -`pmt [SUBCOMMAND ...] -S /dev/block/platform/bootdevice/by-name`\ -`pmt [SUBCOMMAND ...] [GLOBAL OPTIONS ...]` - ---- - -## Subcommands - -### 1. `backup` -Backup partitions to files. General syntax: -```bash -pmt backup partition(s) [output(s)] [OPTIONS] -``` - -**Options:** -- `-b`, `--buffer-size SIZE` β†’ Set buffer size (in bytes) for read/write operations. -- `-O`, `--output-directory DIR` β†’ Specify an output directory for backups. - -**Notes:** -- Partition names are separated by commas. -- When providing size information, you can use expressions such as 1KB, 1MB, 1GB. -- If custom output names are provided, they must match the number of partitions. -- Automatically adjusts permissions so backup files can be read/written without root. - -**Example usages:**\ -`pmt backup boot`\ -`pmt backup boot boot_backup.img`\ -`pmt backup boot,recovery,vendor`\ -`pmt backup boot,recovery -O /sdcard`\ -`pmt backup system,vendor --buffer-size=8KB # '=' is not mandatory` - ---- - -### 2. `flash` -Flash an image or multiple images to partitions. general syntax: -```bash -pmt flash partition(s) image(s) [OPTIONS] -``` - -**Options:** -- `-b`, `--buffer-size SIZE` β†’ Set buffer size (in bytes). -- `-I`, `--image-directory DIR` β†’ Directory containing image files. - -**Notes:** -- Multiple partitions and images are separated by commas. - -- **Example usages:**\ - `pmt flash boot boot_backup.img`\ - `pmt flash boot,recovery /sdcard/backups/boot_backup.img,/sdcard/backups/recovery_backup.img`\ - `pmt flash boot boot_backup.img,recovery_backup.img -I /sdcard/backups`\ - `pmt flash system,vendor system_backup.img,vendor_backup.img -I /sdcard/backups --buffer-size=8192` - ---- - -### 3. `erase` -Fill partition(s) with zero bytes (like `dd if=/dev/zero of=/dev/block/by-name/`). General syntax: -```bash -pmt erase partition(s) [OPTIONS] -``` -**Options:** -- `-b`, `--buffer-size SIZE` β†’ Set buffer size. - -**Example usages (DO NOT USE FOR TRYING!!!):**\ -`pmt erase boot`\ -`pmt erase nvdata,nvram`\ -`pmt erase system,vendor --buffer-size 8KB` - ---- - -### 4. `sizeof` -Show the size of partition(s). General syntax: -```bash -pmt sizeof partition(s) [OPTIONS] -``` - -**Options:** -- `--as-byte` β†’ Show size in bytes. -- `--as-kilobyte` β†’ Show size in KB. -- `--as-megabyte` β†’ Show size in MB (default). -- `--as-gigabyte` β†’ Show size in GB. -- `--only-size` β†’ Output only the numeric value (no partition name). - -**Example usages:**\ -`pmt sizeof boot` - Example output: `boot: 64MB`\ -`pmt sizeof boot --as-byte` - Example output: `64`\ -`pmt sizeof boot --as- --only-size` - Example output (for `--as-kilobyte`): `98304` - ---- - -### 5. `info` -Show partition name, size, and dynamic status. General syntax: -```bash -pmt info partition(s) [OPTIONS] -``` - -**Options:** -- `-J`, `--json` β†’ Output in JSON format. -- `--json-indent-size` β†’ Specify indent size of JSON string. -- `--json-partition-name NAME` β†’ Custom JSON key for partition name. -- `--json-size-name NAME` β†’ Custom JSON key for size. -- `--json-logical-name NAME` β†’ Custom JSON key for dynamic status. - -**Example usages:**\ -`pmt info boot` - Example output: `partition=boot size=100663296 isLogical=false`\ -`pmt info boot -J` - Example output: `{"partitions": [ { "isLogical": false, "name": "boot", "size": 100663296 } ] }`\ -`pmt info boot -J --json-partition-name=partitionName` - Example output: `{"partitions": [ { "isLogical": false, "partitionName": "boot", "size": 100663296 } ] }` - ---- - -### 6. `real-path` -Show the **absolute block device path** for each partition. General syntax: -```bash -pmt real-path partition(s) [OPTIONS] -``` - -**Options:** -- `--real-link-path` β†’ Tells real link path. - -**Example usages:**\ -`pmt real-path boot` - Example output: `/dev/block/sda25`\ -`pmt real-path boot --real-link-path` - Example output: `/dev/block/by-name/boot` - ---- - -### 7. `type` -Check magic numbers to determine file system or other types of partition(s) or image(s). General syntax: -```bash -pmt type partition(s) [OPTIONS] -``` - -**Options:** -- `-b`, `--buffer-size SIZE` β†’ Set buffer size. -- `--only-check-android-magics` β†’ Check only Android-related magic numbers. -- `--only-check-filesystem-magic` β†’ Check only file system magic numbers. - -**Example usages:**\ -`pmt type boot` - Example output: `boot contains Android Boot Image magic (0x2144494F52444241)`\ -`pmt type vendor_boot.img` - Example output: `vendor_boot.img contains Android Vendor Boot Image magic (0x544F4F4252444E56)` - ---- - -### 8. `reboot` -Reboot the device. Default reboot target is normal. If you are using it via ADB terminal, you **DO NOT** need root to use this feature. General syntax: -```bash -pmt reboot [rebootTarget] [OPTIONS] -``` - -**Example usages:**\ -`pmt reboot` -`pmt reboot recovery` -`pmt reboot download` - ---- - -### 9. `memtest` -Test your sequential (random tests is soon) read/write speed of your memory. -```bash -pmt memtest [testPath] -``` - -**Options:** - - `-s`, `--file-size` β†’ Specify size of test file. - - `--no-read-test` β†’ Don't do read test. - -**Example Usages:**\ -`pmt memtest`\ -`pmt memtest /data`\ -`pmt memtest -s 2GB` - ---- - -## Additional Notes - -- **Comma-separated inputs**: All commands (except `reboot`) require multiple inputs to be separated by commas. -- **Asynchronous execution**: For `backup`, `flash`, and `erase`, each partition is processed in a separate thread for maximum speed. -- **Error isolation**: A failure in processing one partition will not cancel the others. Only for `backup`, `flash` and `erase` functions. -- **Automatic diagnostics**: By default, whether a partition is dynamic or regular is determined automatically. With global options, you only specify precision. -- **Root access**: Root access is required if operations are to be performed on partitions. - -## Extra Note: Comma Usage - -In **Partition Manager Tool**, whenever you provide **multiple partitions**, **multiple image files**, or **multiple output file names**, they **must** be separated by commas (`,`), without spaces. - -βœ… **Correct:**\ -`pmt backup boot,recovery`\ -`pmt flash boot,recovery boot.img,recovery.img` - - -❌ **Incorrect:**\ -`pmt backup boot recovery`\ -`pmt flash boot recovery boot.img recovery.img` - -The **number of items must match** when providing both input and output lists. -For example, if you specify 3 partitions, you must also provide 3 output file names. - -This rule applies to **all commands except `reboot`**, since `reboot` only takes one optional argument. - ---- - -## License -Partition Manager Tool is licensed under the **Apache 2.0 License**. -Copyright Β© YZBruh. - ---- - -## Bug Reports -Please submit issues at: -[https://github.com/ShawkTeam/pmt-renovated/issues](https://github.com/ShawkTeam/pmt-renovated/issues)