A simple Bash script to rename APK files based on their app name and version, then move them to an output folder. This script uses the aapt binary to extract the app's metadata.
- Extracts app name and version from APK files.
- Renames APK files in the format:
<AppName>_<Version>.apk. - Moves renamed files to an
outputfolder. - Self-contained: includes the
aaptbinary in the project (libfolder). - Portable: No external dependencies required beyond
bash.
project/
├── input/ # Place your APK files here
├── output/ # Renamed APK files will be moved here
├── lib/
│ └── aapt # aapt binary (included with the project)
└── rename_apk.sh # Bash script
-
Clone the repository:
git clone https://github.com/darksky4you/ver2name.git cd ver2name -
Ensure the
aaptbinary is in thelibfolder. The script already includes the binary, but you can replace it if needed. -
Make the script executable:
chmod +x rename_apk.sh
- Place your APK files in the
inputfolder. - Run the script:
./rename_apk.sh
- Renamed APKs will appear in the
outputfolder.
- Bash (default on most Unix-based systems like Linux and macOS).
aaptbinary (included in thelibfolder).
input/DemoApk.apk(App Name:DemoApk, Version:6.9.6).
output/DemoApk_6.9.6.apk.
-
No
aaptbinary found:- Ensure the
aaptbinary is in thelibfolder. - Check if it is executable:
chmod +x lib/aapt
- Ensure the
-
No APK files found:
- Ensure your APK files are placed in the
inputfolder.
- Ensure your APK files are placed in the
-
Empty app name or version:
- This can happen if the APK metadata is incomplete or corrupted.
- Verify the APK with:
lib/aapt dump badging input/YourApp.apk
This project is open-source under the MIT License. Feel free to modify and use it as per your needs.
Developed by @darksky4you.
Special thanks to:
- ChatGPT for providing guidance and assisting with automation ideas.