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
output
folder. - Self-contained: includes the
aapt
binary in the project (lib
folder). - 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
aapt
binary is in thelib
folder. 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
input
folder. - Run the script:
./rename_apk.sh
- Renamed APKs will appear in the
output
folder.
- Bash (default on most Unix-based systems like Linux and macOS).
aapt
binary (included in thelib
folder).
input/DemoApk.apk
(App Name:DemoApk
, Version:6.9.6
).
output/DemoApk_6.9.6.apk
.
-
No
aapt
binary found:- Ensure the
aapt
binary is in thelib
folder. - Check if it is executable:
chmod +x lib/aapt
- Ensure the
-
No APK files found:
- Ensure your APK files are placed in the
input
folder.
- 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.