Automatic update script for Kaorios Toolbox components used in Framework Patcher V2.
This script fetches the latest release of Kaorios Toolbox from GitHub and updates the following components:
- KaoriosToolbox.apk - Main application
- privapp_whitelist XML - Permission configuration
- Utility Classes - Smali classes extracted from APK (~156 files)
cd /path/to/FrameworkPatcherV2
./scripts/update_kaorios.shThe script will:
- Check your current version
- Fetch latest release info from GitHub
- Download and verify components
- Update
kaorios_toolbox/directory - Create a backup of old version
If you're already on the latest version but want to re-download:
./scripts/update_kaorios.sh
# When prompted "Force re-download? (y/N):", press 'y'- Location:
kaorios_toolbox/KaoriosToolbox.apk - Size: ~5 MB
- Purpose: Installed as system priv-app in module
- Location:
kaorios_toolbox/privapp_whitelist_com.kousei.kaorios.xml - Purpose: Grants required system permissions to the app
- Location:
kaorios_toolbox/utils/kaorios/*.smali - Count: ~156 files
- Purpose: Injected into framework.jar during patching
- Location:
kaorios_toolbox/version.txt - Format: Git tag (e.g.,
V1.0.4) - Purpose: Track installed version
As of this update, data files are NO LONGER included in modules.
Why?
- The Kaorios Toolbox app fetches configuration data from its own repository
- Including static data could cause compatibility issues
- Reduces module size
What was removed:
kaorios_toolbox/data/Keybox.xmlkaorios_toolbox/data/device-model.jsonkaorios_toolbox/data/Pif-props.jsonkaorios_toolbox/data/app-props.jsonkaorios_toolbox/data/edit_file.json
The script automatically creates backups:
- Location:
kaorios_toolbox.backup.YYYYMMDD_HHMMSS/ - When: Before each update
- What: Complete copy of current
kaorios_toolbox/directory
To restore from backup:
rm -rf kaorios_toolbox
cp -r kaorios_toolbox.backup.20250128_120000 kaorios_toolbox- curl - For downloading releases
- unzip - For extracting archives
- Java - For decompiling APK with apktool
- apktool - Located at
tools/apktool.jar
Check dependencies:
command -v curl && echo "✓ curl installed"
command -v unzip && echo "✓ unzip installed"
command -v java && echo "✓ java installed"
[ -f tools/apktool.jar ] && echo "✓ apktool found"The script uses GitHub's public API:
- Endpoint:
https://api.github.com/repos/Wuang26/Kaorios-Toolbox/releases/latest - Rate Limit: 60 requests/hour (unauthenticated)
- No authentication required
If you hit rate limits, wait an hour or authenticate:
# Set GitHub token (optional, for higher rate limits)
export GITHUB_TOKEN="your_github_personal_access_token"
./scripts/update_kaorios.shProblem: Script cannot connect to GitHub API
Solutions:
- Check internet connection
- Verify GitHub is accessible:
curl -I https://api.github.com - Check rate limit:
curl https://api.github.com/rate_limit - Try again later if rate limited
Problem: Downloaded release has different structure
Cause: Kaorios Toolbox changed their release format
Solution:
- Check the latest release
- Download manually and extract to
kaorios_toolbox/ - Report the issue for update script compatibility
Problem: apktool fails to extract classes
Solutions:
- Update apktool: Place latest
apktool.jarintools/ - Check Java version:
java -version(requires 8+) - Verify APK is valid:
file kaorios_toolbox/KaoriosToolbox.apk
Problem: Decompiled APK has different structure
Cause: Kaorios changed package structure or obfuscation
Solutions:
- Manually locate smali classes in decompiled APK
- Check both
smali/andsmali_classes*/directories - Look for classes with similar patterns to existing ones
- Report Issue for script update
If the script fails, you can update manually:
# Get latest release URL
RELEASE_URL="https://github.com/Wuang26/Kaorios-Toolbox/releases/latest"
# Download manually
wget $(curl -s https://api.github.com/repos/Wuang26/Kaorios-Toolbox/releases/latest | grep "browser_download_url.*KaoriosToolbox-Magisk.*\.zip" | cut -d '"' -f 4)mkdir temp_kaorios
unzip KaoriosToolbox-Magisk-*.zip -d temp_kaorios
# Copy APK
cp temp_kaorios/system_ext/priv-app/KaoriosToolbox/KaoriosToolbox.apk kaorios_toolbox/
# Copy permission XML
cp temp_kaorios/system_ext/etc/permissions/privapp_whitelist_com.kousei.kaorios.xml kaorios_toolbox/# Decompile APK
java -jar tools/apktool.jar d kaorios_toolbox/KaoriosToolbox.apk -o temp_decompiled
# Find and copy utility classes
find temp_decompiled -type d -name "kaorios" -path "*/util/kaorios"
# Copy that directory to kaorios_toolbox/utils/echo "V1.0.X" > kaorios_toolbox/version.txtAfter updating, the new components are automatically used by the patcher:
# Android 16 with Kaorios
./scripts/patcher_a16.sh 36 device_name 1.0.0 --kaorios-toolbox
# Android 15 with Kaorios
./scripts/patcher_a15.sh 35 device_name 1.0.0 --kaorios-toolboxNo additional steps needed - the patcher will use the updated components.
cat kaorios_toolbox/version.txt###Checking Latest Version
curl -s https://api.github.com/repos/Wuang26/Kaorios-Toolbox/releases/latest | grep "tag_name"The script doesn't maintain a changelog, but backups allow you to:
- See when updates were performed (backup timestamp)
- Rollback to previous versions if needed
- Compare component differences between versions
-
Run Before Patching: Update components before starting a new patch job
./scripts/update_kaorios.sh ./scripts/patcher_a16.sh 36 device 1.0.0 --kaorios-toolbox
-
Check for Updates Regularly: Kaorios Toolbox is actively developed
# Add to your workflow ./scripts/update_kaorios.sh -
Test New Versions: After update, test on non-production device first
-
Keep Backups: Don't delete backup directories immediately
-
Report Issues: If new version breaks patching, report with:
- Kaorios version
- Framework details
- Error messages
# Check for updates daily at 3 AM
0 3 * * * cd /path/to/FrameworkPatcherV2 && ./scripts/update_kaorios.sh#!/bin/bash
# pre-patch.sh - Run before patching
echo "Updating Kaorios components..."
./scripts/update_kaorios.sh
echo "Running patcher..."
./scripts/patcher_a16.sh "$@"- Kaorios Issues: Kaorios Toolbox Repo
- Updater Issues: Framework Patcher Issues
- Telegram: @Jefino9488
- Initial release
- Automatic fetching from GitHub API
- Component extraction and verification
- Backup system
- Version tracking
- Data directory removal (app fetches from repo)