APK Batch Rename Tool (for Windows and Linux)

Search This thread

phsorx

Member
Nov 13, 2010
16
57
Hi guys!

This is a quick tool I jotted together for myself in the past couple days and found it very useful. So I decided to clean it up and share it. Hope you will like it! Do comment and ask!
:rolleyes:


APK Batch Rename Tool
* for Windows and Linux for now.

APK Batch Rename Tool recursively crawls input folder and all of its subfolders looking for Android Package files (.apk's). It reads Label and Version info from apk's found and creates a copy for each apk under the output folder but using the Label and Version info acquired.

For example a com.example.hw.apk will make Hello World! 1.21.apk provided that the label inside the package was set to Hello World! and version is 1.21.

The old and the new apk files are 100% the same in terms of content and are unchanged. Only the new copies are given new filenames. Input files are left completely intact.

Why?
Have you ever wondered what are your 1500+ apk files with wierd names nested to different wierd folders on your harddrive? Have you ever wanted to find an app but you were unable to because it had some undescriptive javaish name that made no sense reflected no version and your apps were swept across a hundred junk folders anyway? Then APK Batch Rename is the tool for you! And me! :D
APK Batch Rename will set a human readable name for all your Android apps, and drop such a copy into a folder. You will finally be able to browse them, sort them alphabetically and be able to pick from versions available.

How?
1. Copy all your apk files (or folders with apk files in them) into the input folder. You may copy folders of any depth. APK Batch Rename Tool will recurse all subfolders of the input folder anyway.
2. Hit or click ApkBatchRename.bat . (For Linux users it's: apkbatchrename, or on a terminal enter: ./apkbatchrename ) Wait until it finishes the job.
3. Find your freshly named files in the output folder.

Simple as that!

Have fun! & Comment!

phsorx
 

Attachments

  • ApkRename1.10.zip
    1.5 MB · Views: 19,249
  • ApkRename1.10-Linux.zip
    243 KB · Views: 2,109
Last edited:

vua777

Senior Member
Jun 13, 2005
570
95
great work, just like reading mp3 tag then rename to "song - artist.mp3"
thanks!
 

raven_raven

Senior Member
Apr 13, 2010
566
39
Poznań
This is awesome! Thank you very much, situation you described in first post is just like mine, I find your tool very useful!
 

htzs

Senior Member
Sep 26, 2010
188
51
Budapest
Folks,

Let me join you crediting phsorx's job, that app is just great!
Thanks and congrats!
 

britoso

Senior Member
Jan 13, 2010
2,794
302
Orlando
Very cool, Works well. Always wanted to do this but was too lazy to try aapt.

I just checked:
aapt said:
badging Print the label and icon for the app declared in APK.

Code:
> aapt d badging Talk.apk
[B]package: name='com.google.android.talk' [/B]versionCode='130' [B]versionName[/B]='1.3'
sdkVersion:'8'
targetSdkVersion:'8'
uses-permission: **truncated***
application: [B]label='Talk'[/B] icon='res/drawable-hdpi/ic_launcher_google_talk.png'
uses-feature:'android.hardware.touchscreen'
main
other-activities
search
other-receivers
supports-screens: 'small' 'normal' 'large'
locales: '--_--' 'es' 'es_US'
densities: '160' '240'

I'll definitely use your script but with a small change to show the package name as well as its valuable for when you need to uninstall the package.
i.e label_packagename(version).apk -> Talk_com.google.android.talk(1.3).apk

Attached a slightly modified batch file and screenshot :)

For single file one-off renames (right-click->open with->rename single) you can use the script here.
 

Attachments

  • Capture.JPG
    Capture.JPG
    15.7 KB · Views: 917
  • ApkRename.bat_mod-packagename.zip
    774 bytes · Views: 1,260
Last edited:
  • Like
Reactions: djmcnz

phsorx

Member
Nov 13, 2010
16
57
Customizable naming planned in future version

Very cool, Works well. Always wanted to do this but was too lazy to try appt.

i.e label_packagename(version).apk -> Talk_com.google.android.talk(1.3).apk

Hi Britoso,

Yeah! That's a neat way to do it too!

Eventually I want to make naming and spacing fully customizable! Including what attributes to pick (name, label, versionName) to constitute the filename, and what separators (_,-,(,),space) should go where.

In the howto.txt I have a little road-map for the project. Will add customizable naming too. :)

Will keep you guys posted.

EOF
phsorx

Ps: Anyone who has another naming suggestion drop a post! I'd be interested.
 
  • Like
Reactions: jjwa

jjwa

Senior Member
Jun 24, 2010
220
10
38
Enschede
Very nice tool, thanks for sharing this :).
Using it with britoso's edited script.

Edit: I would appreciate it if a log of the conversion would be saved in a \logs\ subfolder, so I can check which files were not converted properly and see if I have to do those manually.
 
Last edited:
D

Deleted member 2312533

Guest
deleted
 
Last edited by a moderator:

britoso

Senior Member
Jan 13, 2010
2,794
302
Orlando
For one-off renames you can use the below batch file.

1) create the below batch file in the same folder as apkrename.bat (its attached too)
Name: rename-single.bat (change this if you want)
content:
Code:
cd "C:\change_me\ApkRename\"
apkrename.bat %1 %~dp1
Change the path(change_me) as needed.
2)Associate it with apks by right clicking on the apk and choosing "choose default program", browse and select the batch file "rename-single.bat".
Uncheck "make this the default operation"

Screenshot and batch file attached. Enjoy.

update:
-12/8 uploaded a new version that fixed a bug involving long path names with spaces.
Also added a check for success and then delete the original apk. (backup your apks just in case).
Remember to set the path to the ApkRename folder in rename_single.bat once before using it.
 

Attachments

  • rename.jpg
    rename.jpg
    78.6 KB · Views: 723
  • renamed.jpg
    renamed.jpg
    88.9 KB · Views: 590
  • ApkRename_1.1_mod_britoso.zip
    1.1 KB · Views: 615
Last edited:
  • Like
Reactions: lovelybia2

phsorx

Member
Nov 13, 2010
16
57
APK Batch Rename Tool for Linux is on the way

would like a linux version...

Hi luvgirl12345,

The Linux port is on the way & will be posted here soon! :rolleyes:

Actually, the Windows release is running on win32 ports of a few common Linux tools. :D :D :D And that's so, because I am lazy. :D :D :D Having Linux's much better support for shell scripting plus the same tool set always at hand, porting is a breeze.

Ciao,
phsorx
 

shiva-afk

Member
Sep 13, 2010
30
12
Looks nice for massive apk renaming.

Found a similar tool called APKInfo some month ago which i am using for single apk files for a while now.
But finally something for batch renaming.

Thanks :eek:
 

phsorx

Member
Nov 13, 2010
16
57
Future plans for an on-phone version of the APK Rename Tool

Any plans for making an Android version of this to run on our devices?

Yes! Certainly. Its in the plans. :)

But firstly there are a few things to be fixed on the desktop version first. See road map section of the howto.txt file in the archive. :cool: The most burning issue is the so called overwrite issue that I want to be sorted out next. Say you have two copies of the same app (same name, label, versionName) but one of them has a patch against it (because its been modded by a reverser) than one of the copies will overwrite the other (ApkRename 1.10).

Secondly on a mobile device's SD card there is usually less space than on a desktop's hard drive. This implies that APK Renamer will actually have to rename the files in place instead of creating a copy of each in a separate folder. Or at least it will need to figure out the empty space left on the device, and if its not enough to hold the copies, it should offer in-place renaming instead. Not a lot of logic to add but still...

Having all the outstanding questions be figured out on the desktop still, will allow me to implement a more established version for the phone right from start. But hold still its not going to take very long :p

Bests,

phsorx
 

Top Liked Posts

  • There are no posts matching your filters.
  • 51
    Hi guys!

    This is a quick tool I jotted together for myself in the past couple days and found it very useful. So I decided to clean it up and share it. Hope you will like it! Do comment and ask!
    :rolleyes:


    APK Batch Rename Tool
    * for Windows and Linux for now.

    APK Batch Rename Tool recursively crawls input folder and all of its subfolders looking for Android Package files (.apk's). It reads Label and Version info from apk's found and creates a copy for each apk under the output folder but using the Label and Version info acquired.

    For example a com.example.hw.apk will make Hello World! 1.21.apk provided that the label inside the package was set to Hello World! and version is 1.21.

    The old and the new apk files are 100% the same in terms of content and are unchanged. Only the new copies are given new filenames. Input files are left completely intact.

    Why?
    Have you ever wondered what are your 1500+ apk files with wierd names nested to different wierd folders on your harddrive? Have you ever wanted to find an app but you were unable to because it had some undescriptive javaish name that made no sense reflected no version and your apps were swept across a hundred junk folders anyway? Then APK Batch Rename is the tool for you! And me! :D
    APK Batch Rename will set a human readable name for all your Android apps, and drop such a copy into a folder. You will finally be able to browse them, sort them alphabetically and be able to pick from versions available.

    How?
    1. Copy all your apk files (or folders with apk files in them) into the input folder. You may copy folders of any depth. APK Batch Rename Tool will recurse all subfolders of the input folder anyway.
    2. Hit or click ApkBatchRename.bat . (For Linux users it's: apkbatchrename, or on a terminal enter: ./apkbatchrename ) Wait until it finishes the job.
    3. Find your freshly named files in the output folder.

    Simple as that!

    Have fun! & Comment!

    phsorx
    2
    Made a modified version of this nifty helper, for a bit more ease-of-use and cleanliness.

    • No more "input" and "output" subfolders. Just drop the APKs into the app's root folder - the input files will get renamed to *.bak.
    • The version numbers on the output files now have a "v" in front.
    • Main renamer script moved to the "tools" folder. It's not needed in the main folder.
    • Included aapt.exe is from the current 19.0.1 build-tools. It's significantly smaller than the old included one (~800kB vs. 5MB).

    Thanks, Phsorx, for your great tool!
    1
    Very cool, Works well. Always wanted to do this but was too lazy to try aapt.

    I just checked:
    aapt said:
    badging Print the label and icon for the app declared in APK.

    Code:
    > aapt d badging Talk.apk
    [B]package: name='com.google.android.talk' [/B]versionCode='130' [B]versionName[/B]='1.3'
    sdkVersion:'8'
    targetSdkVersion:'8'
    uses-permission: **truncated***
    application: [B]label='Talk'[/B] icon='res/drawable-hdpi/ic_launcher_google_talk.png'
    uses-feature:'android.hardware.touchscreen'
    main
    other-activities
    search
    other-receivers
    supports-screens: 'small' 'normal' 'large'
    locales: '--_--' 'es' 'es_US'
    densities: '160' '240'

    I'll definitely use your script but with a small change to show the package name as well as its valuable for when you need to uninstall the package.
    i.e label_packagename(version).apk -> Talk_com.google.android.talk(1.3).apk

    Attached a slightly modified batch file and screenshot :)

    For single file one-off renames (right-click->open with->rename single) you can use the script here.
    1
    Customizable naming planned in future version

    Very cool, Works well. Always wanted to do this but was too lazy to try appt.

    i.e label_packagename(version).apk -> Talk_com.google.android.talk(1.3).apk

    Hi Britoso,

    Yeah! That's a neat way to do it too!

    Eventually I want to make naming and spacing fully customizable! Including what attributes to pick (name, label, versionName) to constitute the filename, and what separators (_,-,(,),space) should go where.

    In the howto.txt I have a little road-map for the project. Will add customizable naming too. :)

    Will keep you guys posted.

    EOF
    phsorx

    Ps: Anyone who has another naming suggestion drop a post! I'd be interested.
    1
    For one-off renames you can use the below batch file.

    1) create the below batch file in the same folder as apkrename.bat (its attached too)
    Name: rename-single.bat (change this if you want)
    content:
    Code:
    cd "C:\change_me\ApkRename\"
    apkrename.bat %1 %~dp1
    Change the path(change_me) as needed.
    2)Associate it with apks by right clicking on the apk and choosing "choose default program", browse and select the batch file "rename-single.bat".
    Uncheck "make this the default operation"

    Screenshot and batch file attached. Enjoy.

    update:
    -12/8 uploaded a new version that fixed a bug involving long path names with spaces.
    Also added a check for success and then delete the original apk. (backup your apks just in case).
    Remember to set the path to the ApkRename folder in rename_single.bat once before using it.