Code Monkey home page Code Monkey logo

cleanmotoimg's Introduction

ConvertSparsechunk2Img

  • ConvertSparsechunk2Img is designed to assist in converting Android system.img files from sparsechunk format to raw img format, removing certain headers and footers specific to Moto devices in the process.
  • CleanMotoImg will simply remove the Motorola headers from a system.img.raw file, if you have already performed sparsechunk conversion

Prerequisites

  • simg2img - A tool to convert sparse images to raw images.
  • ddrescue - A data recovery tool which can copy data from one file or block device to another.
  • Bash Shell

Usage

  1. Clone the Repository: Clone this repository to your local machine or download the script file directly.

    git clone https://github.com/FroggMaster/CleanMotoImg.git
  2. Navigate to the Directory: Change your current directory to where the script is located.

    cd path/to/script/directory
  3. Provide Necessary Permissions: If required, provide execution permission to the script.

    chmod +x ConvertSparsechunk2Img.sh
  4. Execute the Script: Run the script with the following command:

    ./ConvertSparsechunk2Img.sh

Functionality

The script performs the following operations:

  1. Sparsechunk Conversion:
    • Utilizes simg2img to convert the Android system image from sparsechunk format (system.img_sparsechunk.*) to raw image format (system.img.raw).
  2. Remove Moto Header:
    • Utilizes ddrescue to remove the Moto header from the raw image by skipping the first 131072 bytes.
  3. Remove Moto Footer:
    • Utilizes ddrescue to remove the Moto footer from the modified system image by removing the last 4096 bytes.
  4. Clean Up:
    • Removes intermediate raw image (system.img.raw), sparsechunks (*sparsechunk.*), and renames the final cleaned system image to system.img.

Notes

  • This script assumes the presence of simg2img and ddrescue in your system's PATH.
  • Ensure you have sufficient permissions to execute the script and write to the directories where the script operates.
  • Always make sure to have backups of your sparsechunks before performing any modifications, they will get deleted once the process completes.
  • You obviously need to have sparsechunk files to convert into .img format.
  • The resulting img file should be readable VIA 7-zip

cleanmotoimg's People

Contributors

froggmaster avatar

Stargazers

Stanley Hansen avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.