Skip to content

wigothehacker/apk_builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Wilson Goal's AAB Converter Tool

A powerful, Linux-optimized command-line tool for converting Android App Bundle (.aab) files to APK format with automatic dependency management and user-friendly features.

πŸš€ Features

  • πŸ”„ One-Click Conversion - Convert multiple AAB files to APK format instantly
  • βœ… Bundle Validation - Verify AAB file integrity before conversion
  • πŸ“‹ File Information - Display detailed AAB bundle metadata
  • πŸ”§ Auto Dependency Management - Automatically detect and install missing dependencies
  • πŸ’» Linux Optimized - Built specifically for Ubuntu/Debian systems
  • 🎨 Colored Output - Beautiful, informative terminal output with emojis
  • πŸ“ Verbose Logging - Detailed progress information and error reporting
  • πŸ” Keystore Support - Custom signing configuration for APK generation
  • πŸ“ Flexible Output - Custom output directory support

πŸ“‹ Requirements

System Requirements

  • OS: Ubuntu/Debian-based Linux distribution
  • Architecture: x86_64 or ARM64
  • Internet: Required for bundletool download

Automatic Dependencies

The tool will automatically detect and install:

  • Java Runtime Environment (JRE 8+)
  • curl (for downloads)
  • findutils (file searching)
  • coreutils (system utilities)
  • Bundletool (Google's AAB conversion tool)

πŸ› οΈ Installation

Quick Start

# Clone the repository
git clone https://github.com/yourusername/apk_builder.git
cd apk_builder

# Make the script executable
chmod +x builder.sh

# Run the script (dependencies will be auto-installed)
./builder.sh

Manual Setup

# Download the script
wget https://raw.githubusercontent.com/yourusername/apk_builder/main/builder.sh

# Make executable
chmod +x builder.sh

# Run
./builder.sh

πŸ“– Usage

Basic Commands

# Interactive conversion (default)
./builder.sh

# Silent conversion (no verbose output)
./builder.sh --quiet

# Batch conversion (non-interactive)
./builder.sh --non-interactive

# Custom output directory
./builder.sh --output ./apks --verbose

# Validate AAB files
./builder.sh validate

# Show AAB file information
./builder.sh info

# Show help
./builder.sh --help

# Show version
./builder.sh --version

Advanced Options

# Custom keystore configuration
./builder.sh --keystore my-key.keystore --alias my-alias --password mypassword

# Different build modes
./builder.sh --mode universal    # Default: single APK for all devices
./builder.sh --mode system       # System-signed APK
./builder.sh --mode persistent   # Persistent APK

# Enable logging to file
./builder.sh --log conversion.log

🎯 Command Reference

Commands

Command Description
convert Convert AAB files to APKs (default)
validate Validate AAB bundle integrity
info Show detailed AAB file information
help Display help message

Options

Option Description Default
-h, --help Show help message
-v, --verbose Enable verbose output βœ… Enabled
--quiet Disable verbose output
-i, --interactive Interactive mode βœ… Enabled
-n, --non-interactive Non-interactive mode
-o, --output DIR Output directory Current directory
-k, --keystore PATH Keystore file path my-release-key.keystore
-a, --alias ALIAS Keystore alias my-key-alias
-p, --password PASS Keystore password 123456
-m, --mode MODE Build mode universal
-l, --log FILE Log output to file
-V, --version Show version information

πŸ”„ Workflow Examples

1. First Time Setup

# Initial run - will detect and install dependencies
./builder.sh

# Output:
# πŸ” Checking Dependencies...
#   β€’ Java Runtime Environment... βœ… Found (11.0.16)
#   β€’ curl... βœ… Found (7.81.0)
#   β€’ find utility... βœ… Found
#   β€’ disk utility (du)... βœ… Found
#   β€’ Bundletool jar... ❌ Missing
# 
# ⚠️  Missing Dependencies Detected:
#   - Bundletool 1.18.2
# 
# πŸ“‹ Actions to be taken:
#   - Download Bundletool 1.18.2 from GitHub
# 
# πŸ€” Would you like me to automatically install/download these missing dependencies? [y/N]: y
# 
# πŸ”§ Installing missing dependencies...
# 
# ➀ Processing: Bundletool 1.18.2
# 🌐 Downloading bundletool 1.18.2...
# πŸ“‘ URL: https://github.com/google/bundletool/releases/download/1.18.2/bundletool-all-1.18.2.jar
# πŸ’Ύ Target: ./bundletool-all-1.18.2.jar
# βœ… Download completed (3.2M)
# 
# πŸŽ‰ All dependencies installed successfully!

2. Converting Multiple AAB Files

# Place your .aab files in the directory
ls *.aab
# app-release.aab  game-debug.aab  tools-prod.aab

# Convert all files
./builder.sh --output ./converted_apks

# Output:
# πŸ” Checking AAB files...
# πŸ“ Found 3 AAB file(s):
# -rw-r--r-- 1 user user 12M Oct 28 07:15 app-release.aab
# -rw-r--r-- 1 user user 8.5M Oct 28 07:15 game-debug.aab
# -rw-r--r-- 1 user user 15M Oct 28 07:15 tools-prod.aab
# 
# πŸ“¦ Processing: app-release.aab
# πŸ”„ Converting to ./converted_apks/app-release.apks...
# πŸŽ‰ Created: ./converted_apks/app-release.apks
# 
# πŸ“¦ Processing: game-debug.aab
# πŸ”„ Converting to ./converted_apks/game-debug.apks...
# πŸŽ‰ Created: ./converted_apks/game-debug.apks
# 
# πŸ“¦ Processing: tools-prod.aab
# πŸ”„ Converting to ./converted_apks/tools-prod.apks...
# πŸŽ‰ Created: ./converted_apks/tools-prod.apks
# 
# 🎊 All conversions completed successfully!

3. Validation Mode

./builder.sh validate

# Output:
# πŸ” Checking AAB files for validation...
# πŸ“ Found 2 AAB file(s):
# 
# πŸ” Validating: app-release.aab
# βœ… Valid AAB: app-release.aab
# Bundle validation successful
# 
# πŸ” Validating: corrupted-bundle.aab
# ❌ Validation failed for corrupted-bundle.aab
# ERROR: Invalid bundle file
# 
# ⚠️  Validation completed with 1 invalid file(s)

πŸ› Troubleshooting

Common Issues

1. Permission Denied

chmod +x builder.sh

2. Java Not Found

# The tool will automatically offer to install Java
sudo apt update
sudo apt install -y openjdk-21-jre

3. Bundletool Download Failed

# Check internet connection
curl -I https://github.com/google/bundletool/releases/latest

# Manual download if needed
wget https://github.com/google/bundletool/releases/download/1.18.2/bundletool-all-1.18.2.jar

4. Keystore Issues

# Generate a new keystore
keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
                                                                                    
# Use custom keystore
./builder.sh --keystore my-release-key.keystore --alias my-key-alias --password yourpassword

Error Messages

Error Cause Solution
🚫 No AAB files found No .aab files in directory Place .aab files in current directory
❌ Java is required Java not installed Allow auto-install or install manually
❌ Failed to download bundletool Network issues Check internet connection or download manually
πŸ’₯ Conversion failed Invalid AAB file Use validate command to check file integrity

πŸ“ File Structure

apk_builder/
β”œβ”€β”€ builder.sh           # Main script
β”œβ”€β”€ README.md           # This documentation
β”œβ”€β”€ .gitignore          # Git ignore file
β”œβ”€β”€ examples/           # Example AAB files (optional)
└── logs/              # Log files directory (auto-created)

Generated Files

After conversion, you'll find:

  • *.apks - APK bundle files (can be installed directly)
  • conversion.log - Detailed conversion log (if logging enabled)

πŸ”§ Configuration

Environment Variables

# Set custom output directory
export APK_BUILDER_OUTPUT="./my_apks"

# Set custom keystore
export APK_BUILDER_KEYSTORE="./keys/release.keystore"
export APK_BUILDER_ALIAS="release"
export APK_BUILDER_PASSWORD="mypass123"

Default Keystore

The tool includes a default keystore for testing:

  • File: my-release-key.keystore
  • Alias: my-key-alias
  • Password: 123456

⚠️ Warning: Use the default keystore only for testing. Generate your own keystore for production apps.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and test thoroughly
  4. Commit your changes: git commit -m 'Add feature'
  5. Push to the branch: git push origin feature-name
  6. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Google for the Bundletool utility
  • Android community for AAB format support
  • Ubuntu/Debian for excellent package management

πŸ“ž Support

πŸ”— Related Links


Created with ❀️ by Wilson Goal - 2025

If this tool helped you, consider giving it a ⭐ on GitHub!

apk_builder

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages