(guide)how to mod an apk - Android Software/Hacking General [Developers Only]

U WANT TO KNOW HOW TO MOD
U ARE WELCOME HERE TO LEARN AND SHARE KNOWLADGE
WHAT DO U NEED TO START MODDING APK
U NEED THESE TOOL'S:
U NEED JAVA FIND AT :www.java.com
I HAVE COMPILED THIS ZIP SO U DONT HAVE TO SEARCH FOR THEM
U NEED 7Zip
U NEED APKTOOL
Click to expand...
Click to collapse
FIRST STEP's (CHILD'S PLAY)
U NEED TO SET UP EVERYTHING FOR IT TO WORK SO NUMERO UNO IS:
1.DOWNLOAD ALL TOOL'S
2.INSTALL JAVA AND SETH PATH
3.EXTRACT THE ZIP I PROVIDED INTO THIS PATH : MY COMPUTER/LOCAL DISK C
U NOW HAVE ALL DONE WHAT NEED'S TO BE DONE BEFOUR U START TO MOD
SECOND STEP( U ARE ALREADY CRAWLING)
U NEED TO KNOW THE BASIC COMMANDS FOR APKTOOL:
OPEN UP CMD INSIDE THE EXTRACTED ZIP (WHEN IT IS EXTRACTED IT IS A FOLDER NAMED APKTOOL)
THESE ARE THE COMMANDS:
INSTALING FRAMEWORK FILE'S:
1.apktool if SemcGenericUxpRes.apk ------- to install framework
2.apktool if framework.apk ------- u need this framework too (for the decompiling to work)
DECOMPILING APK FILES (WHICH EVER U WANT TO MOD) EXAMPLE:SystemUI.apk
1.apktool d SystemUI.apk ------- to decompile
2.apktool b SystemUI -------- to compile the apk NOTE:DONT WRITTE THIS apktool b SystemUI.apk becouse it won't work then.
WILL CONTIONUE DONT WAORRY

Related

[Q] How to replace SystemUI.apk

Hi guys.
I am trying to change a complete look of a mod, call it theming.
By doing this I edited framework-res.apk successfully by using apk manager.
Now I changed some png from res/drawable-ldpi and zipped the apk (left it unsigned) and pushed it to the dev. wiped dalvik and reboot.
No Statusbar there.
How do I get the SystemUI WITH my changes together, that it will run perfectly again?
-----------
Is there no one who can be of help?
Now I tried APKtool. same.
I do following:
1. I save METAINF folder for later
2. open commandline and enter: apktool d SystemUI.apk
3. I put the images into the folder, generated by apktool, to the right place
4. I enter apktool b SystemUI SystemUIChanged.apk
5. I open SystemUIChanged.apk in 7zip, put the saved before METAINF folder into it.
6. I start phone into recovery, mount system folder and enter on pc in commandline: adb push SystemUIChange.apk /system/app/SystemUI.apk
7. I wipe Dalvik and restart phone.
8. Statusbar still not there
please help someone
i was able to do this successfully in creeds ROM 1.7
do not change the .9 pngs using normal editors...
go here to see how : http://developer.android.com/guide/developing/tools/draw9patch.html
if u just want to change the other pngs then just use 7zip.
unzip it then make all changes and replace the files into the 7zip.
if u want to change the xml files and stuff then u need to decompile using apk manager.
then i just flash it using cwm recovery.
hope i helped
psyche.11 said:
i was able to do this successfully in creeds ROM 1.7
do not change the .9 pngs using normal editors...
go here to see how : http://developer.android.com/guide/developing/tools/draw9patch.html
if u just want to change the other pngs then just use 7zip.
unzip it then make all changes and replace the files into the 7zip.
if u want to change the xml files and stuff then u need to decompile using apk manager.
then i just flash it using cwm recovery.
hope i helped
Click to expand...
Click to collapse
that helped ... it wasn´t the png9s, just usual pngs.
I used 7zip, but it didn´t function.
but after 2nd reboot it work.
so it worked? status bar fine?

(GUIDE) How to use Apktool Apk manager Baksmali and Adb

Hello Guys....
Just been watchin around our forum and The Galaxy Fit Development Group in FB and came to know that many are not able to decompile, compile, using apktool and apk manager !!! And few are not able to use the baksmali tool and even Android debugging bridge (ADB) So Decided to make a Guide on How to use all these
The tools required are attached along with this file...
So here we go....
[How To Use APK Tool]
If you're using apktool for the first time thn
Place framework-res.apk and twframework-res.apk from STOCK Firmwares (Do not take it from Custom ROM )
Thn open command prompt in the current window and type the following code
Code:
apktool if framework-res.apk
apktool if twframework-res.apk
The Dependencies would be installed in apktool folder in C:\Users\USER NAME\apktool\framework and also check if u hav 1.apk and 2.apk present inside the folder
Decompile And Compile Apk's Using apktool
Place the apk file that u wish to decompile in the downloaded apktool folder
Open command prompt in the current window and type the following code
Code:
[To Decompile] apktool d "apk name.apk"
[To Recompile] apktool b "apk name"
Example:
Code:
[To Decompile Mms.apk] apktool d Mms.apk
[To Recompile Mms.apk] apktool b Mms
The Compiled apk would be in "dist folder" inside the "decompiled folder"
[How To Use APK Manager]
Always use apktool to install dependencies even if u r gonna use apk manager
Place the apk tat u wish to decompile in "Place here for modding folder"
Open Script.bat in the folder and Press 9 to decompile and 11 to recompile
The decompiled folder would be in "Projects" folder and recompiled apk would be in "place here for modding folder"
[How To Use Baksmali]
Smali/Baksmali is an assembler/disassembler for the dex format used by Dalvik
The names "smali" and "baksmali" are the Icelandic equivalents of "assembler" and "disassembler" respectively
Smali Editting can be done through apk tool as well as apk manager but all those needs experience and practice
Place either the .apk or .jar file who's dex u want to decompile in that baksmali folder
Right click and Edit 1.bat using notepad++
Code:
java -jar baksmali.jar -x "filename"."file extension" -o classout
Example:
Code:
[To Decompile Mms.apk] java -jar baksmali.jar -x [B]Mms.apk[/B] -o classout
[To Decompile android.policy.jar] java -jar baksmali.jar -x [B]android.policy.jar[/B] -o classout
U would get a folder called classout
Make necessary changes and to compile back just press 2.bat
U would get classes.dex in the current folder
Replace this classes.dex with the classes.dex in the unmodded file
[How To Use ADB]
Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device
With this adb u would be able to push pull files from your mobile, Logcat and much more
I would explain only the basic that is used most often that is pullin and pushin of files
Place the file tat u r about to push into the ADB folder
Code:
[To Push system apps] adb push "[B]apk name".apk [/B]/system/[B]app[/B]/[B]"apk name".apk[/B]
[To Push system framework files] adb push [B]"name".jar[/B]/system/[B]framework[/B]/[B]"name".jar[/B]
[To Push files to your SD Card] adb push [B]"filename.extension"[/B] /sdcard/
Example:
Code:
[To Push Mms.apk] adb push Mms.apk /system/app/Mms.apk
[To Push android.policy.jar] adb push android.policy.jar /system/framework/android.policy.jar
[To Push files to your SD Card] adb push Readme.txt /sdcard/
Credits:
Google
And to all those who taught me [How To Use These]
Tools
Reserved
Rooting
Sorry, I know this is not the right thread to post this..
But i need help
I am a newbie and never had rooted my android phone... I know that there had been many threads about rooting this phone..but i am a little afraid about bricking my phone..that's why i am asking again..
The specs of my phone are given in the attachment...Please give a guide on rooting and unrooting my phone..
Akshit97 said:
Sorry, I know this is not the right thread to post this..
But i need help
I am a newbie and never had rooted my android phone... I know that there had been many threads about rooting this phone..but i am a little afraid about bricking my phone..that's why i am asking again..
The specs of my phone are given in the attachment...Please give a guide on rooting and unrooting my phone..
Click to expand...
Click to collapse
May be u should try using the search option next time...
but since u asked for it
http://forum.xda-developers.com/showthread.php?t=1606380
Really good guide mr.wilfred...
Want to ask something about compile and decompile apk from ICS version... what tool I need to compile and decompile it? And which version?
Thank you....
Sent from my GT-S5670 using Tapatalk 2
AldoSebastian said:
Really good guide mr.wilfred...
Want to ask something about compile and decompile apk from ICS version... what tool I need to compile and decompile it? And which version?
Thank you....
Sent from my GT-S5670 using Tapatalk 2
Click to expand...
Click to collapse
A seperate version of Apk tool has been made and i saw it few days back in xda only.... I would let u know if i get that link... ^_^
http://www.xda-developers.com/android/modified-apktool-for-android-4-0-4/
this is the one for ics apks
unable to compile using your method
Avilove.Cullen said:
unable to compile using your method
Click to expand...
Click to collapse
which are u talking abt.......apks dexes or jar files........
Avilove.Cullen said:
unable to compile using your method
Click to expand...
Click to collapse
Thn u would hav done any error....
btw... wat was the error u got...
Avilove.Cullen said:
unable to compile using your method
Click to expand...
Click to collapse
Hey Avi from personal experience,.. I found out something none of these guides tell us !
U need to put a file called aapt in apkmultitools/platformtools/ for u to compile properly in some computers,..!
I had an error which read as
java.io.exception : cannot run command [aapt ....blah blah blah]
if this is the same error,.. just put the right aapt file,..
also,.. to mod JELLY BEAN apks,.. all u gotto do is put the latest aapt that u can download using Android SDK,..
Havent tested whether it works .. but saw that some did succesfylly decompile using this method (no not in xda,.. in some other forum,.. )
I did all this and I get a folder with all the this stuff in it with smali extentions. I was wondering how do you actually look at the code of the apk and program it self. The reason why I want to look at the code is to see apps are written; the best way I know how to is by looking at code and figuring it out.
brievolz84 said:
I did all this and I get a folder with all the this stuff in it with smali extentions. I was wondering how do you actually look at the code of the apk and program it self. The reason why I want to look at the code is to see apps are written; the best way I know how to is by looking at code and figuring it out.
Click to expand...
Click to collapse
FYI smali's are dalvik opcodes... u can use dex2jar to view the smali in java language which is easier wen compared to smali... and to under these languages u would hav to learn java or hav xperience and interest too
need a recommendation for APK Tool
Hi, I have a i9305 SG3 using a custom ROM Jellybean Ver 4.1. I want to learn how to decompile, edit, and recompile code in my SystemUI.apk file. I know I need an APK tool/manager of some sort. However, after looking through your thread (and looking into other research on google) I wasn't able to find conclusive evidence on WHAT the name of a stable APK Program is and WHERE to get it.
*
I am using Windows 7 64x PC and want to learn how to edit APKs. I have appreciated reading your threads and hope to learn more. I need to find the right APK software to start with. Suggestions please....
droido123 said:
Hi, I have a i9305 SG3 using a custom ROM Jellybean Ver 4.1. I want to learn how to decompile, edit, and recompile code in my SystemUI.apk file. I know I need an APK tool/manager of some sort. However, after looking through your thread (and looking into other research on google) I wasn't able to find conclusive evidence on WHAT the name of a stable APK Program is and WHERE to get it.
*
I am using Windows 7 64x PC and want to learn how to edit APKs. I have appreciated reading your threads and hope to learn more. I need to find the right APK software to start with. Suggestions please....
Click to expand...
Click to collapse
Hey there..... Hello..... U can either use apk manager or apk tool to decompile nd recompile apk's ... But as far as i know ICS rom's had different dependencies hence a diff version of apktool wer required .... since your rom being jelly bean ,As a wild guess, it MAY hav certain problems as such in ICS's ROM's ..... The best solution is either ask a fellow dev from your community who has been decompilin/recompilin apps or else there's always a better partner ( google ) .....
Sent from my GT-S5670 using XDA
Hey wilfred for decompiling app from custom rom like cm7 should we still use stock framework first??
MajinSaiyan4 said:
Hey wilfred for decompiling app from custom rom like cm7 should we still use stock framework first??
Click to expand...
Click to collapse
nop.... use CM7 framework-res.apk !!!
wilfredcool007 said:
nop.... use CM7 framework-res.apk !!!
Click to expand...
Click to collapse
Ok thnx but i had problems recompiling systemUI.apk with apktool even without any modifications sry cant post error right now im on phone..
MajinSaiyan4 said:
Ok thnx but i had problems recompiling systemUI.apk with apktool even without any modifications sry cant post error right now im on phone..
Click to expand...
Click to collapse
Did u delete the public.xml before u could recompile ??? if so u wouldnt hav got any error.... to be on the safer side send me the error tat u get....
wilfredcool007 said:
Did u delete the public.xml before u could recompile ??? if so u wouldnt hav got any error.... to be on the safer side send me the error tat u get....
Click to expand...
Click to collapse
Uh is it necessary to del public.xml??ok i wil try when im on pc..actually i was trying jellybean layout mod but i was unsuccesful

[Q] Different method to edit an Apk: differences?

Hi to all! What are the differences between this:
Rename the *.apk to *.zip
Extract the *.zip file
Edit whatever you want
Compress all files again
Rename the *.zip to *.apk
and this:
Download ApkTool and "install" it
Using CMD navigate to the *.apk folder
Use this command "apktool d app_u_want_edit.apk"
Edit whatever you want
Use this command "apktool b app_u_want_edit"
???
Thanks in advance.
apktool
Francoiky said:
Use this command "apktool d app_u_want_edit.apk"
Edit whatever you want
Use this command "apktool b app_u_want_edit"
Click to expand...
Click to collapse
.
Using apktool be more change.
Normally you do not make changes to the file classes.dex and resources.arsc included in the APK files.
.
ze7zez said:
.
Using apktool be more change.
Normally you do not make changes to the file classes.dex and resources.arsc included in the APK files.
.
Click to expand...
Click to collapse
So, if I would change graphics only I could simply unzip and zip again, right?
As long as they are not .9.pngs then this will work but it will only work for images. I would advice learning apktool as this is the proper way to do it and you have less chances of messing something up. Alot of images are indexed and if not done properly can lead you to a boot loop
Sent from the Bat Cave

[How to] noobs guide to decompile/recompile android application

Guide to decompile android application
REQUIREMENT
Apktool [ http://www.mediafire.com/?ooaflvs6nvo5xvq ][Thanks to brut.all for this apktool]
Java JDK/JRE 32 bit [please google it guy's]
Little knowledge on cmd
__________________________________________________ __________________________________________________ _____________________
Preparation before WORKING
Process :-
1)now install the java in your pc/lappy
then copy the apktool.zip & goto directory C:/
make a folder name apktool (u can name it by watever u like)
now goto that folder & paste the zip
extract that zip there...
2) now copy the .apk or jar file which u wnt to decompile
& paste it on apktool folder.....
also copy the framework-res.apk of that rom &
paste it on that folder..
Decompiling application
3) now open cmd
Your cmd will probly look like this..
C:\users\yourname>
so type in
cd.. (yes include the '..' and press enter after you type each command)
this will get you to back directory so now you will see
C:\users>
so type again
cd..
you should now see this:
C:\>
now type
cd apktool (and you are in the apktool directory)
4)Installing Framework
Now that you are in directory we need to install the device's framework to your system for it to compile correctly so type this:
apktool if framework-res.apk
this will install the devices framework to your system (need to do this)
5)now to decompile the apk you want to edit.. type this:
apktool d music.apk mod
music.apk is the apk your decompiling
mod is the folder you're creating for the decompiled apk
do whatever you want to do with your apk...
NOW RECOMPILING
6)now to recompile your new apk type this:
apktool b mod music-new.apk
mod is the folder with your edited files
music-new.apk is your new apk file
Now we are NOT done... we cannot use the new apk's...
now make two separate folder a & b
copy-paste the original music.apk in 'a'
& music-new.apk in 'b'
use something like 7zip, take the 'resources.arcs' file and any other xml files you edited out of the "new-edited" apk and copy them into Original apk
now add to archive ...the origanl apk in zip format
& at the end of the file name .apk ( i mean give the file format name as .apk insted of .zip)
Now you are almost done..... :good: :good:
IF it is a system app then don't sign it....otherwise u have to sign that app....
That's all
don't forget to hit thanks or comment.... :good: :good:
Quick info: It doesn't work for chineese roms
lozohcum said:
Quick info: It doesn't work for chineese roms
Click to expand...
Click to collapse
is sony roms r chinese?!
Sent from my GT-S5360 using xda app-developers app
No but you can't use it for MIUI/Lewa porting, just saying
lozohcum said:
No but you can't use it for MIUI/Lewa porting, just saying
Click to expand...
Click to collapse
hmm its for gb,ics and jb based roms.. and its very simle guide :good:
ASK
Sorry Bro.. I am trying this method to decompile and recompile *.apk in system, but it say needed "twframework-res.apk" / 2.apk .. where i can get this file..? because there is nothing twframework-res.apk file in my phone...
thanks..
Java_Indo said:
twframework-res.apk
Click to expand...
Click to collapse
It is in system/framework
But be very careful
Because it may cause your handy not to boot
Regards
Naney said:
It is in system/framework
But be very careful
Because it may cause your handy not to boot
Regards
Click to expand...
Click to collapse
sorry , twframework-res.apk cannot found in framework folder,
btw do you have twframework-res.apk for tipo?
if ya, would u like to share with me...
thanks for your explanation.
Java_Indo said:
do you have twframework-res.apk for tipo?
Click to expand...
Click to collapse
Which ROM are you using?
Naney said:
Which ROM are you using?
Click to expand...
Click to collapse
sorry .. usually iam using JB ROM Cyanogen, but for now iam using MIUI v5 . ..
Java_Indo said:
do you have twframework-res.apk for tipo?
Click to expand...
Click to collapse
Here you are...

[Guide]Easy recompile decompile for noobs with mobile

Hi guys everyone here getting many problems while recompiling ics + apps so here is solution
u don't require java SDK like PC
Requirements - rooted mobile(any)
Sorry for repost maybe will usefull for thoose who doesnt have any PC but want to mod your young confirm worked on armv6 or galaxy y
Original threads
http://forum.xda-developers.com/showthread.php?t=2388135
[app]apktool.apk[share]
Hey all im here to share a tool its apktool.apk
Im not the creator of this app im just share it here all creddits belongs to the developer of this app and google
Ok how its works?
This tool are similiar with apktool on windows
U can decompile an apk recompile it and u can edit all the resources inside it
How to install?
Download the tool from here
http://code.google.com/p/apktool/
Im suggested u are downloading all arm version
Estract the package and put apktool folder on sdcard/here
And navigate to sdcard/apktool/install apktool.apk
Install and run
NOTE:THIS APP REQUIRED ROOT ACCESS
DISCLAIMER: THIS IS FREE OPEN SOURCES TOOL U CAN USE IT BUT USE WITH YOUR OWN RISK
NOTE2: IF U FACING ANY PROBLEM DUE DECOMPILING PROCESS OR RECOMPILING PROCESS PLEASE INSTALL UR FRAMEWORK U CAN FIND IT ON SDCARD/APKTOOL/FRAMEWORK/HERE CHANGE 1.APK WITH YOUR FRAMEWORK
How to install framework?
gB: copy frameworkres.apk and tw frameworkres.apk to sdcard(any folder but remmember the path)
Open apktool app navigate to framework and tw framework long press on it then choose import as enjoy
Ics/jb
Copy frameworkres.apk and navigate apktool app longpress on it then choose import as
CREDDIT:
DEVELOPER OF THIS APP(i dunno who its him)
Google
Atep sujana
Ogy
Evanlocked
original thread - http://forum.xda-developers.com/showthread.php?t=2408640
i need this,thanks!!!

Categories

Resources