[TOOL][Windows/Theming] BatchAPKTool

Search This thread

dfkt_

Senior Member
Feb 1, 2011
340
239
Vienna
Xiaomi Poco X3 NFC
As seen on the front page: http://www.xda-developers.com/android/streamline-your-app-theming-with-batchapktool/ (Thanks nikwen and Will!)

I never was overly happy with available solutions/tools/scripts for theming. So, over time my collection of homegrown batch scripts grew... and now I made a menu interface for them to collect them in a (for me, at least) logical manner. I'm gonna put them up here, maybe some people might find them useful.

BatchAPKTool differs from other Apktool/Smali-manager scripts in a few ways. It doesn't do everything everybody might find useful in a script, but it gets basic things done really fast and really neat. Where it makes sense, several working steps are combined into one command. BatchAPKTool is not a monolithic script. You can use the main menu script (!0-batchapktool-menu.bat), or you can simply click the various single scripts to get stuff done, which is usually the fastest option. There aren't a lot of folders to keep track of - everything is basically done in the root folder of the script. Just drop some APKs there and get going. BatchAPKTool automatically makes backups of the original files. And, of course, the name of the script comes from the fact that you don't select a single APK file to work with, but everything is done in batch (it's the user's responsibility to not mix system and user apps when signing/pushing/installing APKs).

On first startup the script checks if Java is installed on the computer, and sends you to the Java website if not. It also pulls the framework from your device and installs it for Apktool. After that you're good to go. The frameworks are tagged, so one can easily switch when developing for different devices.

The main menu (orange font) shows everything in order that's needed for theming system APKs. Basically, just go from option 1 to option 6 (or 7) and be done. The additional options (red font) contain features one might need as well - options 1 to 3 for non-system apps - but not as often as the main menu ones. Options 4 to 6 are just some 'internals'. It's all pretty self-explanatory, methinks:

kV3skT2.png
pcuqJ0k.png

Prerequisites are - besides Java - a custom recovery like TWRP that can mount partitions (for pushing system apps), and of course USB debugging enabled, ie. a working ADB connection.

I probably packed some safety checks in the scripts that might break operation on certain systems. Bug reports are welcome.

Tools included:
  • 7za v9.20
  • aapt v0.2
  • adb v1.0.31
  • apktool v1.5.2
  • DeflOpt v2.07
  • jpegoptim v1.2.2
  • OptiPNG v0.7.4
  • signapk [?]
  • Stripper v1.5.5.60
  • zipalign
(I didn't include PNGOut for optimizing images, since it is extremely demanding, even on modern hardware... but one can easily add it to the toolchain.)

Changelog:
  • v1.01 Streamlined some functions, more (in)sanity checks, better integration of framework switching function
  • v1.00 Initial release
 

Attachments

  • batchapktool-v1.0.zip
    3.9 MB · Views: 746
  • batchapktool-v1.01.zip
    3.9 MB · Views: 2,315
Last edited:

Primokorn

Senior Member
Nov 17, 2012
11,560
7,754
OnePlus 8 Pro
Thanks mate. I'll give a try asap :)
I saw your thread from the portal and this is worth cuz it looks very useful on paper :good:
 

andronexus

Senior Member
Oct 14, 2012
79
33
Adoor
www.behance.net
As seen on the front page: http://www.xda-developers.com/android/streamline-your-app-theming-with-batchapktool/ (Thanks nikwen and Will!)

I never was overly happy with available solutions/tools/scripts for theming. So, over time my collection of homegrown batch scripts grew... and now I made a menu interface for them to collect them in a (for me, at least) logical manner. I'm gonna put them up here, maybe some people might find them useful.

BatchAPKTool differs from other Apktool/Smali-manager scripts in a few ways. It doesn't do everything everybody might find useful in a script, but it gets basic things done really fast and really neat. Where it makes sense, several working steps are combined into one command. BatchAPKTool is not a monolithic script. You can use the main menu script (!0-batchapktool-menu.bat), or you can simply click the various single scripts to get stuff done, which is usually the fastest option. There aren't a lot of folders to keep track of - everything is basically done in the root folder of the script. Just drop some APKs there and get going. BatchAPKTool automatically makes backups of the original files. And, of course, the name of the script comes from the fact that you don't select a single APK file to work with, but everything is done in batch (it's the user's responsibility to not mix system and user apps when signing/pushing/installing APKs).

On first startup the script checks if Java is installed on the computer, and sends you to the Java website if not. It also pulls the framework from your device and installs it for Apktool. After that you're good to go. The frameworks are tagged, so one can easily switch when developing for different devices.

The main menu (orange font) shows everything in order that's needed for theming system APKs. Basically, just go from option 1 to option 6 (or 7) and be done. The additional options (red font) contain features one might need as well - options 1 to 3 for non-system apps - but not as often as the main menu ones. Options 4 to 6 are just some 'internals'. It's all pretty self-explanatory, methinks:

kV3skT2.png
pcuqJ0k.png

Prerequisites are - besides Java - a custom recovery like TWRP that can mount partitions (for pushing system apps), and of course USB debugging enabled, ie. a working ADB connection.

I probably packed some safety checks in the scripts that might break operation on certain systems. Bug reports are welcome.

Tools included:
  • 7za v9.20
  • aapt v0.2
  • adb v1.0.31
  • apktool v1.5.2
  • DeflOpt v2.07
  • jpegoptim v1.2.2
  • OptiPNG v0.7.4
  • signapk [?]
  • Stripper v1.5.5.60
  • zipalign
(I didn't include PNGOut for optimizing images, since it is extremely demanding, even on modern hardware... but one can easily add it to the toolchain.)

Changelog:
  • v1.01 Streamlined some functions, more (in)sanity checks, better integration of framework switching function
  • v1.00 Initial release

Now this will come in handy very very much! Keep up the good work and keep adding features to it ;)

Sent from my Galaxy Nexus using Tapatalk 4
 

dfkt_

Senior Member
Feb 1, 2011
340
239
Vienna
Xiaomi Poco X3 NFC
Thanks for putting this together, but I think the download Java links in your script should point to the JRE download page instead of the main page for Java:

Java JRE download page

Yeah, that's a dilemma - the URL for the JRE direct download link is dynamic (the "1880261" part), changes with each new version. So the script would have to be constantly updated (or some really sophisticated URL crawler implemented). The lazy-but-safe way of linking to the index page is probably the best I can offer. Or maybe it's safe to link to the root JDK/JRE download page (which seems to have a fixed URL), and tell people that the JRE is enough, no need to get the JDK.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    As seen on the front page: http://www.xda-developers.com/android/streamline-your-app-theming-with-batchapktool/ (Thanks nikwen and Will!)

    I never was overly happy with available solutions/tools/scripts for theming. So, over time my collection of homegrown batch scripts grew... and now I made a menu interface for them to collect them in a (for me, at least) logical manner. I'm gonna put them up here, maybe some people might find them useful.

    BatchAPKTool differs from other Apktool/Smali-manager scripts in a few ways. It doesn't do everything everybody might find useful in a script, but it gets basic things done really fast and really neat. Where it makes sense, several working steps are combined into one command. BatchAPKTool is not a monolithic script. You can use the main menu script (!0-batchapktool-menu.bat), or you can simply click the various single scripts to get stuff done, which is usually the fastest option. There aren't a lot of folders to keep track of - everything is basically done in the root folder of the script. Just drop some APKs there and get going. BatchAPKTool automatically makes backups of the original files. And, of course, the name of the script comes from the fact that you don't select a single APK file to work with, but everything is done in batch (it's the user's responsibility to not mix system and user apps when signing/pushing/installing APKs).

    On first startup the script checks if Java is installed on the computer, and sends you to the Java website if not. It also pulls the framework from your device and installs it for Apktool. After that you're good to go. The frameworks are tagged, so one can easily switch when developing for different devices.

    The main menu (orange font) shows everything in order that's needed for theming system APKs. Basically, just go from option 1 to option 6 (or 7) and be done. The additional options (red font) contain features one might need as well - options 1 to 3 for non-system apps - but not as often as the main menu ones. Options 4 to 6 are just some 'internals'. It's all pretty self-explanatory, methinks:

    kV3skT2.png
    pcuqJ0k.png

    Prerequisites are - besides Java - a custom recovery like TWRP that can mount partitions (for pushing system apps), and of course USB debugging enabled, ie. a working ADB connection.

    I probably packed some safety checks in the scripts that might break operation on certain systems. Bug reports are welcome.

    Tools included:
    • 7za v9.20
    • aapt v0.2
    • adb v1.0.31
    • apktool v1.5.2
    • DeflOpt v2.07
    • jpegoptim v1.2.2
    • OptiPNG v0.7.4
    • signapk [?]
    • Stripper v1.5.5.60
    • zipalign
    (I didn't include PNGOut for optimizing images, since it is extremely demanding, even on modern hardware... but one can easily add it to the toolchain.)

    Changelog:
    • v1.01 Streamlined some functions, more (in)sanity checks, better integration of framework switching function
    • v1.00 Initial release
    1
    Cool. :cool:

    Suggested it for the portal. ;)
    1
    Awesome - thanks a lot! :)

    A slightly updated version is coming sometime soon.