Editing an APK to change icon - Android Q&A, Help & Troubleshooting

I'm inexperienced and not a developer, but I have been successfully using APK Editor Studio to edit the icons in APK files for many months. However I recently encountered a problem.
I'm trying to change the icon in a Brave Browser APK, but it doesn't use raster icons; it uses vector icons instead. When I load the APK into the editor it unpacks fine but there are no icons listed in the icon side pane (there's just an xml file with what appears to be the icon's SVG code embedded in it).
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
My new SVG icon was made in Illustrator, so its SVG code is not as basic as the original SVG icon code. I would have tried to manually overwite the original SVG code with the new code to see if that might work (but getting the syntax correct for that is a bit out my depth technically).
Can anyone please let me know what's the best way to go about this?
SUMMARY: How can I replace an APK's SVG icon with a new SVG icon?
Many thanks

Android doesn't use SVG icons, instead, there is a special vector format.
To replace the icon you need to convert the SVG first. You can do it using https://svg2vector.com/ or https://inloop.github.io/svg2android/

Thank you, lioce
I had no idea that a special vector format was used in Android!
After I have done the conversion, do I simply replace the entire XML file in the APK, or should I be pasting just the new converted 'vector path' and 'fill data' into the existing XML file?
I tried using 'Replace Resource' to load the new XML file (that was created using the SVG to Vector Drawable conversion tool that you kindly provided a link for) but after loading the new XML, when I tried to repack the APK it didn't work: it displayed a bunch of errors (ending with: error: duplicate symbol '@ null')
Not sure what I did wrong.
Extra Question:
If using a vector continues to prove to be problematic, is there a (not too complicated) way to use a standard raster icon instead of the existing Vector icon in the APK? or would that require major code changes within the APK?
Thanks!

Related

***SUCCESS*** Create your own flipfont APKs

I have my custom font working properly in FlipFont with icon and font preview. There is still some stuff to figure out, and i HOPE some one will help me out as I believe its a bit over my head.
It seems that the fonts in the MonoType apks on the market are digitally signed. I THINK this is what is preventing the use of any old font. I believe the FlipFont app is looking for the digital signature in the font within the APK. If its not there, it does not use the font and reverts to using the default font.
I managed to get around this by opening the MonoType font in FontCreater along with the monoglyceride font. I then copied all of the characters and glyphs from monoglyceride into the MotoType font, replacing characters and glyphs inside of it. I saved the font and renamed it. Went through the apk creation method listed below and it worked.
If you want to try this yourself grab the APK attached to this thread and edit it with Apk Manager 4.8 found here
Steps to preform
Copy apk into place-apk-here-for-modding folder
Run script.bat and choose option 9
replace monoglyceride.ttf with the .ttf font you edited in the the steps above
edit all XML, yml and smali files to include the font name or font.ttf depending on the entry in the original file. Just replace monoglyceride in all files with the name of your font
Edit the last folder name in the smali folder tree from monoglyceride to the name of your font
Replace monoglyceride font with custom font in the font folder and replace the preview image in the drawable folder with one of your own.
Compile apk
Sign apk
Rename apk
install apk on your phone
Other info and things Ill try next
Before going through the time consuming method of editing the .ttf font file listed above I wanted to see what would happen if I left the original font APK alone and just removed the all of the internal naming. This area contains things like the font name, vendor, license agreement, copyright, ect... After I removed those entries in the file, windows still showed it as Digitally Licensed, but the font FAILED when recompiled and installed in Android.
I am going to try moving these entries over to another font and try again. This may not work, because from what I have read about digitally signed font, editing them breaks the signing. There is hope that this is not true based on the fact that I DID edit the font (characters, ect..)and it still worked.​
I will try this tomorrow, its 5am here and I need to get to sleep. Glad I have no work tomorrow. :º)
Any font guys out there have any info on this?
Well here you go, here is my first custom FlipFont APK.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
http://www.mediafire.com/file/b63fa44f7ks7e3d/com.monotype.android.font.monoglyceride.apk
Its working perfectly for me, but let me know if you have any issues.
Seems to work well... now im off to start making some of my own fonts... im really interested the the home screen samsung clock font. if anyone knows where that might be located ill start making a font asap... untill then im off to poke around to find it.

[Q] Status bar text colour

Hi,
I'm working on making a theme for the Samsung Galaxy S and one of the things I've been looking to do recently is to change the text colour of the notifications in the pull down menu. So I edited some of the XMLs and it seemed to work...almost. Here's a screenshot below of what I've done so far for reference:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The media scanning entry here shows what I can only assume is black text where in fact everything else as far as I can see is the green colour I intended it to be [#ffa4c639]. I can't seem to figure out why this is. Here's a list of the XML files I've modified so far to get to where I am:
framework-res.apk
/res/layout/status_bar_latest_event_content.xml
SystemUI.apk
/res/layout/status_bar_call_ongoing.xml
/res/layout/status_bar_expanded.xml
/res/layout/status_bar_icon.xml
/res/layout/status_bar_latest_event.xml
Have I missed something out from this list? If you need me to include anything else here just let me know .
Any help would be appreciated. Thanks .
jonitfcfan said:
Hi,
I'm working on making a theme for the Samsung Galaxy S and one of the things I've been looking to do recently is to change the text colour of the notifications in the pull down menu. So I edited some of the XMLs and it seemed to work...almost. Here's a screenshot below of what I've done so far for reference:
The media scanning entry here shows what I can only assume is black text where in fact everything else as far as I can see is the green colour I intended it to be [#ffa4c639]. I can't seem to figure out why this is. Here's a list of the XML files I've modified so far to get to where I am:
framework-res.apk
/res/layout/status_bar_latest_event_content.xml
SystemUI.apk
/res/layout/status_bar_call_ongoing.xml
/res/layout/status_bar_expanded.xml
/res/layout/status_bar_icon.xml
/res/layout/status_bar_latest_event.xml
Have I missed something out from this list? If you need me to include anything else here just let me know .
Any help would be appreciated. Thanks .
Click to expand...
Click to collapse
THat covers the normal but alot of apps dont refer to those color codes and instead use ones defined by the app its self. Reason that dark menu themes will always have black on black issues with some apps.
I would find the apk that controls the media scanner and decompile it and look inside that
hello tell me how you use the editor XMLs!
usol38 said:
hello tell me how you use the editor XMLs!
Click to expand...
Click to collapse
Decompile and use notepad++ then recompile

[Themers Needed] Texture Hunt

Hey Guys,
I need some help finding a texture. I have been looking for it more than 5 weeks and I simply cant find it.
Take a look at those screenshots:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I am looking for the greyisch texture on the right part of the settings app. Since its being used in some 3rd party apps I thought it should be in the framework-res.apk and I changed a whole lot of images, but that texture never was found.
Since its not the first time I ask this question, just FYI of course i have the holo background themed and the dark dialog files too. My Power menu is black, but I just cant find it. I also talked to some themers over in the transformer forums, but sadly I couldnt get the answer I was longing for -.-
Here is my framework-res.apk
Framework-res.apk
Plz, if you can help me take a look at my apk and tell me what I am missing.
Thanks in advance
backgrounds like that arnt images
itll be in a xml somwhere
look in the general ics theme xmls in framework
or try looking in the xmls in settings
to speed it up
take a screnshot then find out the hex code for that colour using the eye dropper on photoshop or somthing then just search that code in any xmls it could be in
BroBot175 said:
backgrounds like that arnt images
itll be in a xml somwhere
look in the general ics theme xmls in framework
or try looking in the xmls in settings
to speed it up
take a screnshot then find out the hex code for that colour using the eye dropper on photoshop or somthing then just search that code in any xmls it could be in
Click to expand...
Click to collapse
Ok I have the hex code, its #212126
could you possibly guide me to in what folder the xml is? values etc?^^
Nordpolcamper said:
Ok I have the hex code, its #212126
could you possibly guide me to in what folder the xml is? values etc?^^
Click to expand...
Click to collapse
itll be in layout-(whatever pixle density your device is) folder
or
this may be wrong
but they may have it as a set colour so look in the values folder for styles.xml
actually try this one first as itll only take a second
I searched in systemui, framework and settings, but I didnt get a hit in any layout folders or value folders
sorry dno then

[HOW-TO][2012-07-23]Make the Stock Browser Icon a Themeable PNG

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:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
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:
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:
Change the jpg to png, like so:
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.

[SOLVED][PHONE.APK] Trying to theme incoming call screen

G'Day XDA,
Just wondering if anyone could please help me. I am trying to change the colour of the ring around the phone icon on the left hand side from this green colour to a different colour.
I have edited all the images in the drawable folders and edited all the xmls in the layout folders and values folder.
I suspect it might be smali code that I have to change, but that may as well be written in Swahili for me because it makes no sense at all.
I will have to deodex, edit and then reodex if it is in the smali folder which I am willing to do, but I want to change this colour.
If anyone can help I would greatly appreciate it.
Thanks.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Edit: See 3rd post for the smali file to edit in order to change the colour of the ring
daveyannihilation said:
G'Day XDA,
Just wondering if anyone could please help me. I am trying to change the colour of the ring around the phone icon on the left hand side from this green colour to a different colour.
I have edited all the images in the drawable folders and edited all the xmls in the layout folders and values folder.
I suspect it might be smali code that I have to change, but that may as well be written in Swahili for me because it makes no sense at all.
I will have to deodex, edit and then reodex if it is in the smali folder which I am willing to do, but I want to change this colour.
If anyone can help I would greatly appreciate it.
Thanks.
Click to expand...
Click to collapse
searching for it too and cant find any thing on xda. iam sure its something with phone.apk not a .png too if you find any solution please tell me
Ahmed hamouda said:
searching for it too and cant find any thing on xda. iam sure its something with phone.apk not a .png too if you find any solution please tell me
Click to expand...
Click to collapse
I managed to find it. I had to deodex the apk (I'm using a stock odexed rom) and in smali/com/android/phone I had to edit a file called IncomingCallWidget$Handle.smali . I searched for the smali code for the green colour on the screenshot which is -0x9e5eeb (Hex code is #ff61a115) and I just changed it to the smali code for the colour that I wanted to change it to. Then I recompiled, re-odexed and voila!

Categories

Resources