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.
Related
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.
Hey guys, finally I started successfully using Xperia Sola apks on my Xperia arc stock 42 rooted phone..
Tested on Xperia arc(Sola apks), LWW(Sola,Go apks both) and must work on other devices too.
UPDATED GUIDE:
Note: When u did all steps if you still dont have a working lockscreen just try going for Xperia Go apks and android.policy.jar of Xperia Go!
I dont share a flashable zip file because I use Xperia arc, you use Neo, LWW etc.. This is a guide for you to make yourselves.
- First download the FILES.rar which includes all necessarily files,on the link.
http://www.mediafire.com/?obrb493z1x4ayza
- On the phone, go to system/framework and copy android.policy.jar to your desktop.
In pack, I added baksmali-smali folder/files for you to edit your classes.dex file of android.policy.jar
1- Open your android.policy.jar file with 7zip (right click-7zip-open archive) and then drag&drop classes.dex file to BAKSMALI-SMALI folder.
2- Run CMD in that folder and write this code and enter >> java -jar baksmali-1.3.3.jar -o classout/ classes.dex
Classout folder must be generated. Go to BAKSMALI-SMALI\classout\com\android\internal\policy\impl
3- Copy ExternalLockScreen.smali and LockPatternKeyguardView.smali files which are in MY FILES.RAR pack , inside ../impl folder. (LockPatternKeyguardView will overwrite)
4- Delete classes.dex file in BAKSMALI-SMALI folder and run CMD again and write this code and enter again>> java -jar smali-1.3.3.jar classout -o classes.dex
5- Now your new classes.dex file is ready. just open archive your android.policy.jar file with 7zip again and drag&drop new classes.dex in it..
-Second you will find Xperia_Sola_app_files folder in FILES.RAR pack. It includes Xperia Sola Settngs.apk and UxpNxtLockScreen.apk files.
Normally just copy these files to system if you use root explorer, set permissions & move system/app folder and android.policy.jar to framework folder. reboot and All done! Alternative way is Android Commander PC programme.
>> But I dont suggest you to use Settings.apk of Xperia Sola. It has bug on brightness. best way is decompiling your own Settings.apk with apk manager/tool (best working Wanam's apk manager ICS on GB) and adding lines from Xperia Sola Settings.apk display settings to your own apk. Sorry I don't have much time to explain editing XML on apk manager /compiling/ decompiling it..
If all is ok here is the picture ;
{
"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 it doesn't work; u must edit your framework-res.apk (/system/framework/framework-res.apk)
These are quoted from Sudanminipro's topic which is here >> http://forum.xda-developers.com/showthread.php?t=1837501
a)DECOMPILE your framework-res.apk
b)Add this line to the AndroidManifest.xml >> <permission android:label="@string/permlab_external_lockscreen" android:name="com.sonyericsson.permission.EXTERNAL_LOCKSCREEN" androidrotectionLevel="signatureOrSystem" android:description="@string/permdesc_external_lockscreen" />
c)Add these lines to the end of the strings.xml (/res/values/strings.xml) >>
<string name="permlab_external_lockscreen">You May Write Anything Here</string>
<string name="permdesc_external_lockscreen"> You May Write Anything Here </string>
d)Add these to the end of string names in public.xml (/res/values/public.xml) >> <public type="string" name="permlab_external_lockscreen" id="0xXXXXXXXX" />
<public type="string" name="permdesc_external_lockscreen" id="0xXXXXXXXX" />
the important thing is XXXXXXXX hex codes should be written in a way as a continuation of the codes that was above..
0x0104051b,0x0104051c for example..
e)RECOMPILE. Thats it.
Click to expand...
Click to collapse
Bugs:
- Settings.apk Lockscreen menu allows you to change your lockscreen wallpaper but it has low quality.
Bugfix: go into Settings.apk display settings and Lockscreen control, select a new wallpaper, then on computer find a wallpaper which u want to use and set pixels and save it as named wallpaper.PNG . On the phone go into data/data/com/sonyericsson.uxplockscreen folder and copy wallpaper.png inside it.. finally just try a few time screenoff&on.. Must be ok.
- Facebook notifications don't work!
- Don't work on landscape mode!
- You tell me more..
I'm not a developer, just modding my Xperia arc.. If any developers can help for these bugs, that will be great..
Cheers! If this is helpful for you please use thanks button.
Special thanx to Orochixxx for .smali file names and Sola system folder..
then all must be ok. Thanks & Regards AeonWorld for his tutorial and Sudanminipro for their work..
Good job :good:
one question , will it work on cm9 ??
Sent from my Arc S using Tapatalk 2
XnightX said:
one question , will it work on cm9 ??
Sent from my Arc S using Tapatalk 2
Click to expand...
Click to collapse
No mate, is CM9 a GB rom??
Nope
Sent from my Xperia Neo V with Supercharged ICS 4.0.4
can you make please a flashable zip arhive ?
Did all the steps, but Lockscreen didn't change! It's same as before. Using Zohaib's Xperia S GB ROM.
soumya_digi said:
Did all the steps, but Lockscreen didn't change! It's same as before. Using Zohaib's Xperia S GB ROM.
Click to expand...
Click to collapse
Same here Using stock .62 fw.
soumya_digi said:
Did all the steps, but Lockscreen didn't change! It's same as before. Using Zohaib's Xperia S GB ROM.
Click to expand...
Click to collapse
Same here. Using stock .42, Xperia Play.
i confuse on your steps , like " copy classes.dex file to folder, run CMD and enter code: java -jar baksmali-1.3.3.jar -o classout/ classes.dex
"To where I must copy classes.dex file ( what folder ) ?, And I cannot run java -jar baksmali-1.3.3.jar -o classout/ classes.dex ( it said unable to..............)
I will try this today, thought I never decompiled anything...we need a developer to make flashable .zip for this :/ ... at least I'll learn something new xD.
Using back smali and smali is a complicated method, instead of that you guys can use x10modtool here http://forum.xda-developers.com/showthread.php?t=842060 to decompile and recompile android.policy.jar
Sent from my SK17i using xda premium
No classes.dex in my android.policy.jar??? Can anyone post a screenshot of their decompiled android.policy.jar folder?
I only see bunch of .smali files in that .jar ... Edit: works with winrar, that x10modtool won't work with classes.dex, but thx anyway
EDIT: Dude... no way... where to put that externallockscreen.smali and other file... in classes.dex? in baksmali-1.3.3.jar? How? Please update the tutorial, I want this lockscreen.
And me too...
topic updated..
Can we port the ics lockscreen with shortcuts on lockscreen....?????can we do it in gb with shortcuts on lockscreen..????
If I could post my framework-res.apk here, coukd any of you decompile it, add those lines p is a p), recompile and post it back here. I'm having a problem recompiling the framework-res.apk with the x10modtool posted earlier.
Thanks
HussainQ said:
If I could post my framework-res.apk here, coukd any of you decompile it, add those lines P is a p), recompile and post it back here. I'm having a problem recompiling the framework-res.apk with the x10modtool posted earlier.
Thanks
Click to expand...
Click to collapse
Me too, if I click recompile it makes a new folder in "rec" folder but it is empty...
Erhany, please, do me a favour....
I'm giving you my classes.dex from android.policy.jar, and 2 smali files from your pack (to make it easier for you ).
Why?
Because classout folder doesn't show up after the first command and I can't edit classes.dex ... I guess this is an easy step to you because it is working for you. So please edit it for me and reupload here, this mod is killing me :crying:
Other steps are easier, but if it comes to recompiling framework-res, I quit .
This mod never work
Maybe there is one more needed file that is missing
framework-res.apk,
android.policy.jar,
UxpNxtLockScreen.apk,
Settings.apk,
framework.jar (tryed it but nothing)
But the old lock screen is still there?
maybe we need a lib file?
XMP 2.3.4.....58
Guys Im so sorry for cant helping you. I work 12hours in a day and being so tired and dont have time for modding..
I use this files in my Xperia Arc and if u do not use any special mod, jus try loading Xperia Arc Big Pack v3.. I have it now and didnt add any lines for framework-res or etc..
Just backup your whole phone and try this arc big pack v3 mod.. After that use my files.. It will work %100..
When I have time, I will try to recompile your files..
Sorry and good moddings..
Hi friends of XDA,
today, i present you a easy method (more like a idea) on how to learn about what is actually modified in a apk and help you to
get an idea about creating your own mod by understandig other mods.
first is first!
#include
/*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because of you following this guide.
* do some research if you have any concerns.
* YOU are choosing to make these modifications.
* you cannot point the finger at me for messing up your device.
* yes, i copied this disclaimer from FXP coz itz cool and i am lazy!
*/
okay now let´s get started,
things you need,
1. apktool
2. WinMerge (WinMerge is Open Source software under the GNU General Public License)
3. a modded apk and it's original untouched unmodded apk for your device.
4. A LOT OF PATIENCE (learning modding apks is not so easy).
step by step,
1) apktool part,
1.1) install framework-res.apk, SystemUI.apk, SemcGenericUxpRes.apk in apktool
.
NOTE: below, any apk can be used, i'm using SystemUI.apk as a example.
1.2) decompile and compile both the original SystemUI.apk pulled from your device and the SystemUI.apk from the mod
which you are going to learn what has been changed.
NOTE: step 1.2 is done to make sure that the apktool you are using is comaptible with your apks if it throws errors
while compiling and/or decompiling unmodified system apks then use a different version of apktool which works with your
device and version of android you are going to use (google it).
1.3) after succesfully installing required apks and testing the apktool, clean the apktool folder (remove decompiled apk folders and
remove unwanted apks from the folder).
1.4) copy the pulled original SystemUI.apk from device (or pull it again) to apktool folder and rename it to make you remember that it
is the original apk (i named it as SystemUI_ori.apk).
1.5) copy the modded SystemUI.apk from the mod and rename it to make you remember that it is the modded apk
(i named it as SystemUI_mod.apk).
1.6) decompile SystemUI_ori.apk and SystemUI_mod.apk.
2) winmerge part,
2.1) open winmerge
click 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"
}
2.2) you'll get the following window (select files and folders)
2.3) in the left and right path box type in your path to the decompiled original and modded apks directory.
as shown below and click ok (ok button will be only visible if you choose two valid directories)
2.4) now the two directories you selected will be opened and their similarities in files and
directories will be displayed in the comparison result column as shown below,
2.5) the comparision result column will display what type of file it is and whether they are different or identical as shown below,
2.5) if the file or directory is only present in one directory of the two selected directories (see 2.3) then the comparision result column
will show as highlited in the below image.
2.6) from 2.4 and 2.6 you can easily determine what files have been edited and/or added by the modder to achieve the corresponding
changes in the mod.
2.7) Now when you double click the file which is present in both the left and right directories, those files will be opened and their
differences will be highlighted.
for example let us open a text file (normally all files are text type in a decompiled apk except images) whose comparison result
show that they are different,
the text file in both left and right opens side by side and the lines which contains the differences will get highlighted in yellow,
the part of the line which is actually different from one another will be highlighted in light yellow as shown below.
NOTE: since the apk is decoded by apktool, the files will be always in human readable source form so just by looking at the differences in the
text we can get a clear picture on what is changed in the file and how does it impact in the final modded apk. If you yourself have a good
knowledge of xml and java it'll be a breeze for you to understand it!
you can also copy the whole changes of one file to another or just copy the changes line by line, to learn more about this see the further
reading part below.
3) PLEASE do not ask me about apktool errors or what to edit in a apk to get this etc., type of questions
i'm still in the nascent phase of learning about modifying apks and theming, i am using this method to learn so i am recommending this
to interested friends.
4) if you have doubts and/or errors in using apktool post here.
FURTHER READING:
5) I HAVE COVERED ONLY THE VERY BASICS OF LEARNING MODDING USING WinMerge.
to learn more about the shortcuts and functionalities of winmerge read winmerge quick guide and complete guide..
CREDITS:
authors of winmerge
authors of apktool
HAPPY LEARNING MODDING!
PLEASE PRESS THANKS IF THIS THREAD IS USEFUL!
fix urls
mv_style said:
fix urls
Click to expand...
Click to collapse
DONE man!
Damn awesome tut bro!!
Was manually comparing both files inside apk to find which file has been modified..
U made it easier for me..
Cheers:fingers-crossed:
ssanjay19 said:
Damn awesome tut bro!!
Was manually comparing both files inside apk to find which file has been modified..
U made it easier for me..
Cheers:fingers-crossed:
Click to expand...
Click to collapse
thanks sanjay
Apktool doesnt open on my pc. It just shows up for a sec and then disappears!
thejkamath said:
Apktool doesnt open on my pc. It just shows up for a sec and then disappears!
Click to expand...
Click to collapse
Install java first,
In win7 open the directory where you placed the apktool.jar , hold shift and right click inside the folder, in the menu click "open command window here" and in the command window type,
java -jar apktool.jar
Click to expand...
Click to collapse
In xp
Open command prompt change directory to the apktool.jar directory and type the above quoted.
Hit thanks if I helped you.
Sent from my ST15i using xda app-developers app
Sir I can't see the pictures u have posted... fix their links please
Thanks
This is an Easy Tutorial, How to Decompile .apk and Recompile .apk FilesIf u like this Tutorial, Hit THANKS ButtonCREDITS
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'sWhy 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'sWhy 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
" 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