Generate Amazon Underground Launcher Icons

TL;DR: Use (adapt) the script below to automatically generate the Amazon Underground application launcher icons.

I was toying with the idea to build an Amazon Underground version of one of my applications. According to their rules, you need to:

  • Repackage your app
  • Name custom permissions (Lollipop)
  • Apply Amazon Underground branding
  • Migrate API (if necessary)

Initially I looked for a way to automatically generate the launcher images through gradle. However, I could not find any way and I figured it’s easier to build a shell script.

Assumptions and results

The script makes following assumptions:

  • You have bash
  • You have ImageMagick installed
  • The script is located at the root of the project
  • Your project’s main module (where launcher icons are located) is named app (like the default android project created by Android Studio)
  • Your launcher icons are named ic_launcher.png and are located in your main module’s mipmap resources (app/src/main/res/mipmap-…)
  • You have internet access
  • The Amazon Underground flavour is named amazonUnderground

To be more clear, here’s the reference layout:


Running the script will produce following results:

  • It will create the appropriate folder
  • It will produce a set of launcher icons complying with Amazon’s requirements


The script has three main parts:

  1. Download resources from Amazon (the overlay images)
  2. Build the necessary structure
  3. Generate the overlay images

A temporary directory is created for file operations (download, unzip).

The full script

Initially, I wanted to avoid loops, but it’s slightly more elegant with. The script is:

Now, I only have a Mac to test the script on. It should work out of the box on any unix/linux properly configured. You’d need something like cygwin to make this work on windows (aka overkill). I’d love if anyone could contribute a .bat file.


It would be useful if one could leverage gradle somehow (a separate task, plugin maybe). This way, we could e.g. cache some things, remove some dependencies…

Possible extensions of the script could be adding the generated files to e.g. git and committing the changes or caching the downloaded file somewhere locally.


A little experiment: If you find this post and ad below useful, please check the ad out :-)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to top