Extract app icon from apk file [closed] - android

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I am in need of extracting the app icon from an apk-file.
I just need one icon, i don't want to extract everything else in the apk. The files are easy to get hold on, but how do I determine which icon file is the correct app-icon. I guess this is stored in the resource table? So I guess what I need is actually to read the resource table and I hope that from the resource table I can determine the icon file namne which I can then extract from the app.
I need a simple tool for this, i know about apktool that can extract the entire apk file but this is not what I want since
it does a lof of other stuff that I dont need (decompile, decompress other files etc)
it takes a lot of time to run
Is there any other tool I can use just to get hold of the icon file path?
All suggestions are appreciated
EDIT: To clarify, I am not trying to do this on the device. I am trying to do this on a PC.

aapt tool ships with Android SDK, found under platform-tools should give you the details you need. apktool ships with aapt.
aapt d --values badging payload.apk
Using this output, you can extract the icon file out of apk (which is a zip file).

Rename the .apk file to .zip
Unzip it with a tool like 7zip
Find the icons as png files under:
/res/drawable-hdpi/icon.png
Edit: Note that this file is not present in all apk files but in most of them.
I could not find a better solution besides extracting all .png files and picking one from the list.

//if your apk is not installed ..only having .apk on sdcard
String APKFilePath = "mnt/sdcard/myapkfile.apk"; //For example...
PackageManager pm = getPackageManager();
PackageInfo pi = pm.getPackageArchiveInfo(APKFilePath, 0);
// the secret are these two lines....
pi.applicationInfo.sourceDir = APKFilePath;
pi.applicationInfo.publicSourceDir = APKFilePath;
//
Drawable APKicon = pi.applicationInfo.loadIcon(pm);
String AppName = (String)pi.applicationInfo.loadLabel(pm);
you can refer this link
Get-apk icon

As to my knowledge (and according to Wikipedia as well), APK files are ZIP file formatted packages. So I think you can just use any unzip tool to unzip the apk-file and take the icon you want. For the launcher-icon, just open the AndroidManifest.xml file and have a look at the android:icon property of the <application>. It probably looks something like so:
android:icon="#drawable/ic_launcher"
The icon file would then be res/drawable-<dim>/ic_launcher.png, where <dim> can be any of ldpi, mdpi, hdpi, xhdpi which stand for different resolutions. The largest image would be in xhdpi or hdpi.

This bash function will extract the icon and display it with preview. If you're not on a mac, then you could use the display command from ImageMagick.
preview-android-icon () { unzip -p $1 $(aapt d --values badging $1 | sed -n "/^application: /s/.*icon='\([^']*\).*/\1/p") > /tmp/$$.png && preview /tmp/$$.png; }
Use it like this:
preview-android-icon /path/to/your.apk

Software
You can also try these GUI tools to easily extract Android app icon:
APK Icon Editor – simple and intuitive.
APK Editor Studio – more advanced but still easy to use.
Description
Though the Apktool is used under the hood, the GUI front-end makes it very simple to extract or change APK icons.
The proper application icons are automatically parsed from the manifest and the internal structure, so there is no need to manually search for the needed resource files.
Both tools help you to easily edit, replace or extract icons via user-friendly GUI.
Both tools are available for Windows, macOS and Linux.
Both tools are open-source (written in C++/Qt).
Disclaimer
I am the author of these tools.

if you are novice like me you can use android app Called My APK (Google Play Link) to extract apps icons on your android phone either this app installed or you just have downloaded the apk files from outsources like apkMirror, APKpure, AppsAraby

apktool's source is available. Since resource extraction and code decompilation are quite different, I suspect it would be easy to modify it to remove code decompilation to minimize it to what you need.
As to determining the icon file name, you base that on the contents of AndroidManifest.xml, but you may need to account for multiple versions of the icon based on screen density, orientation, language configuration, etc.

Related

How to open the sketch file in windows

I have downloaded the icon set from google.
https://developers.google.com/identity/branding-guidelines
It has the .SKETCH file. I need to know how to open the file. I have Photoshop and Sketchup 2016.
can anyone assist me to open the file ?
Also if possible please let me know the location of google icon set in .fla or .psd format
For those who have same problem - Icons8 have just released a free tool for opening .sketch files in Windows: https://icons8.com/lunacy.
You can copy CSS of any object and copy plain text for any text layer.
We plan to implement for features soon.
The .SKETCH extension relates to Sketch (https://www.sketchapp.com/). If you're on a Mac, this is dead simple to download, and install.
If you're not on a Mac, Avocode and Zeplin claim to allow you to open the files on any OS, but I've had limited success (you'll have to Google the Application URLs, I don't have enough rep points, yet).
Failing that, Illustrator, Photoshop and GIMP are able to open the SVG and EPS files, and just about anything can open the PNGs.
I recommend Figma, I tried all app mentioned in other answers, Figma was the best for me.
Disclaimer: I do not work nor develop Figma.

what font within Android is closest to this image?

I have seen the below font used within several android applications, including Clean Master etc. What free font is closest to this image and how can I make use of it within Android? Thanks
The closest (most similar) font I could find was: Roboto
I dnt know what 'Clean Master' app you have there cause on play store there are tons of apps named so .Maybe you give me exact package name .And I can tell you what font they use.
Any way the idea is you to download the apk file from play store and open it with winrar or something and look into the assets folder , cause there ppls put the fonts most of the times and then they load fonts in app.
You can use this link to download apk's from google play.
http://apps.evozi.com/apk-downloader/?id=com.cleanmaster.mguard
I just downlaoded this and I see in apk's asset folder 6 font files. You can download yourself and see it
*UPDATE
They use this fonts in the apk : Spoon Number , Icomoon and Miso Unit .
you can download them from the link i give you
The font on the right of the image is likely to be Roboto but the large numbers are not. Have you tried using an identification tool such as: https://www.myfonts.com/WhatTheFont/ which allows you to upload an image. Failing that you could chance your luck emailing the developer of the app where you have seen it used.

android: get files icons saved in the system itself

I know the following happens in Windows [desktop]:
the system has an icon for each extension, and a default one for new ones.
When a new program is installed, it saves its icons to its extensions in the system [ex. upgrading Word 2007 to 2010 changes the icons for .docx files]
Now I want to know how to get those icons in android. I'm not sure if it follows the same scenario, BUT, i have a file explorer app which displays those icons. From my use of it, i know that those icons cannot be hard coded [except for the folder icon]. For example, after installing Tango, its icon took over the .ini files
My question is, How to get those icons? I'm kinda doing a file explorer app [that serves certain needs no other app does]
Android doesn't provide that functionality. You have either hard-code drawables for most-used file types into your application or download them from Internet.
You'd have to create your own icons, scan for the file types found, match those to some internal list and display the according icon (Drawable) in a Imageview in your ListView. Assuming you are using a ListView to display the files found here ofcourse.

What are the file formats for different mobile platforms [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am trying to learn more about mobile application development. iOS applications are contained in a 'ipa' file.
What are the file formats for android, BlackBerry and Windows Phone Mobile.
We're talking about application distribution format, right?
Windows Phone 7: XAP. It's a renamed ZIP.
Android: APK. It's a renamed ZIP.
Windows Mobile: CAB. Also a compressed format, similar but not identical to ZIP. Many popular archivers can open those.
Blackberry: ALX for sideloading, JAD and COD for over-the-air installation. JAD is a text file, COD is binary but no idea what's in it.
Samsung bada: ZIP. As simple as that.
Note that Windows Phone 7 and Windows Mobile (6.x and below) have quite different app distribution models. WinMo exposes its filesystem, so a specific app distibution format is not, technically, necessary - you can copy an EXE to Program Files and run it all you want. Some old school apps expect you to do just that. CABs are more convenient, though - they install by single click.
WinPhone7 only supports installing from MS Marketplace. XAP is the format the compiler emits and that you submit to the Marketplace.
All those are packaging formats. Those files typically contain the executable, libraries (if any), resources, assets, and a manifest that describes the app. If you're wondering about the format of the executable - that's a whole another question.
Most of the App files are actually zip files with different endings. You can open these by renaming them to .zip. Androids ending is .apk. http://en.wikipedia.org/wiki/APK_(file_format) renaming and opening these app files on the Mac may fail in some cases. Better use a Windows or Linux machine for that.

Change Android app icons in APK?

Is it possible to change the app icon in an APK in Android apps? I have a tablet running Android 2.2 and the icons are too low-res, so I want to replace them. I tried unzipping the APK, changing the icon and re-zipping, but it didn't work. Is there any way I can change the icon, even programmatically, to reflect the higher-res icon?
APK files are actually nothing more than zip files. If you just want to replace images, then the easiest way is to open the apk file in 7-zip or winrar and replace the png files in there with your own. Just drag your new files to the 7-zip window.
Note that I said "open" and not "unzip". Once you decompress it, the signature will no longer be valid.
Another option is to use APKManager to do it. This way you do not need to install it in /system/app:
Download APK Manager
Put the .apk in "place-apk-here-for-modding"
Run the script.bat and extract it.
Drop the new PNG files in /res/drawable-?dpi overwriting the old ones.
Run ZIP .apk and select option 2 Regular APK
Sign the APK
Install
Summary
One the simplest ways is to change APK icons via user-friendly GUI tools:
APK Editor Studio – advanced but still easy-to-use APK editor.
APK Icon Editor – plain and simple APK editor.
Both tools are free and open-source (written in C++/Qt) with the Apktool used under the hood.
Features
Automatically pack, sign and optimize your APK.
Automatic conversion between PNG, BMP, JPEG, ICO, GIF, etc.
Available for Windows, macOS and Linux.
Disclaimer
I am the author of these tools.
If you want change android application icon programatically then you can set it into AndroidManifest.xml file, in the application tag by setting the android:icon property. But if you want to change the icon of third party applications then you cant.
See this solution
Please have a look at this one for designing icons for high, medium and low density phones:
http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html

Categories

Resources