Git Product home page Git Product logo

android-flashable-zip's Introduction

Android flashable zip

Boilerplate code for a flashable zip file that can be sideloaded to an Android device to make modifications to the system.

The zip directory is the directory that is to be zipped and sideloaded to the device.

The flashable.sh script is a shell script that will create the zip file and sideload it to your device.

REMARK

Sideloading the zip file to modify your Android device requires the bootloader to be unlocked. You may also need to flash/boot a custom recovery (such as TWRP).

Be aware that unlocking the bootloader of your device and modifying the system entails risks. Your device may no longer function properly, and some applications may refuse to run.

Requirements

  • No DM-verity
  • Custom recovery (e.g. TWRP)

Usage

Modify the zip/update.sh file to include the modifications you want to make to your Android device. Helper functions are available to use. See zip/utils/utils.sh for the list of helper functions.

You can also add additional files (scripts, binaries, ...) and extract them from the zip file using unzip or the helper functions.

The following partitions should be accessible in read-write:

  • /system_root (Root of the Android filesystem)
  • /system
  • /system_ext
  • /vendor
  • /product
  • /data

You therefore do not need to bother with mounting the partitions before modifying them. If for some reason the partitions cannot be mounted on your device, you will need to fix the issue in the zip/utils/mount_utils.sh file.

Once the update script has been modified, you can use the provided flashable.sh script to build the zip file and sideload it if you want:

Usage: ./flashable.sh [OPTION...]
 
Valid options: 
    -h            Print this help.
    -o ZIPFILE    Name of the flashable zip file. Default value is update.zip.
    -d DIRECTORY  Directory to include in the zip file. Default value is zip.
    -s            Sideload the flashable zip to the connected Android device.

Examples:

$ ./flashable.sh

$ ./flashable.sh -o update.zip -d ./dir -s

Files

android-flashable-zip
├── zip
│   ├── META-INF/com/google/android
│   │   ├── update-binary                 <---- First file to be executed. Prepares the installation, mounts the partitions and runs update.sh
│   │   └── updater-script                <---- Required dummy file
│   │
│   ├── utils
│   │   ├── arm64-v8a/sepolicy-inject     <---- arm64 binary of sepolicy-inject
│   │   ├── arm64-v7a/sepolicy-inject     <---- arm32 binary of sepolicy-inject
│   │   ├── x86_64/sepolicy-inject        <---- x86_64 binary of sepolicy-inject
│   │   ├── x86/sepolicy-inject           <---- x86 binary of sepolicy-inject
│   │   ├── utils.sh                      <---- Contains helper functions
│   │   └── mount_utils.sh                <---- Contains all functions related to mounting the partitions
│   │
│   ├── update.sh                         <---- Put your code in this file
|   └── ...                               <---- You can add any additional file
│ 
└── flashable.zip                         <---- Helper script to build the zip file and sideload it to the device
 

android-flashable-zip's People

Contributors

alhyoss 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.