[GUIDE] Decompiling/Recompiling Apk's using Apktool - HTC Desire C

Hello Guys, this is for the one who wanna learn how to decompile recompile apk's I created this thread here because for desire c user.. easily find..
Requirements:
-Java Link
-Winrar Link
-Notepad++ Link
-and Apktool Link (Credits Rizal Lovins)
-Common Sense/Brain
Extract it on C:/Apktool (Create a Apktool Folder)
Method
1.Go to C:/Apktool (Where you put tha jar files) also copy your framework-res.apk to C:/Users/(Name)/apktool/(here) and rename it to 1.apk
2.And Put the Apk you want.. put the apk to C:/Apktool
3.Then press SHIFT+Right Click there inside Apktool folder
4.Then CMD will pop-up then type apktool d (name).apk then enter... ex. apktool d Settings.apk (then enter)
5.Then A Folder will Pop-up on C:/Apktool named Settings (if you decompile Settings.apk)
6.Now Sign your output... (if needed)
7.Go to decompiled Folder-dist- press SHIFT+Right Click CMD pop up type... java -jar SignApk.jar testkey.x509.pem testkey.pk8 (decompiled).apk (decompiled)_signed.apk
Optional : Zipalign
Go to decompiled Folder-dist- press SHIFT+Right Click CMD pop up type zipalign -fv 4 (decompiled)_signed.apk (decompiled)_signed_zipaligned.apk
Have Fun Guys...

Related

[How To] Disable Swype Tutorial Pop-Up - for Swype Modders

I always found it annoying when I accidentally hit the Swype button while trying to type a message and the Swype Help Dialog (Tutorial) would pop-up. I thought it was just me but others have complained about this also so I decided to mod the Swype keyboard so this wouldn't happen. However, the Swype button does have other useful functions that I didn't want to remove. This mod only disables the Tutorial pop-up. All other Swype button functions still work. I am doing this on a Linux pc. I don't use Windows but this should work similar in Windows.
Credits:
00.ante - Used his Keyboard for Example - http://forum.xda-developers.com/showthread.php?t=942392
MikeyMike01 - Inspired by his Home Haptic fix
What you will need:
1. A Swype Keyboard
2. Smali/Baksmali - http://code.google.com/p/smali/
3. APK Manager - Optional
How To Instructions (Using Smail/Baksmali, you can also use APK Manager for this):
1. Extract classes.dex from Swype.apk and place in same folder as smali.jar and baksmali.jar
2. Open Terminal, navigate to folder where you put classes.dex and run this command: java -jar baksmali.jar -o classout/ classes.dex
3. This will create a folder called "classout"
4. In the classout folder, navigate to com/swype/android/inputmethod
5. Open SwypeInputMethod.smali in text editor
6. Delete all lines of code that contain "HelpDialog" and "HELP_DIALOG", There is one line that is embedded within a method. Delete starting at .method to .endmethod.
7. There are two lines of code that have just "Help" in them. Do not delete these.
8. Save and Close SwypeInputMethod.smali
9. Delete classes.dex that you extracted
10. Run this command in terminal: java -Xmx512M -jar smali.jar classout/ -o classes.dex
11. Copy the classes.dex that is created and drop it into your swype.apk
12. Place swype.apk into your CWM install zip
13. Flash and enjoy.
Attached is an example of this mod using one of 00.ante's Swype KB's. If you don't want to go through the trouble of baksmali/smali, you can just extract the classes.dex from this and drop it into your swype kb. Should work.

{Tutorial} How To Decompile/Compile Apk

Okay So Alot Of People Asking On How To Decompile/Compile .APK ITS EASY!! You Are Just Too Lazy To Read And Learn it the Proper way
No Offense The First Thing You Need to Do is Download Boudz-Filezzz.zip in Attachments you will find aapkt apktool.jar and apktool.bat and baksmaali
Okay So Extract
The First Thing To DO is :
--First Get framework-res.apk From System/Framework/Framework-res.apk,And SystemUI From System/App/SystemUI.apk And TWframework-res.apk From System/Framework/TWFramework-res.apk And Place With The File You Extracted..
--Next Press Shift+Alt and Right Click on An the white space in the File (Boudz-Filezz)
and Press open Command Prompt
Now Type ::
Code:
apktool if framework-res.apk
Now it Will Install the Framework
Next is To Install SystemUI,its the same just replace framework-res.apk with SystemUI.apk (IT IS IMPORTANT TO MENTION THE APK)
Code:
apktool if SystemUI.apk
And
apktool if twframework-res.apk
Click to expand...
Click to collapse
Okay Now We Installed The Files Now I Want To Decompile SystemUI.apk For Example With Half Of Ace i Users Fail in..
open Command Prompt by Pressing Shift+Alt and Right Click on An the white space in the File (if its open no need)
And Type
Code:
apktool d SystemUI.apk Test
Okay So Lemme explain The Code apktool is the file and D stands For Decompile And SystemUI.apk Which is the apkname And Test Is the Folder that the SystemUI.apk will be Decompiled To.
That Wasn't Bad Wasn't it?
Now Edit Something in test folder (Decomplied SystemUI.apk) Change Some 9.PNG From Some ROM TO your SystemUI and Xml is Also readable edit some codes ... :silly::silly:
Now After Doing That we Need To Compile It Back to An APK this is Easy... just Type in Command Prompt
Code:
apktool b test
Okay So apktool is the file itself and B Stands For Compile And Test is the Folder that i Want to Compile it To a APK so press enter and Open the test>systemUI>dist SystemUI.apk Thats It You Successively Modded A SystemUI Okay So I Wont Provide Any Credits Because i Wrote all This myself and Didn't Need any help all was done by me Please If I Helped You In This Tutorial Dont Forget To Hit The Thanks Button
Boudz-FILEZZ:[URL="http://www.mediafire.com/?qq3zf5yw1mwy5o8"]http://www.mediafire.com/?qq3zf5yw1mwy5o8[/URL]​
I always get an error

[FULL][Procedure] How To Decompile Recompile apk and How to Setup Apktool

Here i tells you. How to use apktool & Multitool
Step 1: Necessay files (Download From XDA-Developers.com)
Step 2: How to enter commands for .apk Files
Step 3: How to setup apktool
Step 4: Themeing & Modding
--> Step 1- /Java (Install java first)
/Apktool
OR
/Multi Tool (Download attachment with multitool name as visualbasic(VisualBasicPowerPacksSetup)_without this file it not work)
/.netFramework v4.5 or Higher (For Multitool)
/7zip (Extracting .apk and other archieve or extention)
/Notepad++(used to read .xml files in decompiled apk)
--> Step 2- 1/ For systemui.apk
/commands
cd..
cd..
cd android/apktool
/apktool if framework-res.apk
/apktool if systemui.apk
/apktool d systemui.apk (d- for Decompiling apk)
/Themeing (Dont messup Here and there without any reason or you get uncompiled apk)
/apktool b systemui systemui-new.apk (b- For Re-Compiling apk)
Sign your new apk in order to working.
after compiling apk your new apk looks like / systemui-new.apk
Now Decompile It with 7zip & also place original apk of the current rom in desktop into a folder(decompile it also)
/Take two files from original Decompiled apk / 1.META INF 2.Android Mainfest.xml
/Add these two files into extracted /systemui-new.apk/Recompile it with 7zip/Now you use your new apk
---------------------------> Done
2/ For Framework-res.apk
/commands
cd..
cd..
cd android/apktool
/apktool if framework-res.apk
/apktool if Twframework-res.apk
/apktool d framework-res.apk (d- for Decompiling apk)
/Themeing (Dont messup Here and there without any reason or you get uncompiled apk)
/apktool b framework-res framework-res-new.apk (b- For Re-Compiling apk)
Sign your new apk in order to working.
after compiling apk your new apk looks like / framework-res-new.apk
Now Decompile It with 7zip & also place original apk of the current rom in desktop into a folder(decompile it also)
/Take two files from original Decompiled apk / 1.META INF 2.Android Mainfest.xml
/Add these two files into extracted /framework-res-new.apk/Recompile it with 7zip/Now you use your new apk
---------------------------> Done
Note : if this command not work in order to recompile your framework/only this line /apktool b framework-res framework-res-new.apk
than use new command /apktool d framework-res.apk framework1 (d- for Decompiling apk)
/apktool b framework-res.apk framework1 (b- For Re-Compiling apk)
others / settings.apk (recompile,decompile like systemui.apk)
cd..
cd..
cd android/apktool
/apktool if framework-res.apk
/apktool if Twframework-res.apk
/apktool d settings.apk (d- for Decompiling apk)
/Themeing (Dont messup Here and there without any reason or you get uncompiled apk)
/apktool b settings (b- For Re-Compiling apk)
Sign your new apk in order to working.
For checking compiled settings.apk/ dist/settings.apk
after compiling apk your new apk looks like / build/apk/here
Now Decompile It with 7zip & also place original apk of the current rom in desktop into a folder(decompile it also)
/Take two files from original Decompiled apk / 1.META INF 2.Android Mainfest.xml
/Add these two files into extracted /settings.apk(check in build folder)/Recompile it with 7zip/Now you use your new apk
---------------------------> Done
--> Step 3- A)Setuping Apktool
/only apktool not multitool (both are different)
open your laptop/desktop/ Drive c: make folder named/ android/apktool (inside android folder make apktool folder)
locate where you save apktool/unpack it with winrar or 7zip and copy whole files/paste it into/
c:/android/apktool(paste here)
Now Add three files of your ROM/Systemyui.apk , Framework-res.apk , Twframework-res.apk
after this/ just open apktool folder of c: drive where you add files in small window
You see window button in taskbar /click on it/search/cmd/ when you see / hit enter
Type commands <--------------------------------------------------------------------------------------
cd..
cd..
cd android/apktool (this command locate your apktool folder in c:drive)
/apktool if framework-res.apk (add 1.apk >c:/user/hp/apktool/ 1.apk
/apktool if systemui.apk (add 127.apk >c:/user/hp/apktool/ 127.apk
/apktool d systemui.apk (Decompile your apk>see decompiled apk in / c:/android/apktool
/apktool b systemui.apk (Recompile your apk)
--> Done
--> Step - B)Setuping MultiTool(Also type of apktool - Easy to use
Unpack your multitool.zip
Looks like AndroidMultitool_3.0_win7/AndroidMultitool
cut AndroidMultitool / directly paste it to
c:/AndroidMultitool(inside folder and where to add files)
/Compiled_apk
/Compiled_jar
/Decompiled_apk
/Decompiled_jar
/Files
/Log
/Program_Files
/Signed_apk
/Android Multitool.exe
Add these files in /Files folder/Systemyui.apk , Framework-res.apk , Twframework-res.apk
Now Run Android MultiTool.exe
I think you know much very well after run Android Multitool.exe /how to decompile , recompile etc.
Save my time.......
--> Done
--> Step 4 - After Decompile theme your self or what ever.
--> Done
I Dont Know The Developers Name..!!! Who Develop APKTOOL AND MULTITOOL
Credits -
1.Developer Of Apktool
2.Developer Of Multitool
Credits - To Me Kartik [email protected]
Better To Use Advanced Apk Tool..Its So Fast and Easy To Use and User friendly...

[TUT][MOD][Rom Logo In Settings/About]

Hello Xda Members Today I Bring You A Tutorial On How To Add Rom Logo To Settings About Phone
Okay Let's Start
What You Will Need:
Knowledge How To Decompile/Recompile Apk's
Apktool
Notepad++
Winrar
Settings.Apk
Framework-res.apk <From Rom>
Firstly, Move your Settings.apk and framework-res.apk to your "APKTOOL" Folder , And start the below steps
Open Apktool Folder And Type:
HTML:
apktool if framework-res.apk
For Xperia Devices:
HTML:
apktool if taframeworkname.apk
For Samsung:
HTML:
apktool if twframework-res.apk
Then Type
HTML:
apktool d Settings.apk
Download logo_row.xml file from This Link and put it in Settings/res/layout
Now go to xml folder.Search device_info_settings.xml and open it via Notepad++
Find Those Lines:
HTML:
<PreferenceScreen android:title="@string/about_settings"
xmlns:android="http://schemas.android.com/apk/res/android">
And Below Them Paste This:
HTML:
<PreferenceScreen android:key="rom_logo" android:layout="@layout/logo_row" />
Than Save the file and close it
After This, you need to have a romlogo in specific resolutions of your device,
Put the file into:- drawable-(your device resolution)
The Banner/logo should be named as "romlogo" {Without Double inverted commas- " ")
After you pasted the rom logo into the drawable(your resolution here)
Go to apktool and open cmd command prompt again and type
HTML:
apktool b (settings)
Or whatever your folder is called
Now We Need To Sign Apk
Now with Winzip/WinRar/7-zip, Open Original Settings.apk and Copy "Meta-inf" folder and "AndroidManifest" file
to settings/build/apk
After This, Come back to apktool folder and type the below code to Recompile apk
HTML:
apktool b (settings)
Now go to settings/dist and there you have your settings.apk with your logo
Press Thanks If This Guide Was Helpfull

[GUIDE][WINDOWS][HOW-TO] Deodex CM7.2 Or Any ROM Manually

I know this is an old news, but I think most of people out there or in here wondering
if they could deodex their CM7.2 or other ROM correctly. After trying every kitchen/apps
etc. to deodex, it's seems worthless. Moreover, as newbie, setting up the kitchen is so
complicated & frequently giving me a hard time. But no worries, these are the steps on
how to deodex ROM manually
NOTE:
1 THIS METHOD HAVE ALREADY DONE ONLY BY WINDOWS
2 THIS METHOD IS BASICALLY WORKS ON ANY ROM
3 BEFORE ASK ANYTHING, PLEASE UNDERSTAND THE WHOLE MAIN THREAD FIRST
Requirements:
1 The Manual-Deodexer.zip [in attachments below]
2 A working brain :silly:
3 All framework files
4 APK/JAR to deodex
5 A working PC of course
STEP A: Setup a working folder
1 Extract the Manual-Deodexer.zip
2 Create a folder named "Deodexer" [any place] in your PC [EXAMPLE: D:/Deodexer]
3 Place all of the files included in Manual-Deodexer.zip to the "Deodexer" folder
[baksmali.jar, smali.jar, java.awt.jar, busybox, dexopt-wrapper, zipalign.exe]
STEP B: Deodexing All JARs First [system/framework]
1 Place all of your framework files also in "Deodexer" folder
2 Deodexing framework files [I'll use android.policy.jar for a start]
3 Run CMD in mentioned folder [Shift + Right Click] & type:
Code:
java -Xmx1024m -jar baksmali.jar -c :core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar -x android.policy.odex
THIS WILL CREATE "out" FOLDER
4 Make sure the "out" folder is there, then in CMD, type:
Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
THIS WILL CREATE "classes.dex"
5 Finally, deodex android.policy.jar:
> After the classes.dex created, directly delete both android.policy.odex & its "out" folder
> Open android.policy.jar with 7ZIP without extracting
> Drag the classes.dex in the 7ZIP window in the root folder
> Close the 7ZIP & you've deodexed android.policy.jar
[REPEAT THE SAME STEP FOR OTHER JARs 1 BY 1] [ON MY CM7.2, I GOT 19 JAR Files]
> So, basically repeat the steps for 19 times :laugh:
STEP B: Deodexing APK [system/app]
1 Place any APK you want to deodex also in "Deodexer" folder [I'll use SystemUI.apk for example]
2 Run CMD in mentioned folder [Shift + Right Click] & type:
Code:
java -Xmx1024m -jar baksmali.jar -c :am.jar:android.policy.jar:android.test.runner.jar:bmgr.jar:bouncycastle.jar:com.android.location.provider.jar:com.google.android.maps.jar:core.jar:core-junit.jar:ext.jar:framework.jar:ime.jar:input.jar:java.awt.jar:javax.obex.jar:monkey.jar:pm.jar:services.jar:sqlite-jdbc.jar:svc.jar -x SystemUI.odex
THIS WILL CREATE "out" FOLDER
3 Make sure the "out" is there & in CMD type:
Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
THIS WILL CREATE "classes.dex"
4 Finally deodex SystemUI.apk:
> After the classes.dex created, directly delete both SystemUI.odex & its "out" folder
> Open SystemUI.apk with 7ZIP without extracting
> Drag the classes.dex in the 7ZIP window in the root folder
> Close the 7ZIP windows & you've deodexed SystemUI.apk
[REPEAT THE SAME STEPS ON OTHER APK YOU WANT TO DEODEX]
STEP C: Zipaplign Deodexed APK For Performances [OPTIONAL][ONLY APK]
1 In the same CMD prompt windows, type:
Code:
zipalign -v 4 "anyapk".apk zip_"anyapk".apk
2 A zip_"anyapk".apk file will be created. Delete your original deodexed "anyapk".apk
& rename zip_"anyapk".apk to the original "anyapk".apk you've deleted
3 Install it normally or push it to system/app [rw-r-r] method
NOTE:
1 TO DEODEXED Emails.apk & MobilePrint.apk YOU'LL NEED ANOTHER COPY OF "java.awt.jar"
2 IT IS DEODEX, SO BASICALLY YOU DON'T HAVE TO SIGN THE APK
ALL CREDITS GOES TO @sicopat FOR HIS WONDERFUL THREAD
To me too, why not, for making it snappy
Did I say it is a simple & quicker job??? No, it doesn't :silly:
Hit the thanks button if I helped

Categories

Resources