I want to know how to find a resource in an apk after installing it. I mean, whether Android will extract the apk and save into file system after installing.
By now, I only know apk will is saved in /data/app. classes.dex can be found in dalvik-cache directory. But I don't find any clue about resource in this apk, such as string.xml, png or any file in assets. Is it possible that Android system unpack apk every time when it will use these resource?
I red many old thread, but I don't find answer yet. So can anyone please explain it for me?
Thanks very much in advance.
br
The resources are inside the apk file as binary xml files. Also after the installation. For simple xml files it will load them only from the apk file. Images and larger file might be cached, but I don't know exactly where.
only resources in res/raw folder will be available on device storage, otherwise it will be inside the apk as binary data
To explore an Android APK file,
[ View the graphics, play the audio, etc.]
all you have to do,
is right click on an APK file,
and set it to "Open With" to WinZip, Winrar.
or your favorite unzipper.
Thereafter, any time you click on an APK file,
you can view the graphics, play the audio,
view the resources, explore the programming, etc.
If you want to convert an APK file to Linux/Unix,
download "Dex2Jar" from
http://code.google.com/p/dex2jar/
then unzip one of the APK files
to a convenient directory,
navigate to the directory
and right click on the CLASSES.DEX file,
and set it to "Open With" "dex2jar".
Thereafter, anytime you click on an Android DEX file
this will convert the Android DEX file
to a Unix JAR file and put it in the directory
with the Android resources.
--
Tom Potter
Related
For example i have an android program which contains important files in the assets folder , can the user who installed the apk access the assets folder or not ? for hacking purpose
Anyone can open your .apk just by changing the extension to .rar, what you can do to protect your code is releasing it using proguard rules, but still in that case an image for instance in the drawable folder can be compromised, however an string in your strings.xml is bit more protected.
Anyone can decompile your app and can see a lot of things including your assets. .apk file is just an compressed file which can be extracted easily.
At first, I have choose an apk named as bdteam. I tried utmost to find the source code. But i can not convert apk file to zip file. How can I solve my problem?
From the documentation:
APK files are a type of archive file, specifically in zip format packages based on the JAR file format, with .apk as the filename extension. The MIME type associated with APK files is application/vnd.android.package-archive.
So .APK are .ZIP files, you don't need any kind of converter, just use WinRAR it will handle them perfectly.
Here's what you want to do:
Right click on the APK file and choose Open with
Select Choose another app
Select WinRAR
Tick Always use this app to open .APK files
This is very easy. Just rename the file to my file.zip and extract by any application.
Just change APK to .zip.
Then change the certain type of file at the bottom to "All Files
then extract
very easy
Hi and hope someone may be able to help.
I'm writing an app that is based on some original artwork and I'm wanting to store several large (Adobe Illustrator) files in the same folder as the app's package. Because these files are large I don't want them to be included when I get to the stage of exporting the app to an apk file.
Traditionally I'd use the assets folder for this but the contents of this folder would get compiled into the apk file.
Does anyone have any suggestions for folders that won't get compiled in the export process.
My thanks
I was lose my android project and i was just only the apk file which is only on publish on google play store.my quation is that any kinde of formula or trick is available to get my source code and i was change the package name and uploade it again..
Try these free programs...
http://www.xda-developers.com/android/easily-decompile-and-recompile-apks-with-android-apktool/
Dex2jar
Android .apk file is a compressed form of a file which contains only Java classes (in .dex form), xml files.
To get the source code from apk file, you can use tools like
dex2jar
apktool
You can look into this link for a detailed explanation.
Of course you can do reverse engineering, but you will not get the exact source code. Because as google announce that whenever you upload apk to market google play runs a proguard on it so whenever anybody try to reverse engineering no body can exact code. It makes your class name Like class A, class B and for loop converts to while loop and and change the variable name to unreadable form.
Please go through it, it gives you all the resources and source code of application. Now you are free to change the package name and so on..
Procedure for decoding .apk files, step-by-step method:
Step 1:
Make a new folder and put .apk file in it (which you want to decode). Now rename the extension of this .apk file to .zip (eg.: rename from filename.apk to filename.apk.zip) and save it.
If problems in the converting into .zip please refers link
After getting .zip now you get classes.dex files, etc. At this stage you are able to see drawable but not xml and java files, so continue.
If you don’t see the extensions go through check the configuration
Step 2:
Now extract this zip apk file in the same folder. Now download dex2jar from this link
and extract it to the same folder. Now open command prompt and change directory to that folder.
Then write dex2jar classes.dex and press enter. Now you get classes.dex.dex2jar file in the same folder.
Then download java de-compiler from
and now double click on jd-gui and click on open file. Then open classes.dex.dex2jar file from that folder. Now you get class files and save all these class files (click on file then click "save all sources" in jd-gui) by src name. Extract that zip file (classes_dex2jar.src.zip) and you will get all java files of the application.
At this stage you get java source but the xml files are still unreadable, so continue.
Step 3:
Now open another new folder and put these files
put .apk file which you want to decode
download Apktool for windows v1.x And Apktool
install window using google and put in the same folder
download framework-res.apk file using google and put in the same folder (Not all apk file need framework-res.apk file)
Open a command window
Navigate to the root directory of APKtool and type the following command:
apktool if framework-res.apk.
Above command should result in Framework installed ....
apktool d "appName".apk ("appName" denotes application which you want to decode) now you get a file folder in that folder and now you can easily read xml files also.
Step 4:
Finally we got the res/ as well as java code of project which is our target at starting.
Enjoy and happy coding
In an android eclipse project, I have a directory like assets/gfx. In this directory are files like mysprite.png, but I also have mysprite.xcf, the original gimp file. Is this file included in the apk file, and if so, is there a way to exclude it from the build of the apk file?
First, yes. this files are present in your apk as well as /res files.
Second, no. You cannot modify apk contents(delete, add, ..). You may keep them (for example picture) on SD card