A powerful, user-friendly Linux script for unpacking and repacking Android images with full filesystem support, SELinux context preservation, and seamless automation. Like CRB Kitchen, but native to Linux with cross-distro compatibility and advanced CI/CD features.
- Unpack Android Images: Extract partitions from
.imgfiles to editable directories - Modify Files: Edit system files, apps, configurations, etc.
- Repack Images: Rebuild bootable Android images with your changes
- Super Image Support: Handle complex multi-partition
super.imgfiles - Filesystem Conversion: Convert between ext4, EROFS, and F2FS formats
- SELinux Preservation: Maintain security contexts for bootable images
- Automation Ready: Generate configs automatically for CI/CD pipelines
# Interactive mode
sudo ./android_image_tools.sh
# Automated mode with config
sudo ./android_image_tools.sh --conf=config.conf- Place your
.imgfile inINPUT_IMAGES/ - Run the tool and select "Unpack an Android Image"
- Edit files in the extracted directory
- Select "Repack a Directory" to rebuild
- Find your new image in
REPACKED_IMAGES/
| Feature | Description |
|---|---|
| Open Source | Free, transparent, and community-driven |
| Cross-Distro Compatible | Ubuntu/Debian + Fedora/RHEL |
| Filesystem Support | ext4, EROFS, F2FS |
| SELinux Preservation | Maintains Android security contexts |
| Interactive GUI | Easy terminal menu interface |
| Auto Config Generation | No manual config creation needed |
| CI/CD Ready | Full automation support |
| Super Image Handling | Multi-partition Android images |
| Compression Options | LZ4, LZ4HC, Deflate algorithms |
| Filesystem Conversion | Convert between any supported formats |
| Sparse Image Support | Automatic format handling |
| Smart Cleanup | Automatic temp file management |
- Root access (sudo required)
- Architecture: x86_64 (AMD64) based system required
- Supported Distributions: Ubuntu/Debian-based or Fedora/RHEL-based Linux distributions
- Linux kernel with loop device support (preferred method, provides best performance and SELinux compatibility)
- FUSE support (fallback option for restricted environments, but buggy/limited in SELinux environments)
Required packages are installed automatically
- Unpack an Android Image: Extract single partition images
- Repack a Directory: Rebuild images from extracted folders
- Generate Config File: Create automation templates
- Advanced Tools: Super image operations
- Cleanup Workspace: Remove temporary files
The tool eliminates manual config creation:
sudo ./android_image_tools.sh
# Navigate: Repack a Directory β Complete setup β "Export selected settings"Creates a ready-to-use config file automatically.
sudo ./android_image_tools.sh
# Navigate: Unpack an Android Image β Complete setup β "Export selected settings"
# Or: Advanced Tools β Super Image Kitchen β Unpack a Super Image β "Export selected settings"Creates reusable config files for automation workflows.
sudo ./android_image_tools.sh
# Navigate: Advanced Tools β Super Image Kitchen β Finalize Project ConfigurationAutomatically generates complex multi-partition configs.
# Run automated operations
sudo ./android_image_tools.sh --conf=generated_config.confBasic Unpacking:
ACTION=unpack
INPUT_IMAGE=system.img
EXTRACT_DIR=extracted_systemSuper Image Unpacking:
ACTION=super_unpack
INPUT_IMAGE=super.img
PROJECT_NAME=my_super_projectBasic Repacking:
ACTION=repack
SOURCE_DIR=EXTRACTED_IMAGES/extracted_system
OUTPUT_IMAGE=REPACKED_IMAGES/system_new.img
FILESYSTEM=erofs
COMPRESSION_MODE=lz4hc
COMPRESSION_LEVEL=9
CREATE_SPARSE_IMAGE=trueSuper Image Repacking:
ACTION=super_repack
PROJECT_NAME=my_super_project
OUTPUT_IMAGE=REPACKED_IMAGES/super_new.imgAndroid_Image_Tools/
βββ android_image_tools.sh # Main script
βββ .bin/ # Helper scripts
βββ INPUT_IMAGES/ # Place .img files here
βββ EXTRACTED_IMAGES/ # Unpacked directories
βββ REPACKED_IMAGES/ # Output images
βββ SUPER_TOOLS/ # Super image projects
βββ CONFIGS/ # Generated configs
βββ .tmp/ # Temp files (auto-cleaned)
Permission denied
- Run with
sudo - Check file ownership
SELinux contexts lost
- Only occurs on SELinux-enforcing distros when using FUSE mounting
- Normal on Fedora (contexts preserved with kernel mounts)
- Use kernel mounts when possible
Sparse conversion fails
- Check
simg2img/img2simginstallation - Verify disk space
Super operations fail
- Verify
super.imgintegrity
Enable detailed logging for complex operations:
# Add to super config
ENABLE_VERBOSE_LOGS=true- Fork the repository
- Test on Ubuntu + Fedora systems
- Submit pull requests
MIT License - see LICENSE file.
Inspired by CRB Kitchen for Windows. Thanks to the Android modding community!
Ready to mod? π Run the tool and explore the menu - everything is designed to be intuitive!
