[TUTORIAL] How to Decompile and Recompile ICS .Apk Files][Easy ONE] - Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A

This is an Easy Tutorial, How to Decompile .apk and Recompile .apk Files​If u like this Tutorial, Hit THANKS Button​CREDITS
Memnoc - For Gud Ideas.
Xavierjohn22 - the amazing author of AutoApktool go Here, Hit thanks to Him Too.
Sandy7-For Motivation.
Requirements
Java (last version)
JDK (last version)
JDR (last version, usually included in JDK or Java)
Auto_Apktool 2.0.0 (DOWNLOAD THIS ONE NOT OTHERS)
HOW TO DO
NOTE: before start, select Apktool version with option 21, YOU MUST CHOOSE 1.4.1 version
1) Download and simply unpack Auto_ApkTool
2)Click on "autoapktoolmain.bat", prompt will open
{
"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"
}
3)put the apk you want to EDIT, in "_INPUT_APK"
4) Nw u Should Choose "option 6" for 'decompiling .apk
5) when option 6 is being selected, drag the apk from _INPUT_APK folder into the windows prompt and click enter
6) A Note window will appear, and will show IF the decompiling process has been done properly. Once you close that window, you will see the decompiled folder in _INPUT_APK folder
7) do your edits (xml, smali, or png, WHATEVER)
8) recompile with option 7 (NOTE: this time you MUST drag all the FOLDER, NOT the apk)
9) Once recompiling finished, u will Get a Dcompiled NOTE window that Shows your apk is sucessfully Compiled, Close that Window, Once open the decompiled folder, go to "dist" folder, and here you got your edited apk
10) NOW this is the Last step, since u cannot Sign System app, u will have to Copy the META-INF foldrer frm the Orginal apk to the edited apk, for more Info See the "Screen"
11) Rename the apk if Needed, and push it.

Reserved, HOW to decompile .jar file and recompile it, Soon.

Reserved 2, If i get Time, All in one Video Tutorial.

FAQ's​Why can't we use Apktool???
Well, you can, but it's more difficult, that's it.
Why do you say "must use 1.4.1 apktool version"??
The reason why is that since 1.4.2 version, apktool generate java code while recompiling process is going on, and this lead to errors that 9/10 makes decompile process fail

good job my friend.

One little suggestion to add.
if you install jdk leaving its custom destination directory you might get "java not found" error (even if there's the jdk file in system32 folder).
To solve this (on win 7) you need to:
- open start menu and type system in search bar
- Select "advanced system settings" from menu on the left
- Open the "system variables" on the bottom of the page
- Go to the PATH value and add the path to the jdk bin folder
- Create a new variable named JAVA_HOME and give it the same path as above.
Cheers.

Rudjgaard said:
One little suggestion to add.
if you install jdk leaving its custom destination directory you might get "java not found" error (even if there's the jdk file in system32 folder).
To solve this (on win 7) you need to:
- open start menu and type system in search bar
- Select "advanced system settings" from menu on the left
- Open the "system variables" on the bottom of the page
- Go to the PATH value and add the path to the jdk bin folder
- Create a new variable named JAVA_HOME and give it the same path as above.
Cheers.
Click to expand...
Click to collapse
Bro, in this Apktool u Wont have tis Problem, Jst need to install java acoording to ur system, Ex 64 or 32 bit, and also install the Java rutime environment, tool will work perfet..!

stanlin salu said:
FAQ's​Why can't we use Apktool???
Well, you can, but it's more difficult, that's it.
Why do you say "must use 1.4.1 apktool version"??
The reason why is that since 1.4.2 version, apktool generate java code while recompiling process is going on, and this lead to errors that 9/10 makes decompile process fail
Click to expand...
Click to collapse
While i have apktool 1.5 by iBotpeaches , nothing is wrong with that.Im saying that because ibotpeaches is actively developing apktool. Its faster to get updates from him. Autoapktool may still need to wait for source codes from ibotpeaches not trying to spoil your thread. Just siggesting you to add one more additional info.
And there are just simple codes. I suggest you to add them too. Its just a framework code. And two commonly used codes to decompile and recompile. And yes i do know the codes. Hard to even forget.
Personally i make batch files for commonly decompiled apk for faster decompiling.
Sent from my WT19i with Real Xperia r1

kokzhanjia said:
While i have apktool 1.5 by iBotpeaches , nothing is wrong with that.Im saying that because ibotpeaches is actively developing apktool. Its faster to get updates from him. Autoapktool may still need to wait for source codes from ibotpeaches not trying to spoil your thread. Just siggesting you to add one more additional info.
And there are just simple codes. I suggest you to add them too. Its just a framework code. And two commonly used codes to decompile and recompile. And yes i do know the codes. Hard to even forget.
Personally i make batch files for commonly decompiled apk for faster decompiling.
Sent from my WT19i with Real Xperia r1
Click to expand...
Click to collapse
If so, jst PM me the codes, I wil look to it , and wil add it .
Sent from my WT19i using xda premium

And guys, tis too, is faster, easy and userfriendly , try and report to me guys! :beer:
Sent from my WT19i using xda premium

stanlin salu said:
Bro, in this Apktool u Wont have tis Problem, Jst need to install java acoording to ur system, Ex 64 or 32 bit, and also install the Java rutime environment, tool will work perfet..!
Click to expand...
Click to collapse
I had this issue, that's why i reported it. it happens when you install sdk on a partitioned hd without putting it in the C:\ directory, it then goes in %appdata% and gives the java not found error, talking out of experience not my a$$

Rudjgaard said:
I had this issue, that's why i reported it. it happens when you install sdk on a partitioned hd without putting it in the C:\ directory, it then goes in %appdata% and gives the java not found error, talking out of experience not my a$$
Click to expand...
Click to collapse
No offence bro, any how tat was a gud tip, I wil look to it, thanks!
Sent from my WT19i using xda premium

Can you link the JAVA required and JDR req pls .......I'm not sure about which one should i dl ?
Sorry for the Noob question.

Ghostfreak NB said:
Can you link the JAVA required and JDR req pls .......I'm not sure about which one should i dl ?
Sorry for the Noob question.
Click to expand...
Click to collapse
Bro, u can download the java frm 'java.com' and jst search in google for EX: 'JRE for windows 7 - 32 or 64 bit' wich u r running jst install both these ten u r ready to go!
Sent from my WT19i using xda premium

Ty,bro... Will try tonight!
Btw you could just link it to that page in your OP
It could avoid such noob questions!
Sent from my MT11i using xda premium

Ghostfreak NB said:
Ty,bro... Will try tonight!
Btw you could just link it to that page in your OP
It could avoid such noob questions!
Sent from my MT11i using xda premium
Click to expand...
Click to collapse
Ok!
Sent from my WT19i using xda premium

stanlin salu said:
7) do your edits (xml, smali, or png, WHATEVER)
Click to expand...
Click to collapse
would you please create some tutorial for it? like deleting some message dialog?

superderon said:
would you please create some tutorial for it? like deleting some message dialog?
Click to expand...
Click to collapse
Alread there are many great tutorial how to edit xmls and stuffs to modifiy the apk, I can do a help my adding all the thread links to the OP, so u can easily get wat u want!
Sent from my WT19i using xda premium

Trying to use your tool here, but when I try to recompile - #7 - I get this:
[*] C:\auto-apk\AutoAPKTool2.0.4\_INPUT_APK\AngryBirdsSeason
recompiling C:\auto-apk\AutoAPKTool2.0.4\_INPUT_APK\AngryBirdsSeason...
I: Smaling...
I: Building resources...
I: Copying libs...
I: Building apk file...
The system cannot find the drive specified.
I followed your instructions closely, though when I ran the decompile and hit return after dragging and dropping the .apk onto the Command window, it showed the whole path to the .apk file; I hit return, and the word "test" came up. The decompile went well - the Notepad popped up and all that - but then after I edited one .png file and went to recompile, I couldn't drag the folder onto the Command window, so I had to kill the notepad and the Command window and restart, in order to select #7. That's when I got the above error.
Any ideas here? Win 8, 64-bit, BTW. Java 1.6.0.4
Thanks! My ONLY goal is to make hi-res icons for my Kindle Fire HD, 7". If you know a simpler way, I'd love to hear it!
Eric

ClarkSt said:
Trying to use your tool here, but when I try to recompile - #7 - I get this:
[*] C:\auto-apk\AutoAPKTool2.0.4\_INPUT_APK\AngryBirdsSeason
recompiling C:\auto-apk\AutoAPKTool2.0.4\_INPUT_APK\AngryBirdsSeason...
I: Smaling...
I: Building resources...
I: Copying libs...
I: Building apk file...
The system cannot find the drive specified.
I followed your instructions closely, though when I ran the decompile and hit return after dragging and dropping the .apk onto the Command window, it showed the whole path to the .apk file; I hit return, and the word "test" came up. The decompile went well - the Notepad popped up and all that - but then after I edited one .png file and went to recompile, I couldn't drag the folder onto the Command window, so I had to kill the notepad and the Command window and restart, in order to select #7. That's when I got the above error.
Any ideas here? Win 8, 64-bit, BTW. Java 1.6.0.4
Thanks! My ONLY goal is to make hi-res icons for my Kindle Fire HD, 7". If you know a simpler way, I'd love to hear it!
Eric
Click to expand...
Click to collapse
The above process, is nt an error, jst go to the 'dist' folder u wil find the recompiled apk.
Sent from my WT19i using xda premium

Related

[TUTORIAL]Guide to resizing apps to QVGA[STEP BY STEP]

Ok so a lot of you guys have been requesting a resizing tutorial so you can all help out on the new fresh roms like thenextsense and senseonfire.
Everyone gets directed to http://forum.xda-developers.com/showthread.php?p=6739512#post6739512 and get all confused because it doesn't actually explain much so I decided to post one written by me (I resize things in my rom, senseonfire)
Note: I am using linux Operating System and resizing to my HTC wildfire.
First off you are going to want to download apktool and the dependences for your operating system. It runs on windows, linux and mac OSX so it won't matter what OS you are running, you will be able to use it.
Once you have got apktool installed you are going to open terminal (or command prompt on your windows)
You are then going to navigate to the directory you installed apktool into:
Code:
cd /install...dir../apktool
Once that is done you are going to look at the rom that contains the app you are about to resize. You are going to open the rom archive and navigate to the framework
Code:
/system/framework/
and extract any files ending in .apk to the apktool dir
You are going to go back to the open terminal and type in
Code:
./apktool install-framework extracted_framework_filename.apk
or if you are on a windows computer
Code:
apktool install-framework extracted_framework_filename.apk
This will install the framework file/s so apktool can decompile stock apps correctly.
Once it installs correctly you are then going to choose the app you are going to resize. For the sake of this tutorial I am going to resize HtcMusic.apk
Navigate to the app folder in the rom archive
Code:
/system/app
and extract HtcMusic.apk to apktool dir
Then you are going to decompile the app to start resizing
In the still open terminal you are going to type
Code:
./apktool d HtcMusic.apk
This will decompile the htcmusic to a folder in the apktool dir called HtcMusic
To make resizing easier you should grab your phone and open HtcMusic and see what needs resizing. Now this is where the trial and error comes in.
Navigate to the layout folder in HtcMusic
Code:
/res/layout
or
Code:
/res/layout-mdpi
and choose the .xml file you believe you are looking at on your phone screen. For example on the HtcMusic app if you are resizing the playback screen it would be audio_player.xml that you would have to edit.
Play with things that have sizes (y.y px) especially things that say layout_width=y.y px... change the y value to something smaller.
If there is something that has a value @dimen/... it means that the value is in the dimens.xml in the /res/values folder
If there is something that has a value @com.htc:dimen/... it means that the value is in the dimens.xml in the com.htc.resources.apk
Once you finish the changes you are going to have to recompile the app
Go back to the terminal app that you still should have open (if you don't you will have to open it and cd to the apktool dir)
type in this code (make sure you delete the HtcMusic.apk out of the apktool directory prior to doing this)
Code:
./apktool b HtcMusic HtcMusic.apk
if you get an error and you are on linux try this
Code:
sudo ./apktool b HtcMusic HtcMusic.apk
sudo chown [your username] HtcMusic.apk
Once you finish this you will have to sign your apk. The easiest way to do this is to use dsixda's kitchen's signing tool.
Once this is done you can either push the app to your phone using adb (this never works for me)
Code:
./adb push HtcMusic.apk /system/app
if that doesn't work
Code:
./adb remount rw
./adb push HtcMusic.apk /system/app
But if that causes HtcMusic to disappear like it did to mine you will have to use dsixda's kitchen to open the rom, add htcmusic, sign all apps, and cook the rom again, then flash it on your phone.(I will not type out how to do this, there are lots of threads on how to use the kitchen)
Actually you can do it a lot easier than flashing the whole ROM again. I will post how to do this soon [28/6/12]
Open the app and look what has changed (if any) and then try again till you get it right. Trust me it takes a long while to get it right so don't expect for it to be right on your first go
Oh and if this helped you hit thanks!
APK Manager
There is an app called APK Manager that will make this easier i think it is just for windows but i don't know there might be a linux version
if this is helpfull remember to THANK
linux too http://forum.xda-developers.com/showthread.php?t=695701
Nice ! (ADB works never for me to )
THanks for the tutorial Vigidroid
I am new to this followed your steps perfectly but couldn't find any file with extension xml
I am on windows 7 all files are .smali extension
Can you elaborate a little ...Thanks
Edit :weird but works now
hey guys i'm a complete noob
i did follow all of d above steps and i'm stuck on d "AndroidManifest.xml" ... i'm not able 2 open d xml !!!!! it gives me a phrasing error( in mozilla) and an "encoding error"(in jedit)
could some 1 pls help me out !!!
thankya in advance
You must be trying to open up a .xml file that hasn't been decompiled yet. Try using apktool again to decompile all the contents of the app and then you should be able to open all .xml files correctly.
Opening the android manifest that has been decompiled:
{
"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"
}
Opening the android manifest that hasn't been decompiled:
hi VigiDroid,
thanks for all the work you do for our wildfires. ive tried, unsuccessfully to use apktool a few times so i can learn how to resize apps. i cant even get to open apktool.
i downloaded the apktool1.4.3.tar.bz2 and apktool-install-wind...,tar.bz2 and unpacked them onto a folder on my desktop (windows xp). in the tut you say to install apktool, i assume you mean to open the tar files to a folder?
when i open a command and try and run apktool i keep getting a syntax error message. i have the apktool ms-dos batch file and executable jar file with the aapt file in a folder on my desktop called (not very originally ) "apktool" so i typed into the command box
cd/C:\Documents and Settings\KnK\Desktop\apktool/apktool
as instructed in your tut ie cd /install...dir../apktool. install directory being C:\Documents and Settings\KnK\Desktop\apktool.
any help would be appreciated. ive attached a screen shot of the command promt
Here's a couple of guides I followed in the beginning. First one is for setting up java, adb http://forum.xda-developers.com/showthread.php?t=879701
Second is for apk multi tool, it used to be apk manager, install this after setting up java and the Android-sdk, its basically apktool but with a gui. Great tool for beginners.http://forum.xda-developers.com/showthread.php?t=1310151
There is another one I used for just setting up apktool but I can't find it so have a crack with the multi tool.
Sent from my HTC Wildfire using xda premium
Nice 1 Scratch, as always there with a helping hand for our little wildfire community. Thanx m8
Sent from my Wildfire using xda premium
... on the learning progress , my dream is to be a chef and share my work here ... thx for the tutorial it really help me a lot ..
Sent from my Wildfire using Tapatalk 2
Does anyone know why do I always get errors on compiling with apktool ? I have java installed for sure, I installed the framework , got no problems with the decompiling and then it just wouldn't build up :X
P.S. I was trying to edit one layout xml in this apk ,but no success. Would be really grateful if someone can compile it for me :S

[HOW TO] Use Apktool

So, here i'm again porting a tutorial based on DSM_'s Tut
What do you need:
JRE (Java Runtime Environment)
MOD EDIT: Download Removed.
Install:
Windows:
MOD EDIT: Download Removed.
MOD EDIT: Download Removed.
Unpack both pakages you will get three files, copy those files to your Windows directory i.e. C:\WINDOWS
Decoding files:
Open Command. Run>cmd
Type-
Quote
apktool d file.apk [directory]
Example - apktool d D:\nfsshift.apk D:\nfsshift
Done!
{
"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"
}
FrameworkFiles
Apktool needs the framework files to decode and build apks.
Standard framework is embedded into apktool, so you don't need to do anything for most apk files. But some manufacturers, for example Samsung, add their own framework files and use them in system apps. To use apktool against such apps, you must pull framework from a device and install/register it to apktool.
For Example, you want to decode TouchWizLauncher.apk from Android v2.2 of Galaxy 5. If you try to do that, you will get an error message:
You need to install framework in apktool Type-
apktool if [framework location]
I have the got the framework-res.apk & twframework-res.apk by extracting the ROM. You can also copy it from your phone. But take care you must copy framework.apk from that ROM in which you got the Application file.
Then try again
Now is working.
How to build decoded files:
Just type
apktool b [directory in which you have decoded the files]
Example - apktool b D:\nfsshift
Done!
You will find the apk file inside the decoded directory, like I found it in - D:\nfsshift\dist\nfsshift.apk
Now you need to sign your APK file.
How to Sign APK files:
When publishing an application or a custom rom you need to sign the .apk or .zip files with a certificate using a private key. The Android system uses the certificate to identify the author of an application and establish trust relationship between applications. The classic way of doing this was to use keytool then sign it with jarsigner. In this tutorial i’ll explain an alternative method which is relatively easy to use for most people using a tool called SignApk.jar.
First download the SignAPK toolMOD EDIT: Download Removed.
Extract them to a directory you will remember. I have put them in C:\SignApk
Now just open cmd and type -
Quote
cd C:\SignApk
java -jar signapk.jar certificate.pem key.pk8 your-app.apk your-app-signed.apk
Example - java -jar signapk.jar certificate.pem key.pk8 D:\nfsshift\dist\nfsshift.apk D:\nfsshift\dist\nfsshift-signed.apk
Your APK is signed and can be installed.
Why I get errors when trying to decode some apk's from Xperia S? Apk's are okay, working on phone. Decompiling works on other apps.
I've registered framework-res.apk from my phone.
Theonewithideas said:
Why I get errors when trying to decode some apk's from Xperia S? Apk's are okay, working on phone. Decompiling works on other apps.
I've registered framework-res.apk from my phone.
Click to expand...
Click to collapse
You may require another one like the dhd has com.htc.resources.apk
sent from my dhd
i decompiled defaulthemes.apk from my Xperia neo v
now when i compile it again .. do i need to sign it? its a system apk!
and i am not able to build decode files( it means compiling right?).. please help!
Aarush said:
i decompiled defaulthemes.apk from my Xperia neo v
now when i compile it again .. do i need to sign it? its a system apk!
and i am not able to build decode files( it means compiling right?).. please help!
Click to expand...
Click to collapse
I think you need to replace it manually first time. But make a backup, just in case.
---------- Post added at 10:43 PM ---------- Previous post was at 10:18 PM ----------
I've decoded the system app (from Xperia S) (after registering the 2 framework files)
Edited the code inside. Compiled. Signed. But when I want to install it it gives me error. The usual icon doesn't show up either.
Is the error caused by changing something in code? I've only edited some TextSize values.
Theonewithideas said:
I think you need to replace it manually first time. But make a backup, just in case.
---------- Post added at 10:43 PM ---------- Previous post was at 10:18 PM ----------
I've decoded the system app (from Xperia S) (after registering the 2 framework files)
Edited the code inside. Compiled. Signed. But when I want to install it it gives me error. The usual icon doesn't show up either.
Is the error caused by changing something in code? I've only edited some TextSize values.
Click to expand...
Click to collapse
Can be with codes
Are u signing it.? Dont sign it if its a system apk
Sent from my Xperia neo V using SwiftKey!
Great tutorial
Sent from my Droid using Tapatalk
Why shouldn't you sign a system apk? I see people stating this everywhere, never any reason as to why though.
Basically, if I mess with a system apk I should just build it and then it's ready to adb push to /system/app/?
very helpful thanks
I've done all your steps but...
@hyztname
hi, how are you
I've done what you said in post #1 step by step, everything's ok with no error but when I push my new edited "SystemUI.apk" to the device, it doesn't work. I have the same issue when I use APKMultiTool
what do you think?
goldiecalypso said:
@hyztname
hi, how are you
I've done what you said in post #1 step by step, everything's ok with no error but when I push my new edited "SystemUI.apk" to the device, it doesn't work. I have the same issue when I use APKMultiTool
what do you think?
Click to expand...
Click to collapse
You have to sign ur new app. Google how to sign apks in google
Sent from my Droid using Tapatalk 2
cowsquad said:
You have to sign ur new app. Google how to sign apks in google
Sent from my Droid using Tapatalk 2
Click to expand...
Click to collapse
I signed it with "signapk" according to your talks and download link, but still nothing!
@goldiecalypso
SystemUi.apk isn't a simple package.
If I'm right you don't have to decompile sources.
apktool d -s SystemUI.apk
-s, --no-src (Will not decode sources)
could u plz tell me hw to do it in ubuntu
droidxpert said:
could u plz tell me hw to do it in ubuntu
Click to expand...
Click to collapse
What do you want to know?
Sent from my Galaxy Nexus using Tapatalk 2
sir i decompiled framework-res.apk and i have modded the pngs in drawable ldpi folder.but when i am trying to recompile it it shows errors in every png i modded..i modded using photoshop cs6...please help
droidxpert said:
sir i decompiled framework-res.apk and i have modded the pngs in drawable ldpi folder.but when i am trying to recompile it it shows errors in every png i modded..i modded using photoshop cs6...please help
Click to expand...
Click to collapse
What kind of error are you getting? Where you messing with 9.pngs?
Sent from my Galaxy Nexus using Tapatalk 2
ya i was editing .9 pngs.and one of xda member suggested me to flatten it before saving.This compiles successfully but creates a white background for all images
droidxpert said:
ya i was editing .9 pngs.and one of xda member suggested me to flatten it before saving.This compiles successfully but creates a white background for all images
Click to expand...
Click to collapse
Working with 9.pngs isn't easy to do. You must use 9.png tool to work with those. 9.pngs are pain in the ass. There are tutorials out there man
Sent from my Galaxy Nexus using Tapatalk 2
droidxpert said:
ya i was editing .9 pngs.and one of xda member suggested me to flatten it before saving.This compiles successfully but creates a white background for all images
Click to expand...
Click to collapse
You need to use the draw9patch.bat tool if you change the shape of anything in a 9.png. Check out http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch for some basics.

[Tutorial] Decompile and recompile APK's using ApKManager

IMPORTANT - APK decompilation is needed only when you are going to edit some xml's or other stuff. If you want edit or replace png's, you need to extract the apk instead of decompiling it.
If you want to extract an apk for theming, read this tutorial - http://forum.xda-developers.com/showthread.php?t=1665674
1) Download apkmanager ( http://www.apkmultitool.com/?q=node/5 ) and install it.
2) Put the apk you want to decompile in 'place-apk-here-for-modding' folder.
3) Double click on 'script'
4) Ignore the 'adb not found' command and press enter
5) Type 22 i.e. 'set current project' and press enter.
6) Type 1 and press enter
7) Type 9 and press enter to decompile apk.
8) Wait until the decompilation finishes.
9) Minimize command line and go to projects -> filename.apk -> make the required changes
10) Switch back to command-line, type 11 and press enter.
11) After sometime you'll get a message 'is this a system apk?', type y and press enter.
12) You'll get another message 'aside from......... of errors', type y and press enter.
13) Wait until you get this message - 'In the apk manager.... this script' , dont do anything, minimize command-line, go to keep folder and delete resources.arsc
14) Switch back to command-line and press enter.
15) Wait until the command-line comes back to its initial look.
16) Go to 'place-apk-here-for-modding' folder, your new file will be unsignedfilename.apk
Read step 17 if you have modded framework-res.apk, otherwise skip it.
17) Open framework-res.apk and unsignedframework-res.apk using 7-zip or winrar or any other archive manager. Drag and drop resources.arsc from unsignedframework-res.apk into framework-res.apk (do not extract them, just open them using any archive manager and do the drag-drop stuff)
18) Copy the file to SD card, rename it and remove 'unsigned' from file's name.
19) Push the file to original folder using root explorer and set proper permissions.
EG - If you modded framework-res.apk, push your old file ( first move resources.arsc from new to old framework and then move the old framework) to /system folder. Set permissions to rw-r--r-- and then move the file to /system/framework folder.
PS - Make a nandroid backup before doing this if you modded framework.
Sent from my GT-S5830 using Tapatalk 2
Fr
I'll update this with more info when I get access to my PC
Sent from my GT-S5830 using Tapatalk 2
Huh, finally. Thanks a lot dev. This is much better than all those crap tutorials I found when I searched on Google. If you copied from someone, please give credits
Sent from my GT-S5830 using xda premium
Rishris said:
lIf you copied from someone, please give credits
Click to expand...
Click to collapse
No, I did not copy. I wrote on my own :beer:
Sent from my GT-S5830 using Tapatalk 2
Why no one uses apktool and 7-zip
Sent from my GT-i9070 using xda premium
tj_droid said:
....19) Push the file to original folder using root explorer and set proper permissions.
EG - If you modded framework-res.apk, push your new file to /system folder. Set permissions to rw-r--r-- and then move the file to /system/framework folder.
Click to expand...
Click to collapse
This part is very important. Push directly to /system/framework folder may will be end with bootloop, FC...
(from my exprience)
btw good tutorial.
{
"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 did it like 10 times! dont have resource.arsc after compiling
here is the log http://dl.dropbox.com/u/54790911/New%20Text%20Document%20%282%29.txt
When i decompile framework-res from Miracle v4, i get a lot of errors with png, how do i fix this?
R4Ck said:
When i decompile framework-res from Miracle v4, i get a lot of errors with png, who do i fix this?
Click to expand...
Click to collapse
He might use bad pngs like .9.pngs that arent .9.png build
Sent from my GT-i9070 using xda premium
CoolCatGetHome said:
He might use bad pngs like .9.pngs that arent .9.png build
Sent from my GT-i9070 using xda premium
Click to expand...
Click to collapse
Yeah, in the log shows some message with .9 png, but i can extract them with winrar, the problem is when i compile
R4Ck said:
Yeah, in the log shows some message with .9 png, but i can extract them with winrar, the problem is when i compile
Click to expand...
Click to collapse
You should follow the tutorial by music.soul on patching .9.png s. U cant just edit them like normal pngs.
And, sorry , thanked u by mistake.ENJOY
Sent from my GT-S5830 using Tapatalk 2 Beta-5
Apk tool is better.100%.
Apk manager doesn't compile right.
paravoz.98 said:
Apk tool is better.100%.
Apk manager doesn't compile right.
Click to expand...
Click to collapse
+1
when you edit .9.png (I'm using Photoshop CS5)
after flatten image & save for existing image, it not save with .9.png.
for example:
filename.9.png it will be save to filename.png.
you must manually put .9.png
paravoz.98 said:
Apk tool is better.100%.
Apk manager doesn't compile right.
Click to expand...
Click to collapse
I know its better. Even I use apktool. But many people think apktool is confusing and they cant understand how to go about this decompiling and compiling stuff. That's why I wrote this guide so that people who cant understand apktool can try APKmanager
I am thinking of writing an apktool guide also
Sent from my GT-S5830 using Tapatalk 2
tj_droid said:
I know its better. Even I use apktool. But many people think apktool is confusing and they cant understand how to go about this decompiling and compiling stuff. That's why I wrote this guide so that people who cant understand apktool can try APKmanager
I am thinking of writing an apktool guide also
Sent from my GT-S5830 using Tapatalk 2
Click to expand...
Click to collapse
I prefered apktool. Both tools are better it defend on how we using it.
Both are can't functions properly if our give wrong commands, wrong prefix...etc
thanks tj_droid now i don't need to request anyone to edit apk's for me thanks a tonne
vaibhavx said:
thanks tj_droid now i don't need to request anyone to edit apk's for me thanks a tonne
Click to expand...
Click to collapse
My pleasure
Sent from my GT-S5830 using Tapatalk 2
i also use apk manager only recently i edited mms app and did many modifications in that like transparent background, new notification logo
but this gave me fc also while editing keyboard AxT9IME ( i was changing background ) thats why i asked CoolCatGetHome for help, dont know what he used but then it worked fine.
i think he used apktool
while Decompiling AxT9IME.apk i got this error hope CoolCatGetHome or someone can help on this.
here is the log file also Download
mor_1228 said:
i also use apk manager only recently i edited mms app and did many modifications in that like transparent background, new notification logo
but this gave me fc also while editing keyboard AxT9IME ( i was changing background ) thats why i asked CoolCatGetHome for help, dont know what he used but then it worked fine.
i think he used apktool
while Decompiling AxT9IME.apk i got this error hope CoolCatGetHome or someone can help on this.
here is the log file also Download
Click to expand...
Click to collapse
Actually apkmanager is outdated now. I read somewhere that the dev has fixed bugs and added new features and renamed it to APK Multi-tool
Sent from my GT-S5830 using Tapatalk 2
tj_droid said:
Actually apkmanager is outdated now. I read somewhere that the dev has fixed bugs and added new features and renamed it to APK Multi-tool
Sent from my GT-S5830 using Tapatalk 2
Click to expand...
Click to collapse
u have links for that ? if yes then can u post tutorial.
i need to learn how to edit xml files androidmanifest.xml because i want to change the name of a app. can u do that for me ?
like app name is abc but i want xyz. this the name which we see in app drawer or manage applications.

[TUTORIAL][How-To] Edit .jar or .apk files using VTS

----------------------------------------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
----------------------------------------------------------------------------------------------------------
PREFACE
Hello guys, first of all I want to say thanks to all the real developers (and not just rom-modder like me) that are here, helping us to get better performance and features everyday, so thanks to FXP, CosmicDan, DooMLorD, wedgess, smokerman, krisdee, Spizzy, Keiran, fareneith, Pizza_Dox, Bakisha, and many, many others.​
This guide is intended for those who want to make some mods, for example touchpads fix to their rom, and it's not too hard to understand how to do it (we will just use an IDE to achieve that, so it'll be pretty simple).
Let's start!​
Click to expand...
Click to collapse
----------------------------------------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
----------------------------------------------------------------------------------------------------------
DECOMPILING .APK AND .JAR FILES
without custom framework
Make sure you have installed NetFramework 4.5,
if not download it from here and then install ;
You can now install Virtuous Ten Studio (VTS):
download it from here and follow the passages to install it ;
Run VTS (you could easily find it under Start) ;
Now you can create a new Project:
simply click on File (on the left top) and select New Project ;
Projects can be of 4 kinds: apk, jar, m10 and boot.
Select apk if you want to edit an apk; select jar if you want to edit a jar ;
Compile the fields on the bottom (Solution and Project name) ;
Wait for VTS to create the folders...;
Now you can import the file you want to edit:
simply right-click on the project you have created (you can find it under Solution Explorer bar, on the left)
and select Import File, then find and select the file you want to edit ;
Here we go! VTS will now decompile our file, and when it finishes,
Solution Explorer bar will be updated to show you what your file contains (smali files and whatever) ;
Now you can make every modification you want to do;
When you have finished, you can recompile that file by right-clicking your project and selecting Build Project:
you can easily find your modded file, just click Binary (under Home tab on the top) and select your file project name;
Here we are! If you've got some questions, just ask here!
Click to expand...
Click to collapse
​​
Click to expand...
Click to collapse
​​
​
----------------------------------------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
----------------------------------------------------------------------------------------------------------
DECOMPILING .APK FILES
with custom framework
first of all, you must know what to do: just take a look at the guide above and follow the steps (from 1 to 7) ;
now you must take the custom resources needed from the apk you want to decompile to work (that resources file is another apk, generally located under /system/framework and its name contains always something like Res or Resources - for example SemcGenericUxpRes -) then place it wherever you want ;
once you've done that you can create your project (DON'T import now the app you want to modify, because you'll get errors related to missing resources) and set-up a custom framework: just right-click on your project and go under Properties ;
find External tools on the left and click on apktool: select Add single framework, import the custom-resources apk that you took from your rom ( see first step ) and set a Tag (the name you want to assign to that file) ;
now you must select that framework to be used instead of the default one: right-click on your project and go under properties; here you can find a selector called Framework tag: select the one you've just setted ;
that's it! Now you can import your custom-framework-based apk ( if you don't know how just take a look at the guide above - step 8 ) .
​
Click to expand...
Click to collapse
​
Click to expand...
Click to collapse
----------------------------------------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
----------------------------------------------------------------------------------------------------------​
When i have the time, i really have to give this program a chance. Tnx for tutorial
Sent from my R800i using xda app-developers app
Good job, I've used vts.for awile now.its a great program.
Dark Lords Development Team
Needed to learn Apk Decompiling, now i can!,
simpler than apk tool..and easy to use in small changes..comes handy. nice post.
i have a problem with decompiling resource files can anyone help plz???
{
"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"
}
and this is my log
raminta said:
and this is my log
View attachment 2048601
Click to expand...
Click to collapse
It seems apktool is missing, maybe an incorrect installation? Have you tried reinstalling?
CriGiu said:
It seems apktool is missing, maybe an incorrect installation? Have you tried reinstalling?
Click to expand...
Click to collapse
Yes but nothing has changed
Sent from my R800i using xda premium
raminta said:
Yes but nothing has changed
Sent from my R800i using xda premium
Click to expand...
Click to collapse
try using an older version of VTS, but I can't promise anything
it's clearly related to missing binary, and that's strange. does this happen just with that specific apk, or with all of them?
And keep in mind that you're decompiling an apk with a custom framework, so before you can decompile it, you must add its resources by right-clicking on your project, selecting properties, going under External tools and clicking on Apktool, selecting Add single framework (here you must place your resources apk file: it's generally located under /system/framework folder of your rom - the rom from which you're taking the apk you're modifing - it's something having for name SonyResources or something like that).
Then you must set that framework to be used instead of the "stock" one by right-clicking on your project and going under properties; here you can find a selector called Framework tag: select the one you've just placed in.
CriGiu said:
try using an older version of VTS, but I can't promise anything
it's clearly related to missing binary, and that's strange. does this happen just with that specific apk, or with all of them?
And keep in mind that you're decompiling an apk with a custom framework, so before you can decompile it, you must add its resources by right-clicking on your project, selecting properties, going under External tools and clicking on Apktool, selecting Add single framework (here you must place your resources apk file: it's generally located under /system/framework folder of your rom - the rom from which you're taking the apk you're modifing - it's something having for name SonyResources or something like that).
Then you must set that framework to be used instead of the "stock" one by right-clicking on your project and going under properties; here you can find a selector called Framework tag: select the one you've just placed in.
Click to expand...
Click to collapse
Ok thanks for replying:thumbup:
Sent from my R800i using xda premium

[Tutorial] Decompile/Recompile Apk with Apk Multitool + Decompile/Recompile Jar Files

" This thread will cover various useful guides starting from how to Decompile/Recompile Apk & Jar files. Me & my friend Aneel will provide new guides/tutorial day by day so that you guys can get many handy guidance in one place. Please Suggest us If you need any guide & we will try to post it If we actually can. Also If you find our guides useful then support us my giving feedback, hitting thanks & adding in credits section "
1st Let's start with [How to decompile & recompile with Apk Multitool]:
*Requirements*
Latest Java
Latest JDK+JRE (get everything from http://www.oracle.com/technetwork/java/javase/downloads/index.html)
Apk Multi Tool (Download from attachment)
Steps
1. Unzip Apk Multi Tool into a folder
2. Now run Setup.bat. It will look like this
{
"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"
}
3. Now choose 3. Setup Directories & press enter
4. This will create the folders needed. It will look like this
5. Now place the apk you want to decompile in place-apk-here-for-modding
6. Place a framework-res.apk, SemcGenericUxpRes.apk & SystemUI.apk in other folder. Preferebly it should be from the same package of apk/same apks of a Rom which you placed in the place-apk-here-for-modding folder. If there is no corresponding apks then you can try with other framework & systemUI apks also.
7. Now again run Setup.bat & press enter & choose 2. Installing Framework-Res. It will look like this
8. Now choose option 1 & enter to install framework & again option 4 & enter to install SystemUI
9. Now run Script.bat & press enter to activate various menu. Choose option 9 to decompile the apk. Then press enter. It will look like this
10. Once decompile is complete close the script & go to projects folder
11. Do the necessary changes you want to
12. When editing is done again run Script.bat
13. Choose option 11 to recompile & press enter. It will prompt a message after sometimes, Aside from the signatures....of errors (y/n)
14. Input y & press enter
15. Now after sometimes, it will again ask you to delete everything you have modified from keep folder & also delete resources.arsc if you have modified any xml. Minimize the script, delete the xml(s) you have modified (other than from values folder, it won't appear in keep folder) & also resources.arsc. If you have modified any png (not added) then delete it too. Then press enter when you are ready.
16. Now your new apk is ready. You can find it in place-apk-here-for-modding folder. Note that, your original apk will also be in the same folder with original name. Your modified apk will have System_ attached in the name.
17. Copy it to some other place & rename to original apk name & enjoy.
18. When you want to work on the next project then delete everything from place-apk-here-for-modding & projects folder. Now follow the same steps again from Number 5 of this guide.
[How to decompile & recompile Jar Files]:
*Requirements*
Winrar/7zip
Deodexed Jar files
smali.jar
baksmali.jar (both are in the attachment)
Command Prompt/Terminal
0. Take the classes.dex from jar file by opening it with 7zip/Winrar.
1. Open a new folder in Desktop named suppose "Jar"
2. Place smali.jar & baksmali.jar in the folder
2. Open Command Prompt. On windows type cmd in Run
3. cd to your directory where you have opened the new folder. In my case it is
Code:
C:\Documents and Settings\USER\Desktop\Jar
4. Write
Code:
cd C:\Documents and Settings\USER\Desktop\Jar
& press enter. Note that, on your case the directory will be different from mines. So get the correct directory by going into that directory from C:
5. Now type this to Decompile. Note that, there is a "space" before "classes.dex"
Code:
java -jar baksmali.jar -o classout\ classes.dex
& press enter
6. When Decompiling is done there will a folder named "classout" be placed in Jar folder. Minimize the cmd.
7. Now make the necessary changes inside the classout folder
8. When done,type this to recompile & press enter. Remember, there is a "space" before "new-classes.dex"
Code:
java -Xmx512M -jar smali.jar classout\ -o new-classes.dex
9. When recompiling is done there will be a new file in the folder named "new-classes.dex"
10. Now rename new-classes.dex to classes.dex & put it in the jar file with 7zip/Winrar
..............That's All. Thank You.................
​
Credits:
@raziel23x for Apk Multitool
@iONEx for teaching me about Apk Multitool when I was a noob
@Hero for Decomping jar files concept
Nice share... BTW, can mod MiuisystemUI.apk with this tool? I've heard Miui uses different aapt.
Aciong.Aksaya said:
Nice share... BTW, can mod MiuisystemUI.apk with this tool? I've heard Miui uses different aapt.
Click to expand...
Click to collapse
yes you can just follow this cause miui has more than one framework-res.apk & you don't need twframework in this case http://forum.xda-developers.com/showthread.php?t=2306397
saqib nazm said:
yes you can just follow this cause miui has more than one framework-res.apk & you don't need twframework in this case http://forum.xda-developers.com/showthread.php?t=2306397
Click to expand...
Click to collapse
The tool is great but I can't seem to do what should I do the centered clock for MiuisystemUI.apk I can't seem to find decent tutorial.
Aciong.Aksaya said:
The tool is great but I can't seem to do what should I do the centered clock for MiuisystemUI.apk I can't seem to find decent tutorial.
Click to expand...
Click to collapse
here is the guide http://en.miui.com/thread-4353-1-1.html
Hell there is an error in your compiling code of your smali/jar
it should be "-o new-classes.dex"
Razor! said:
Hell there is an error in your compiling code of your smali/jar
it should be "-o new-classes.dex"
Click to expand...
Click to collapse
Right! Thanks Razor,now it's correct :good:
saqib nazm said:
Right! Thanks Razor,now it's correct :good:
Click to expand...
Click to collapse
Welcome
Press thanks if you like my work/advice
@saqib nazm, it would be good if you add tut on how to recompile apks after making changes in androidmanifest.xml.. Because I have observed it gives bootloops.. As signing of apps just puts meta inf and doesn't do anything to androidmanifest.. Just a suggestion..
Sent from my MT11i using xda premium
sandy7 said:
here is the guide http://en.miui.com/thread-4353-1-1.html
Click to expand...
Click to collapse
Ive been into that place if you knew david guetta face in the thread thats me. Thanks for your kindness to redirect me. The OP is not just very much accommodating geez...
Aciong.Aksaya said:
Ive been into that place if you knew david guetta face in the thread thats me. Thanks for your kindness to redirect me. The OP is not just very much accommodating geez...
Click to expand...
Click to collapse
I suggested you to install the proper framework files to decompile miui stuffs properly, though this thread is for compiling & decompiling with apk multi tool,not how to center clock on miui I beg your pardon? & I didn't say anything else because sandy already directed you to a guide, that's probably I would also gonna do If I were in the 1st place like sandy replied. You cannot say words which can hurt other people. Cause If I would know how to "Center clock on miui" I would open a thread with that guide,isn't it?
First of all,Thank you for work but I have a lot of problems.Can you help me about thats? I did everything step by step.No problems with 1 to 6 steps.I placed the apk place-apk-here-for-modding and I placed a framework-res.apk, SemcGenericUxpRes.apk & SystemUI.apk in other folder.
After that,in step 7&8,when I choose option 1 & enter to install framework & again option 4 & enter to install SystemUI,I get this screens
So,in step 9,Run Script.bat & press enter to activate various menü choose option 9 to decompile the apk. Then press enter,I get errors like this
And so,projects folder is empty.What is the problem and what can I do?
Mazellat said:
First of all,Thank you for work but I have a lot of problems.Can you help me about thats? I did everything step by step.No problems with 1 to 6 steps.I placed the apk place-apk-here-for-modding and I placed a framework-res.apk, SemcGenericUxpRes.apk & SystemUI.apk in other folder.
Click to expand...
Click to collapse
that could be a problem with that apk, you cannot decompile it. If you have done all the steps properly as you said can you try with any other apk? so to be sure if that's the problem with that apk
Aciong.Aksaya said:
Ive been into that place if you knew david guetta face in the thread thats me. Thanks for your kindness to redirect me. The OP is not just very much accommodating geez...
Click to expand...
Click to collapse
saqib nazm said:
I suggested you to install the proper framework files to decompile miui stuffs properly, though this thread is for compiling & decompiling with apk multi tool,not how to center clock on miui I beg your pardon? & I didn't say anything else because sandy already directed you to a guide, that's probably I would also gonna do If I were in the 1st place like sandy replied. You cannot say words which can hurt other people. Cause If I would know how to "Center clock on miui" I would open a thread with that guide,isn't it?
Click to expand...
Click to collapse
Hi Saqib Nazm, Yes it it but this is a full misunderstanding. The OP I am referring to is the OP on the link that Sandy gave.
Mea Culpa...
Aciong.Aksaya said:
Hi Saqib Nazm, Yes it it but this is a full misunderstanding. The OP I am referring to is the OP on the link that Sandy gave.
Mea Culpa...
Click to expand...
Click to collapse
Oh ok I am extremely sorry then. Have a nice day
Hi saqib i want to ask again. If I make own fragment in settings_header.xml. How?
Sent from my LT25i using xda premium
danisariandi said:
Hi saqib i want to ask again. If I make own fragment in settings_header.xml. How?
Sent from my LT25i using xda premium
Click to expand...
Click to collapse
bro I have told you how to do it that day in the original thread, which part you didn't understand? You asked about smali files, you don't need any smali files man.
Kjkkkkkkkkk
poria1999 said:
Hi all members
I have some problem in recompiling apk files...
When i compile apk and delete resources.arsc+xmls that i have modified them,anything didnt change in apk ...
i am working on framework-res.apk ...
please helpe me...
Click to expand...
Click to collapse
what were you trying to change? & what you did?
Yyyyyyyyyyyyyyyyyyyyyy

Categories

Resources