[Android Themes] :
Hey everybody!

Today I'm gonna share something interesting I learned modding the Pixel Launcher Icons which is preloaded on the Pixel devices and has a few rounded icons applied to the Pixel Launcher.

For long the only solution for applying custom icons to a stock launcher, usually Google Launchers was Xposed. But all of that is over with the Pixel Launcher. See the launcher, when it sets up its SQLite databases, looks for icons that the OEM, in this case Google, wants to override. How does it do that? Well, Pixel Launcher Icons has a list of apps and drawables or icons assigned to them, and it sort of lets Pixel Launcher use them as icons for the apps. We're gonna do some modding and change it up a little. What you're gonna need is simple:

REQUIREMENTS:

1- A valid version of the Pixel Launcher Icons(com.google.android.nexusicons), since it supports android 7.1(API 25) only, but some devs managed to port it for android 5.0+, so please google that first

2- APKTOOL and its requirements

3- A set of icons, or in this case an icon pack which contains icons for all of your apps(There are a bunch of those online, doesn't matter which launcher or system it is for)

Now this can be done two ways, I'm gonna show you the best one, but a tricky one first, and then I'll post the second tutorial which is easier to do, but a bit unstable:

Tutorial 1:

First what you're gonna do is decompile the Pixel Launcher Icons apk you downloaded

apktool d PixelLauncherIcons.apk

Then navigate to PixelLauncherIcons folder which was generated afterwards and go to res

Delete all the mipmap-**** folders except for mipmap-xxxhdpi-v4 and then rename it to mipmap-nodpi, this essentially makes it way easier for you to add icons.

Then open the icon pack you downloaded with 7-Zip or any other archive viewer and go to res and find the directory with the largest size, which obviously is the only with the icons. Extract that directory and find the suitable icons you want for your apps and rename them to ic_*appname* , like ic_adm, or ic_facebook

The name of the icon file can be anything you want it to be, but it's neater to rename them this way. Then just copy the icons you found and renamed to mipmap-nodpi.

Then comes the tricky part.

You want to go to res/xml/ and open icons.xml

Then you see just a few lines of xml tags. Each tag represents an app which is shown by it's package name and launch-able activity name and it's drawable icon which is the same as the icon files.

You just have to write each line exactly like it is written for the rest of the apps and just replace the package name and drawable with the suitable ones. Like here's how I gave Greenify and IMDB each a good round icon:

<item component="com.oasisfeng.greenify/com.oasisfeng.greenify.GreenifyActivity" drawable="@mipmap/ic_greenify" />
<item component="com.imdb.mobile/com.imdb.mobile.HomeActivity" drawable="@mipmap/ic_imdb" />

The Package name is easy to figure out, just google them and if they're on play store, open up their play store page on your pc and you can see the Package Name in the url, or you could use quickshortcutmaker or MyAppSharer and some other Backup apps. The tricky part is finding the LAUNCHABLE activity name or the main activity from the package name. Like whichever way you go you can find out in seconds that IMDB's package name is com.imdb.mobile, but how do you figure out what imdb's Main activity name is? Use this command with ADB:

adb shell "cmd package resolve-activity --brief packagename | tail -n 1"

For example:

adb shell "cmd package resolve-activity --brief com.imdb.mobile | tail -n 1"

and it will show you:

.HomeActivity

which if like in this case, it types a dot first, and doesn't start with the package name, you should add the package name before the dot yourself and then place it in the zip.

After you do this, and I know, it can be really hard especially if you have a lot of apps installed and they're all "out of shape" :D , but if you want a kick-ass icon pack for your phone, or maybe even custom rom, this is the way.

After adding those stuff and saving icons.xml, you need to recompile

apktool b PixelLauncheIcons

BUT sign it yourself, and not with its original signature. So go ahead and google on how to manually sign an APK after recomipling it with APKTOOL.

Then just push it to /system/app/PixelLauncherIcons/PixelLauncherIcons.apk and set the correct permissions if you do it manually.

Reboot and then go to Settings and clear the app data for Pixel Launcher, and ENJOY!

NOTE that apps that target android 7.1 or higher meaning they are compiled with API 25 or more, if they're not round, they will never be, which means that in order to change them, you need to modify the pixel launcher. Check this article for more details:

https://sirhydarnes.com/projects/10-my-version-of-the-pixel-launcher

Screenshots are attached below.