[Sprint HTC EVO 4G LTE] tbonanno231:
I'm creating this thread to help other themers avoid the hours of work I spent trying to figure this out.

The Problem

If you attempt to theme the stock browser app icon in /system/app/Browser.apk, you will find that it is a jpg image in res/drawable-xhdpi called icon_launcher_browser.jpg, and that it has a strange encoded background which gets rendered as transparent. Here's the icon:

View attachment 1217568

If you try to switch out or re-color parts of the image, it will break the encoding, and it will display that ugly background when it renders the icon on your phone. Since the jpg format doesn't support transparency, you can't easily fix this by making the background transparent like you can in a png. Re-coloring the background solid makes it a little better, but when people have different color backgrounds in their app drawers or home screens, they will see this colored square around the icon. So, this is not ideal.

The Theory

Perhaps there is a way to change this icon to a png so that you can have a normal icon with a transparent background. Removing the jpg and adding a png with the same name does not work, so there is another reference hidden somewhere in the apk besides AndroidManifest.xml, which doesn't specify an extension.

Doing a search in all files in the apk reveals the culprit. It's in resources.arsc. Here's the result when using Virtuous Ten Studio to perform the search:

View attachment 1217655

Looking at the result you can see that this is unfortunately not plain text.

If you used 7zip and did not decompile, you will actually get two more instances. One in CERT.SF and one in MANIFEST.MF. Since these files are generated by signing the certificate, modifying these does not work. And also, we will invalidate the signature by changing the contents of the apk anyway, so we will resign the apk after we modify it to fix these.

The Solution

Here's how to modify the apk so it will point to a png file for its icon instead:

Extract the apk with 7zip.

Open resources.arsc with a hex editor (I used XVI32).

Search to find the one and only instance of icon_launcher_browser.jpg. You should see a result similar to the following:

View attachment 1217677

Change the jpg to png, like so:

View attachment 1217678

Save it.

Copy the new resources.arsc into the apk using 7zip.

Create a new png image to take the place of the jpg as the app icon. Name it icon_launcher_browser.png.

Copy the png image into res/drawable-xhdpi in the apk using 7zip.

You can delete the original jpg image from the apk if you'd like, but testing reveals that this is not required.

Delete the entire META-INF folder using 7zip again.

Resign the apk. I use APK Multi-Tool or PPCGeeks APK & Zip Signer.

Remove the original system version and install it as a user app on your phone.

Open Titanium Backup, go to the app, and choose "Convert to system app".

TB gives the apk a new name: com.android.browser.apk. Rename it back to Browser.apk, if you'd like.

You now have a working png application icon for Browser.apk which supports transparency and can be easily edited/themed.

Note: If you support multiple ROMs with different versions of Browser.apk, you can copy the resources.arsc file, the icon_launcher_browser.png file, and the entire META-INF folder from your modified version. Then just use 7zip to overwrite the existing files in each Browser.apk with these modified files.