Decompile/Recompile Jellybean APK's - Sprint Samsung Galaxy S III

Ok everyone, this is my first tutorial that I am ever putting out and I will try to be as thorough as possible. This tut is not so much for the people that dont know much about android, it is more for the people that understand most of it already. But as always feel free to read through it and start learning as most of us around here have! So without further a do lets get started!!
FIrst you need 7-zip!!! So go install it!!
So first, the first thing you need to do is go to this link and download the apktools and aapt that are in the zip:http://www.mediafire.com/?acrgcd0w850q0gj
After you extract this zip you will have a folder with all the tools we will need to do this!!!! Now, if you are doing this then you probably already have done it on Ice Cream Sandwich or Gingerbread. So the next thing we need to do is remove your "Environmental Variables". Environmental Variables are basically the commands that you can run in command prompt from any folder on the computer. If you have the android sdk or previously have tried to decompile and compile Apk's chances are you have the setups in the Environmental Variables.
Remove Unneeded Environmental :
1)Hit the start menu on the bottom left hand corner of Windows
2)Right-Click on Computer and select Properties
3)On the top left-hand corner select Advanced System Settings
4)A window comes up and select the button that says "Environmental Variables"
5)In the window that comes up there is two boxes. We are going to edit the bottom one labed "System Variables". Now grab the scroll bar and look for the variable Path. It should be under OS and above PATHEXT. Double-Click "Path" Variable
NOTE: Each path ends in a ";"
6) So now you will need remove every instance that would point to anything android related. For example one is "C:\SDK\platform-tools\;" If it has this then apktools will run the aapt.exe from that platform-tools folder instead of the one that is provided in the zip.
ALTERNATIVE: An alternative would be to delete the aapt that you have in your folder that you have in your Path System Variable.
I know this was not very clear but I again this is for the users a bit more advanced.
-------------------------------
DECOMPILE/COMPILE SystemUI.apk and other Apk's. EXCEPT framework-res.apk
Ok, you can do this however you want but for this tut I am going to extract apktools.zip and place the folder on my desktop. So we're going to open the folder and then place the APK we want to edit along with a JELLYBEAN framework-res.apk into the folder. For example if you want to edit a CM10 "SystemUI.apk" then you will pull the framework-res.apk from /system/framework/ folder nd place it in your desktop JBapktools folder.
Once you have both SystemUI.apk and framework-res.apk inside the JBapktools folder we are ready to start. First rename either one of these files "apktool149.jar" "apktool142.jar" "apktool144.jar" to just apktool.jar. REMEMBER only rename ONE cus we need to keep track of the versions of the apktools.
Next, bring up the folder window and anywhere on the white space hold SHIFT and Right-Click. Then youre going to choose open command window here.
The first command is going to be: java -jar apktool.jar if framework-res.apk
This is going to install the framework.
Now close out the window.
Next go back to the folder and make sure you rename the jar file you renamed earlier back to its original name. For example if you have apktool144.jar and apktool149.jar in the folder then you must rename apktool.jar to apktool142.jar because that is its original and actual version number.
To decompile and recompile SystemUI.apk you need apktool149.jar so once all three are named to their real names then rename apktool149.jar to apktool.jar.
Now,YOU ARE READY!!! Finally.
Again, In the folder SHIFT +Right-Click and select open command window here.
the command to decompile is: java -jar apktool.jar d SystemUI.apk
---------------------------------------------------------------------------------------
Then hit enter you should see something like this:I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Jose\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
---------------------------------------------------------------------------------------
Of course it wont say Jose but it will say your User Accounts name.
Now in the folder you should see another folder in there called SystemUI. Now its DECOMPILED!!!!! WHOOOOO!!!!!!
You can make your edits and edit the pngs and xmls or the smali or whatever your guru-self wants to do.
Now to RECOMPILE!!!!!
To recompile we will still be using apktool149.jar so no need to rename anything back or whatever.
The first thing you should do is open the SystemUI.apk in 7-zip. You can right-click SystemUI.apk and in there, there should be a META-INF folder and a AndroidManifest.xml file. Select both of these be selecting one first(should be highlighted blue) the holding down Cntrl button and selecting the other file. Now that they are both selected click and drag out to apktools folder. We will need these files in a little bit.
Next in the command prompt window, or if you closed it, the reopen by SHIFT+Right-Click and selecting open command window here. The command to decompile is:
java -jar apktool.jar b SystemUI
NOTE:Make sure you use the letter "b" and dont add .apk to the end of it as we are recompiling the FOLDER and not an actual apk file like we do when decompiling.
It should say something like this:
I: Checking whether sources has changed...
I: Smaling
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Sounds very sexy when reading it I know but we aren't done yet. Remember the META-INF Folder and the AndroidManifest.xml file we pulled out earlier. Ok from the apktools folder select both files again by using Ctrl button. Now type Ctrl C. This will COPY these files to the clipboard. Now that we have the files copied go into SystemUI FOLDER and then go into build folder and then into apk folder. To make it look more neat navigate to /Desktop/apktools/SystemUI/build/apk/ . Now that you are in the apk folder hit Ctrl V. This will PASTE the META-INF and AndroidManifest.xml file into the folder. If a window comes up just choose COPY AND REPLACE.
Last thing to do before we can compile is to go into /SystemUI/dist/ and delete the apk file that is there. The recompiling process is almost complete!!! Go back to command prompt window and just push the ARROW UP on the keyboard. This should bring up the last command you typed in. If its not there then just type it in again:
java -jar apktool.jar b SystemUI
The final apk file should be in SystemUI/dist/ folder!!!!
If you are having any aapt problems then you probably still have a path in Environment Variables that has an aapt.exe in it. Other than that askk and I'm sure myself or someone else can help!!
I will be putting up the how to decompile/recompile framework-res.apk in 2nd post tomorrow or soon because I dont have time right now. The process is different. Have fun themeing and doing whatever it is you do!!!
Added a donate link guys. I'm only 16 so I can't say buy me a beer! So how bout half a gallon of gas? That would be great. Let me know if you donated to I can thank you and put you in my posts!! I have a passion for doing these things so I do not expect any donations from anyone. I do it because I love it and can't get enough of it!! Thanks everyone for being supportive
Donations: Marcismo55
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GL7RKF2EGCH68

FUERRER!!!

1 more just in case

nice
Sent from my Axiom Infekted Razr Maxx using Xparent ICS Blue Tapatalk

Hey man, nice write up. Always good to see people share information.
However, you made it WAY more complicated than it needs to be.
+1 either way. Get you some gas.

_Burst_ said:
Hey man, nice write up. Always good to see people share information.
However, you made it WAY more complicated than it needs to be.
+1 either way. Get you some gas.
Click to expand...
Click to collapse
Sorry man I tried my best :b. And thanks!
Sent from my SPH-L710 using XDA App

Hi,
I was just wondering if the is anyway to decompile the framework-res.apk
I have been trying for ages, but it always gives me errors.
Thanks in advance
Cheers
Corey

fishingfon said:
Hi,
I was just wondering if the is anyway to decompile the framework-res.apk
I have been trying for ages, but it always gives me errors.
Thanks in advance
Cheers
Corey
Click to expand...
Click to collapse
Grab an ICS framework-res apk. Replace manifest resources.arsc and res from the ICS apk with the one from jb apk. Then dexompile with apktool142.jar and then edit. Then recompile with apktoll144.jar. then open the apk that recompiled and take out manifest resources.arsc and res and place back in jb framework sorry if its to confusing. But just a quick write up
Sent from my SPH-L710 using XDA App

monstaX said:
Ok everyone, this is my first tutorial that I am ever putting out and I will try to be as thorough as possible. This tut is not so much for the people that dont know much about android, it is more for the people that understand most of it already. But as always feel free to read through it and start learning as most of us around here have! So without further a do lets get started!!
FIrst you need 7-zip!!! So go install it!!
So first, the first thing you need to do is go to this link and download the apktools and aapt that are in the zip:http://www.mediafire.com/?acrgcd0w850q0gj
After you extract this zip you will have a folder with all the tools we will need to do this!!!! Now, if you are doing this then you probably already have done it on Ice Cream Sandwich or Gingerbread. So the next thing we need to do is remove your "Environmental Variables". Environmental Variables are basically the commands that you can run in command prompt from any folder on the computer. If you have the android sdk or previously have tried to decompile and compile Apk's chances are you have the setups in the Environmental Variables.
Remove Unneeded Environmental :
1)Hit the start menu on the bottom left hand corner of Windows
2)Right-Click on Computer and select Properties
3)On the top left-hand corner select Advanced System Settings
4)A window comes up and select the button that says "Environmental Variables"
5)In the window that comes up there is two boxes. We are going to edit the bottom one labed "System Variables". Now grab the scroll bar and look for the variable Path. It should be under OS and above PATHEXT. Double-Click "Path" Variable
NOTE: Each path ends in a ";"
6) So now you will need remove every instance that would point to anything android related. For example one is "C:\SDK\platform-tools\;" If it has this then apktools will run the aapt.exe from that platform-tools folder instead of the one that is provided in the zip.
ALTERNATIVE: An alternative would be to delete the aapt that you have in your folder that you have in your Path System Variable.
I know this was not very clear but I again this is for the users a bit more advanced.
-------------------------------
DECOMPILE/COMPILE SystemUI.apk and other Apk's. EXCEPT framework-res.apk
Ok, you can do this however you want but for this tut I am going to extract apktools.zip and place the folder on my desktop. So we're going to open the folder and then place the APK we want to edit along with a JELLYBEAN framework-res.apk into the folder. For example if you want to edit a CM10 "SystemUI.apk" then you will pull the framework-res.apk from /system/framework/ folder nd place it in your desktop JBapktools folder.
Once you have both SystemUI.apk and framework-res.apk inside the JBapktools folder we are ready to start. First rename either one of these files "apktool149.jar" "apktool142.jar" "apktool144.jar" to just apktool.jar. REMEMBER only rename ONE cus we need to keep track of the versions of the apktools.
Next, bring up the folder window and anywhere on the white space hold SHIFT and Right-Click. Then youre going to choose open command window here.
The first command is going to be: java -jar apktool.jar if framework-res.apk
This is going to install the framework.
Now close out the window.
Next go back to the folder and make sure you rename the jar file you renamed earlier back to its original name. For example if you have apktool144.jar and apktool149.jar in the folder then you must rename apktool.jar to apktool142.jar because that is its original and actual version number.
To decompile and recompile SystemUI.apk you need apktool149.jar so once all three are named to their real names then rename apktool149.jar to apktool.jar.
Now,YOU ARE READY!!! Finally.
Again, In the folder SHIFT +Right-Click and select open command window here.
the command to decompile is: java -jar apktool.jar d SystemUI.apk
---------------------------------------------------------------------------------------
Then hit enter you should see something like this:I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Jose\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
---------------------------------------------------------------------------------------
Of course it wont say Jose but it will say your User Accounts name.
Now in the folder you should see another folder in there called SystemUI. Now its DECOMPILED!!!!! WHOOOOO!!!!!!
You can make your edits and edit the pngs and xmls or the smali or whatever your guru-self wants to do.
Now to RECOMPILE!!!!!
To recompile we will still be using apktool149.jar so no need to rename anything back or whatever.
The first thing you should do is open the SystemUI.apk in 7-zip. You can right-click SystemUI.apk and in there, there should be a META-INF folder and a AndroidManifest.xml file. Select both of these be selecting one first(should be highlighted blue) the holding down Cntrl button and selecting the other file. Now that they are both selected click and drag out to apktools folder. We will need these files in a little bit.
Next in the command prompt window, or if you closed it, the reopen by SHIFT+Right-Click and selecting open command window here. The command to decompile is:
java -jar apktool.jar b SystemUI
NOTE:Make sure you use the letter "b" and dont add .apk to the end of it as we are recompiling the FOLDER and not an actual apk file like we do when decompiling.
It should say something like this:
I: Checking whether sources has changed...
I: Smaling
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Sounds very sexy when reading it I know but we aren't done yet. Remember the META-INF Folder and the AndroidManifest.xml file we pulled out earlier. Ok from the apktools folder select both files again by using Ctrl button. Now type Ctrl C. This will COPY these files to the clipboard. Now that we have the files copied go into SystemUI FOLDER and then go into build folder and then into apk folder. To make it look more neat navigate to /Desktop/apktools/SystemUI/build/apk/ . Now that you are in the apk folder hit Ctrl V. This will PASTE the META-INF and AndroidManifest.xml file into the folder. If a window comes up just choose COPY AND REPLACE.
Last thing to do before we can compile is to go into /SystemUI/dist/ and delete the apk file that is there. The recompiling process is almost complete!!! Go back to command prompt window and just push the ARROW UP on the keyboard. This should bring up the last command you typed in. If its not there then just type it in again:
java -jar apktool.jar b SystemUI
The final apk file should be in SystemUI/dist/ folder!!!!
If you are having any aapt problems then you probably still have a path in Environment Variables that has an aapt.exe in it. Other than that askk and I'm sure myself or someone else can help!!
I will be putting up the how to decompile/recompile framework-res.apk in 2nd post tomorrow or soon because I dont have time right now. The process is different. Have fun themeing and doing whatever it is you do!!!
Added a donate link guys. I'm only 16 so I can't say buy me a beer! So how bout half a gallon of gas? That would be great. Let me know if you donated to I can thank you and put you in my posts!! I have a passion for doing these things so I do not expect any donations from anyone. I do it because I love it and can't get enough of it!! Thanks everyone for being supportive
Donations: Marcismo55
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GL7RKF2EGCH68
Click to expand...
Click to collapse
Can you edit Contacts.apk?
I am trying to modifying Jelly Bean Contacts.apk. The original Contacts.apk is from Helly Bean. Using apktool that has been used for ICS and other Jelly Bean apks, I can decompile and then recomplie it without any error. However, the recompiled Contacts.apk would not work in cell phone, showing a message "Unfortunately, Contacts has stopped!".
To simplify the problem, I simply do decompiling and then recompiling without any modifications. I found that the size of resources.arsc has been changed from 1480 KB to 1525 KB. The new Contacts.apk causes FC!
Note: Files in smali folder can still be modified. After editing, use apktool to recompile and create a new apk. Then use WinRAR or 7zp to drag the newly created classes.dex into the original Contacts.apk. Such a "modified" Contacts.apk works properly. Note here that we did not modify resources.arsc.
This problem is only related to resources.arsc!!!!!!!

SunnyOKOK said:
Can you edit Contacts.apk?
I am trying to modifying Jelly Bean Contacts.apk. The original Contacts.apk is from Helly Bean. Using apktool that has been used for ICS and other Jelly Bean apks, I can decompile and then recomplie it without any error. However, the recompiled Contacts.apk would not work in cell phone, showing a message "Unfortunately, Contacts has stopped!".
To simplify the problem, I simply do decompiling and then recompiling without any modifications. I found that the size of resources.arsc has been changed from 1480 KB to 1525 KB. The new Contacts.apk causes FC!
Note: Files in smali folder can still be modified. After editing, use apktool to recompile and create a new apk. Then use WinRAR or 7zp to drag the newly created classes.dex into the original Contacts.apk. Such a "modified" Contacts.apk works properly. Note here that we did not modify resources.arsc.
This problem is only related to resources.arsc!!!!!!!
Click to expand...
Click to collapse
Not to sure bud. But try the Tut I put up before your post. If not it might need to be compiled from source so nothing will be broken
Sent from my SPH-L710 using XDA App

Thank you. Can I use Eclipse to edit the source code? Any ideas?

SunnyOK said:
Thank you. Can I use Eclipse to edit the source code? Any ideas?
Click to expand...
Click to collapse
Not to sure on that either man. Sorry
Sent from my SPH-L710 using XDA App

I get errors on installing framework!
Any ideas?

i am getting error is there any way to solve.... check attachment image

I'm gonna try this guide. It seems like the last step is something I haven't done in my current journey with recompiling apks.
tapatalked² from cowsquadGnex®
---------- Post added at 08:49 AM ---------- Previous post was at 08:48 AM ----------
sahil001 said:
i am getting error is there any way to solve.... check attachment image
Click to expand...
Click to collapse
Do you have java installed on your system?
tapatalked² from cowsquadGnex®

cowsquad said:
I'm gonna try this guide. It seems like the last step is something I haven't done in my current journey with recompiling apks.
tapatalked² from cowsquadGnex®
---------- Post added at 08:49 AM ---------- Previous post was at 08:48 AM ----------
Do you have java installed on your system?
tapatalked² from cowsquadGnex®
Click to expand...
Click to collapse
i haved installed but which particular version do you recommend me and if possible please share downloading link

sahil001 said:
i haved installed but which particular version do you recommend me and if possible please share downloading link
Click to expand...
Click to collapse
Just Google how to install java jdk in windows. There are plenty tutorials. You need java JDK
Edited:
Make sure your java is in your windows system variables. Step 6 on this guide
tapatalked² from cowsquadGnex®

cowsquad said:
Just Google how to install java jdk in windows. There are plenty tutorials. You need java JDK
Edited:
Make sure your java is in your windows system variables. Step 6 on this guide
tapatalked² from cowsquadGnex®
Click to expand...
Click to collapse
Ok ill try and let u know if it works or not
Ѕєит fяσм ๓ұ gαℓαχу S2®

sahil001 said:
Ok ill try and let u know if it works or not
Ѕєит fяσм ๓ұ gαℓαχу S2®
Click to expand...
Click to collapse
Did it work man?
tapatalked² from cowsquadGnex®

cowsquad said:
Did it work man?
tapatalked² from cowsquadGnex®
Click to expand...
Click to collapse
No
Ѕєит fяσм ๓ұ gαℓαχу S2®

Related

[TUT] Custom frameworks for Gen 8

So, it seems that more people are taking an interest in making custom frameworks. This isn't really a full tutorial, but I thought it would be helpful to just post some tips on how to go about making your own framework-res.apk, save others a bit of time retreading old ground, since the methods are scattered around the site a bit!
Thanks to wdl1908 for prompting me to do this - should really have done this sooner!
Okay, so basic requirements:
Rooted Gen 8 (Uruk or chulri method)
Original Archos framework-res.apk
zip editor
image editing software
.png's to replace the stock ones with
That's about it! I've been using GIMP on Ubuntu for the image editing, and Phatch for batch resizing, but Photoshop will work just as well on Windows.
Edit: Thanks to wdl1908, have found that Gwenview gives much better results when resizing, compared to Phatch or GIMP. Works on both Ubuntu and KDE.
Use your preferred zip editor to unzip the contents of framework-res.apk to your chosen folder. The main folder of interest is "drawable-mdpi".
The Gen 8's use MDPI resolution images (well, A70 and A101 to at any rate. I think someone mentioned the A32 or A43 used HDPI images). Depending on your .png source, you may need to resize the images. I took my images from themes made for the Desire, which is an HDPI device, so I used GIMP/Phatch to resize them.
In terms of resizing, I compared the size of each new png with the original one, and resized. I know p0rkburn just resizes the images to 66%, but I've had problems with some images not coming out the right size that way. The other thing to watch out for is that not all the images need resizing. Also, some of the textfield and tab_select images are different proportions to their phone equivalents, so again watch out for that.
Once you've replaced the images you want to, they need to be put back into the .apk. I used to copy and paste into the framework-res.apk, but that doesn't work for 9patch files. Also, wdl1908's FrameWorkBuilder makes the compile process so ridiculously easy, there is no reason not to use that instead.
To put the new framework-res.apk on the device, I use this method via ADB wireless, which works fine.
Happy theming!
EDIT: 9patch files
These can be a PITA, until you understand how they work. I used the following two sources to finally crack it :
http://developer.android.com/guide/developing/tools/draw9patch.html
http://forum.xda-developers.com/showthread.php?t=580351
If you are changing 9patch files, you have to decompile and recompile using the FrameWorkBuilder.
I prefer using the draw9patch tool, as it lets you check that the 9patch works as expected.
Spent enough time bashing my head against a brick wall trying to sort out 9patch files, so if I can spare anyone else that, feel free to post/PM..
I'll leave this post here for my recommendations that will be more complex when you need to modify xml files.
In short the procedure is a follows (this needs to be expanded)
unpack the apk to framework-res-UNPACKED dir
decompile the apk to framework-res-DECOMPILED (with apktools)
copy framework-res-MOD to framework-res-DECOMPILED
compile framework-res-COMPILED (with apktools)
unpack the compiled apk to framework-res-COMPILED (with 7za)
remove all the files that are present in framework-res-MOD from the framework-res-UNPACKED dir
remove the file resources.arsc from framework-res-UNPACKED
copy all files from framework-res-UNPACKED to framework-res-COMPILED
zip all files in framework-res-COMPILED to the new framework-res.apk
remove the resources.arsc from that apk file
readd the resources.arsc file without compression to the new apk file
Done
The reason this is so complex is that their are bugs in apktools and the signature needs to be preserved.
FrameWorkBuilder v0.3
README.txt
-------------------------------------------------------------------------------------------------------
Place the script FrameWorkBuilder.sh in a directory and execute.
The script will download all the needed tools.
Place framework-res.apk in the dir framework-res-STOCK
Place mods in framework-res-MOD follow the usual directory structure.
Example:
framework-res-MOD
framework-res-MOD/res
framework-res-MOD/res/drawable-hdpi
framework-res-MOD/res/drawable-mdpi
framework-res-MOD/res/drawable
Execute FrameWorkBuilder.sh to apply the mod.
Modded framework-res.apk will be stored in the directory framework-res-MODDED.
-------------------------------------------------------------------------------------------------------
Changelog
-------------------------------------------------------------------------------------------------------
v0.3 Added xml png duplication check to avoid that animations don't work. .9.png support
v0.2 Added mod checks Added compile failure test
v0.1a BUGFIX cp dirs
v0.1 Initial version
-------------------------------------------------------------------------------------------------------
Have fun modding.
wdl1908 said:
I'll leave this post here for my recommendations that will be more complex when you need to modify xml files.
If you don't mind we'll make it a joined tutorial. I have no time now it's time I got some sleep.
Click to expand...
Click to collapse
I have no idea about editing XML files, but that was the next thing on my "To learn" list. I would be very happy for you to add your knowledge to this thread.
Also, if anyone has info to add/corrections to make, please feel free.
Good stuff, guys. At the very least we can make this a three man party.
The more the merrier!
Guys, can I ask what device you're both using?
fisha21 said:
Guys, can I ask what device you're both using?
Click to expand...
Click to collapse
A101IT with archangel root
A70IT with chulri's root
fisha21 said:
The more the merrier!
Click to expand...
Click to collapse
well, if i can do something, i'm here ;-)
wdl1908 said:
A101IT with archangel root
A70IT with chulri's root
Click to expand...
Click to collapse
Cool, thanks. Also, can I ask how you're viewing the XML files? Every program I've tried won't open them - keep getting error messages about invalid character content.
woti23 said:
well, if i can do something, i'm here ;-)
Click to expand...
Click to collapse
Welcome...
fisha21 said:
Cool, thanks. Also, can I ask how you're viewing the XML files? Every program I've tried won't open them - keep getting error messages about invalid character content.
Click to expand...
Click to collapse
You have to decompile the framework-res.apk with the apktools then all is revealed.
I have an A43it, and I find it to use a mixture of the hdpi and mdpi drawables, it is quite odd how they have it. I am drawing this conclusion because I only changed the hdpi drawables, and some things (status bar pull down for one) stayed original. I am going to work some more on it later today and will update here. My method for pushing to the device uses adb like such:
Code:
adb push framework-res.apk /sdcard/framework-res.apk
adb shell
su
stop
cp /sdcard/framework-res.apk /system/framework/framework-res.apk
chmod 644 /system/framework/framework-res.apk (only needs to be done the first time, as the permissions will adopt those when replacing in the future)
start
This causes the device to do a little soft-reboot (does not perform a proper full shutdown/reboot) that is pretty quick, and avoids any f/c situations you may encounter replacing the file while the system is live.
Edit 2 - ok, I just plain old missed the drawables earlier, they are all in hdpi for the A43. Posting screenshots of what I have put together shortly.
daveid said:
My method for pushing to the device uses adb like such:
Code:
adb push framework-res.apk /sdcard/framework-res.apk
adb shell
su
stop
cp /sdcard/framework-res.apk /system/framework/framework-res.apk
chmod 644 /system/framework/framework-res.apk (only needs to be done the first time, as the permissions will adopt those when replacing in the future)
start
This causes the device to do a little soft-reboot (does not perform a proper full shutdown/reboot) that is pretty quick, and avoids any f/c situations you may encounter replacing the file while the system is live.
Click to expand...
Click to collapse
Great I was looking for that.
wdl1908 said:
[*]compile framework-res-COMPILED (with apktools)
Click to expand...
Click to collapse
Getting stuck on the above step. Have got a folder called framework-res-DECOMPILED. When I try to compile it, the first message I get is:
Code:
w:Could not find sources.
It then runs through the process throwing up multiple error messages, and at the end I am left with an empty Build folder. Any ideas? I read on the Apktool thread that you need to add a classes.dex file to apk that don't already have one?
Thought I'd try your method as my primitive version keeps resulting in faulty apk's the last day or two!
fisha21 said:
Getting stuck on the above step. Have got a folder called framework-res-DECOMPILED. When I try to compile it, the first message I get is:
Code:
w:Could not find sources.
Click to expand...
Click to collapse
No problem there thats only a warning.
fisha21 said:
It then runs through the process throwing up multiple error messages, and at the end I am left with an empty Build folder.
Click to expand...
Click to collapse
What error messages?
fisha21 said:
Any ideas? I read on the Apktool thread that you need to add a classes.dex file to apk that don't already have one?
Click to expand...
Click to collapse
What version of apktools do you have?
never needed any classes.dex in framework-res.apk
fisha21 said:
Thought I'd try your method as my primitive version keeps resulting in faulty apk's the last day or two!
Click to expand...
Click to collapse
I'll try to cleanup my script and post it soon.
I just found out we can have custom boot animations on our gen 8 devices.
search for some bootanimation.zip on the web or go to UOT Kitchen and download one from the kitchen. place it in the directory /data/customization/ and reboot. This works even for the stock firmwares with archangel root.
Enjoy
I've added the first version of my FramWorkBuilder script in the second post.
wdl1908 said:
I've added the first version of my FramWorkBuilder script in the second post.
Click to expand...
Click to collapse
Thanks for the hard work!
Gave it a run through but get the following error messages:
Code:
Applying MOD...cp: cannot stat `/home/sarju/FWB/framework-res-MOD/*': No such file or directory
and
Code:
Copy files from UNPACKED to COMPILED that are not modified...cp: cannot stat `/home/sarju/FWB/WorkSpace/framework-res-UNPACKED/*': No such file or directory
The script is located in the "FWB" folder.
fisha21 said:
Code:
Copy files from UNPACKED to COMPILED that are not modified...cp: cannot stat `/home/sarju/FWB/WorkSpace/framework-res-UNPACKED/*': No such file or directory
The script is located in the "FWB" folder.
Click to expand...
Click to collapse
yeah download the 0.1a version and try again.
wdl1908 said:
yeah download the 0.1a version and try again.
Click to expand...
Click to collapse
Ok, think I'm just being stoopid here. Ran the v0.1a, no error messages BUT
If I use the folder structure "framework-res-MOD>drawable-mdpi", the resulting apk just has the original contents of drawable-mdpi. If I use "framework-res-MOD>res>drawable-mdpi", the resulting pak has an empty drawable-mdpi folder.
fisha21 said:
Ok, think I'm just being stoopid here. Ran the v0.1a, no error messages BUT
If I use the folder structure "framework-res-MOD>drawable-mdpi", the resulting apk just has the original contents of drawable-mdpi. If I use "framework-res-MOD>res>drawable-mdpi", the resulting pak has an empty drawable-mdpi folder.
Click to expand...
Click to collapse
the structure should look like this.
Code:
framework-res-MOD
framework-res-MOD/res
framework-res-MOD/res/drawable-hdpi
framework-res-MOD/res/drawable-ldpi
framework-res-MOD/res/drawable-mdpi
framework-res-MOD/res/drawable
but make sure you remove empty dirs.
I suspect it has to do with empty dirs I'll check that....
Nope tthats not it.
can you zip up the files files-to-remove.txt and log.txt in the WorkSpace dir and post them or via pm if thats possible.

[GUIDE] A Beginner's Guide To Theming

The basic part of a theme is the UI (User Interface) icons.
These icons are situated in three system files:
1. framework-res.apk
2. twframework-res.apk
3. SystemUI.apk
NOTE: Your phone should have the de-odexed versions of these files.
You may get them here http://android.modaco.com/topic/342915-samsung-galaxy-s-deodexedzipaligned-xxjvq-files/#entry1754033 .
MISSION 1 (GET THE FILES)
In order to get these files your phone needs to be rooted and you should have a system file explorer like Yaffs Explorer. The easiest way to root your phone is by flashing a kernel that provides root.
The framework-res.apk is situated in the folder /system/framework/
The twframework-res.apk is situated in the folder /system/framework/
The SystemUI.apk is situated in the folder /system/app/
Copy those files and put it in your sd card and then transfer those files to your PC.
These files will be used as the template for the new theme.
[OPTIONAL] Make a copy of these three files as back-up.
MISSION 1 COMPLETE
MISSION 2 (THE MYSTERIOUS CHANGE)
In order to change the icons there are three ways
a.The Easy way (not the correct way: might cause FCs )
b.The Hard way (recommended for risk takers )
c.Use the online theme kitchen (recommended for beginners )
[ http://uot.dakra.lt/ ]
NOTE:You may have to use both b. and c.
a. The Easy way
You need a program like 7-zip installed in your PC.
Method
-Open the apk using 7-zip.
-Go to the folder named res
-Extract the folder named drawable-hdpi
-Edit the images you want to edit [ DO NOT EDIT .9png IMAGES ]
-Replace the original icons with modified icons(drag & drop into
drawable-hdpi folder)
Tips
-Keep the original image dimensions
-Don't edit .9 pngs
b. The Hard way
This consists of decompiling the apk, modifying the required images, compiling the modified
images and replacing the original icons with the compiled icons.
You will need:
1.Apk Manager
(go here for instructions http://forum.xda-developers.com/showthread.php?t=695701 )
2.xUltimate compiler
(go here for instructions http://www.droidforums.net/forum/xeudoxus/47283-release-xultimate.html )
3.7-zip
Method
-Go to the main folder of Apk Manager
-Put the apk in the folder named place-apk-here-for-modding
- In order to decompile all APKs when working with the i9000, you have to install the framework files with apktool.
- Download apktool and put it on an easy accessable place (like C:\)
- Also put the STOCK framework-res.apk and twframework-res.apk files in the same directory.
- Open a new CMD (Press Windows Key + R), write CMD and press ENTER.
- type "cd .." (without the quotes)
- repeat the "cd .." so you're on C:\ now.
- write: java -jar apktool.jar if framework-res.apk
- repeat, just with twframework-res.apk: java -jar apktool.jar if twframework-res.apk
- This will ensure, it will load the correct resource table and you won't have any errors because of the dependees
-Run Script.bat file
-Select option 9 to decompile the apk
-Go to the folder named "projects" (the decompiled apk folder should be there)
-Inside the decompiled apk folder go to the folder /res/drawable-hdpi
-Modify the icons you want to change(KEEP THE BORDERS OF .9png IMAGES
UNTOUCHED)
-Open the main folder for xUltimate
-Go to the folder \example1\res\drawable-hdpi
-Delete the icons present there
-Put the modified icons
-Go to the main folder for xUltimate and run the xUltimate.exe file
-The compiled icons can be found in the folder
\done\example1\res\drawable-hdpi
-Replace the original icons with the compiled icons USING 7-zip
MISSION 2 COMPLETE
MISSION 3 (SEE THE CHANGE)
To see how your new theme looks like, you should put the modified files back to where they
belong.
There are two ways of doing this:
1. By using the system file explorer
Before doing so make sure that the system is write-enabled. You can do this
by using Damian Tweak app. If you are using Yaffs Explorer make sure you
have enabled root access
in the app's settings.
2. By making a CWM package (safer)
Use the Zip file provided. Replace the original files with moded files and install
using
CWM.
MISSION 3 COMPLETE
HAPPY THEMING
reserved
reserved
I have to thank you so much!
The first Tutorial I found that was understandable for beginners too.
Big Big Big Thanks!
nightm4r399 said:
I have to thank you so much!
The first Tutorial I found that was understandable for beginners too.
Big Big Big Thanks!
Click to expand...
Click to collapse
I'm glad it helped .
Exactly what I needed. Thank you for good guide.
hackeron said:
Exactly what I needed. Thank you for good guide.
Click to expand...
Click to collapse
Great .
Btw do you know how to make this a Sticky Thread?
SCIENTYREAL said:
Great .
Btw do you know how to make this a Sticky Thread?
Click to expand...
Click to collapse
You have to ask a moderator to do this
I have some additions to the guide
The red code is added by me.
Method b) the hard way
-Go to the main folder of Apk Manager
-Put the apk in the folder named place-apk-here-for-modding
- In order to decompile all APKs when working with the i9000, you have to install the framework files with apktool.
- Download apktool and put it on an easy accessable place (like C:\)
- Also put the STOCK framework-res.apk and twframework-res.apk files in the same directory.
- Open a new CMD (Press Windows Key + R), write CMD and press ENTER.
- type "cd .." (without the quotes)
- repeat the "cd .." so you're on C:\ now.
- write: java -jar apktool.jar if framework-res.apk
- repeat, just with twframework-res.apk: java -jar apktool.jar if twframework-res.apk
- This will ensure, it will load the correct resource table and you won't have any errors because of the dependees
-Run Script.bat file
-Select option 9 to decompile the apk
-Go to the folder named "projects" (the decompiled apk folder should be there)
-Inside the decompiled apk folder go to the folder /res/drawable-hdpi
-Modify the icons you want to change(KEEP THE BORDERS OF .9png IMAGES
UNTOUCHED)
-Open the main folder for xUltimate
-Go to the folder \example1\res\drawable-hdpi
-Delete the icons present there
-Put the modified icons
-Go to the main folder for xUltimate and run the xUltimate.exe file
-The compiled icons can be found in the folder
\done\example1\res\drawable-hdpi
-Replace the original icons with the compiled icons USING 7-zip
Click to expand...
Click to collapse
Darkyy said:
You have to ask a moderator to do this
I have some additions to the guide
The red code is added by me.
Method b) the hard way
Click to expand...
Click to collapse
Thanks for replying Darkyy .
So, i Get a ADB not found thing? WHat should i do?
roxyroot said:
So, i Get a ADB not found thing? WHat should i do?
Click to expand...
Click to collapse
You should have Android SDK installed for Apk Manager to work.
The link on how to use Apk Manager is given in the first post, under apk manager. I'll post it again here
http://forum.xda-developers.com/showthread.php?t=695701
Here is the link for Android SDK
http://developer.android.com/sdk/index.html
Btw you should also have Java Development Kit (JDK) installed.
I cant seem to find the twframework-res.apk, it's not in the system/framework folder. I have a sony ericsson play.
Do you know where the android settings menu icons are? the ones you see when you go into android settings. Like wireless & Networks, call settings, sound and so on.
thanks great guide.
SCIENTYREAL said:
You should have Android SDK installed for Apk Manager to work.
The link on how to use Apk Manager is given in the first post, under apk manager. I'll post it again here
http://forum.xda-developers.com/showthread.php?t=695701
Here is the link for Android SDK
http://developer.android.com/sdk/index.html
Btw you should also have Java Development Kit (JDK) installed.
Click to expand...
Click to collapse
I have android SDK (obviously), JRE and i used it the same way given, stilll..The error..I have a SGS SCL i9003...
hackit said:
I cant seem to find the twframework-res.apk, it's not in the system/framework folder. I have a sony ericsson play.
Do you know where the android settings menu icons are? the ones you see when you go into android settings. Like wireless & Networks, call settings, sound and so on.
thanks great guide.
Click to expand...
Click to collapse
Twframework-res is only found in Samsung devices. No need to worry about it. The settings icons are found in settings.apk. Settings.apk is inside the folder system/app.
Sorry for replying late.
bangalorerohan said:
I have android SDK (obviously), JRE and i used it the same way given, stilll..The error..I have a SGS SCL i9003...
Click to expand...
Click to collapse
To be honest I don't know the exact cause of the error. Have you updated Android SDK. You should click on the main SDK icon and it should show all the available updates. Select
the updates and download the files. Sorry if you have already done it.
Sorry for the late reply.
:laugh:
I forgot how to do it and now I am reading my own guide.
Thanks for this great guide! Will come in handy soon

[GUIDE] Change Nav Bar D.P.I. on Android Jelly Bean 4.1.1 (Galaxy Nexus)

Guide – Change Navbar D.P.I. in Android Jelly Bean (4.1.1)
•Thanks to Vomer for helping me learn this and answering my questions when I had them… Also for persuading me to write this guide for others users to hopefully use to learn a small bit of Android modding, which will hopefully create more publically used mods for the benefit and growth of the community. Let’s get it…
First thing is first… This guide is created with the Galaxy Nexus in mind. Even though other phone brands (Samsung, H.T.C., LG, Sony, etc.) are now upgrading their handsets to Android Jelly Bean, this guide is created with my experience with the pure Google experience in mind and pure Google O.S. *If you are using a rom with Samsung Touch Wiz, H.T.C. Sense or anything else produced/provided by another company, this isn’t for you, although it may answer some questions and get you started in the right direction…
THE TOOLS:
I’m using an ApkTool package, which were obtained from a thread created by monstaX < Credit to him!
First off, go to this webpage http://www.mediafire.com/?acrgcd0w850q0gj and download the file. File name should be “apktoolsJB.zip”. Once you have the tools downloaded, unzip them to your desktop.
Inside the unzipped file, you will locate the following files; aapt.exe; apktool.bat; apktool149.jar; apktool142.jar; apktool144.jar and baksmali.jar.
After confirming that the above listed files are present, rename “apktool149.jar” to “apktool.jar”.
That’s it for the tools, leave the file on your desktop, as this will ultimately be your workspace along with a command prompt.
I would also download 7-Zip and Notepad++ from the internet. You can Google those two programs and download them if you don’t already have them….
GETTING WINDOWS READY:
The next thing we need to do is remove the “Environmental Values”. If you have attempted to edit/mod any apks in the past, you probably set up “Environmental Values” in “Path” under “System Variables”. If you have done this, simply navigate back to “System Variables>Path” and delete the added non-sense that you added before. An example would be something like “Android\SDK\platform-tools\;” Make sure that after you’re done deleting, you leave a “;” at the end of the “Path Variable” line of text.
Now for the fun part:
DECOMPILE/COMPILE
Once you have done the above steps, you’re now ready to have some fun.
First off, you need to download a copy of the .zip file of the ROM you’re using onto your computer OR transfer a copy of the framework-res.apk and SystemUI.apk to your computer from your G-Nex. Once you have located these files, you need to place both files into the JBapktool folder that we unzipped onto the desktop earlier.
Once you have placed both files into the JBapktool folder, open the folder and shift+right-click somewhere inside the folder (NOT ON A FILE). Once you have done that and a menu has popped up, select “Open Command Window Here”.
Once the command window has opened; you need to install the framework-res.apk… Now there is a bunch of technical jargon for this but simply and easily type the following command;
java –jar apktool.jar if framework-res.apk
You will see a line that reads “ Framework installed to: C:\Users\yournamehere\apktool\framework\1.apk”
After the above line appears, you will now decompile the framework-res.apk file. To do this, type the following command;
java –jar apktool.jar d framework-res.apk
You will now see something like:
I: Loading resource table…
I: Loaded
I: Decoding file-resources…
I: Decoding values*/* XMLs…
I: Done
I: Copying assets and libs…
*DON’T CLOSE THE COMMAND PROMPT*
After you see that, you should notice that a new file has been added to the JBapktool folder, which should be named “framework-res”. Inside that folder, you will observe the following folders/files; assets; build; dist; res; AndroidManifest.xml; apktool.yml. The file that we are worried about is the “res” file. Open the “res” folder and then navigate to the “values” folder and look for a file named “dimens.xml”. The “dimens.xml” is where the magic happens. Right click on this file and open as “Edit with Notepad++”.
Once Notepad++ is open with the “dimens.xml” file open, you want to focus on three strings in the file. The strings are: 36.0dip
36.0dip
32.0dip
*For a 32 DPI nav bar, I personally use 32 for the height and 28 for the width.*
Now here, the parts of the string that we want to change are highlighted in yellow and represent the “DPI” of the nav bar. The above lines are from a “dimens.xml” file that I changed to make a “36 DPI” nav bar. Once you have made the changes to the above dimensions, just click file and save in Notepad++ and close the program.
Now to compile the “framework-res” folder back into an .apk.
Simply go back to the command prompt that we opened earlier (you shouldn’t have closed it, but if you did follow steps above to open a new one, reinstall the framework-res.apk (STEPS ABOVE) and then continue).
Type the following command;
Java –jar apktool.jar b framework-res
You will see the following (hopefully);
W:Could not find sources
I:Checking wheter resources has changed…
I:Building resources…
I:Building apk file…
After this, you should revert back to the “JBapktool” folder and navigate to “framework-res” folder>”build”>”apk”… Look for the “resources.arsc” file. THAT’S THE MONEY SHOT…
Using 7-zip, you want to open the “framework-res.apk” file that we originally began with (I would make a copy of it and put it on my desktop). Right-click on the “framework-res.apk” file, click 7-Zip and then open archive. A new window will open, showing the visible files inside the framework-res.apk. Look for the file “resources.arsc”. Delete it, locate the “resources.arsc” from the framework-res folder (framework-res>build>apk) in the JBapktool folder. Click and drag it to the unzipped original framework-res.apk file and drop it. WE’RE DONE WITH THE FRAMEWORK-RES.APK FILE.
Now simply place that file in a CWM flashable .zip file and hold tight.
Now we need to decompile the SystemUI.apk that we placed in the JBapktool folder earlier. Follow the above listed instructions to complete this, same as we did with the framework-res.apk.
Once you have the SystemUI.apk file decompiled, look for a folder in JBapktools named “SystemUI”. Inside the “SystemUI” folder, navigate to res>layout>navigation_bar.xml. We now want to open the navigation_bar.xml file with Notepadd++, so that we can delete two lines in it that would cause a larger back button on the nav bar if left intact.
Inside the navigation_bar.xml file look for the following two lines:
"@drawable/ic_sysbar_back" android:scaleType="center"
"@drawable/ic_sysbar_back_land" android:scaleType="center"
Now, we want to delete the following from both lines:
android:scaleType="center"
After deleting that line from both lines, save the file by clicking file>save and close Notepad++. Now back go back to JBapktools and to the already opened command prompt window (it should still be open).
We are now going to compile the SystemUI. To do this type the following command;
java –jar apktool.jar b SystemUI
You will see some text in the command prompt and will ultimately see I:Building APK file…
Once this is complete, navigate back to the JBapktool folder and to the SystemUI file. Once you have the SystemUI folder open, we need to navigate to build>apk and look for the following file; AndroidManifest.xml. Now this is important, we need to replace this file with the AndroidManifest.xml file from the original unzipped SystemUI.apk. So open the original SystemUI.apk with 7-zip, and copy “META-INF” and “AndroidManifest.xml”. Once you have those copied from the original unzipped SystemUI.apk, relocate back to the JBapktool folder>SystemUI>build>apk and paste both of them. If asked to replace, CLICK YES OR REPLACE ON ALL WARNINGS THAT POP UP!!!!
Now we need to back out to the SystemUI folder in JBapktool and click on the folder that is named “dist” (the “dist” folder is where the freshly compiled SystemUI.apk is located once we type in the compile command in the command prompt). Once inside the “dist” folder, you will see a SystemUI.apk file. DELETE IT… We never use the first SystemUI.apk that we compile, because we needed to added the META-INF and AndroidManifest.xml files for signing purposes. Once you have the 1st compiled SystemUI.apk deleted, return to the command prompt and enter the compile command again and compile a 2nd SystemUI.apk.
The 2nd SystemUI.apk will appear in the “dist” folder and is the usable SystemUI.apk.
Now that you have your new SystemUI.apk compiled, place it in the same CWM flashable .zip file, boot into recovery, wipe cache and dalvik cache and VOILA, you have just pimped your nav bar’s DPI.
•Remember when placing the SystemUI.apk file into your CWM .zip file to place it under /system/App. And when placing your framework-res.apk into your CWM .zip file it goes under /system/framework…
The mods and this guide take time for us to put together for your enjoyment/the improvement of the community. If I or anyone else has helped you, please hit the “Thank You” button. Thanks.
Great tutorial
Sent from my Galaxy Nexus using Tapatalk 2
Thank's man.....................
APatte111: could you upload your 32 height 28 landscape framework-res for v4 rom ?
Great guide.
If you dont want to waste time uploading....its all good anyway mate :good:
bs android said:
APatte111: could you upload your 32 height 28 landscape framework-res for v4 rom ?
Great guide.
If you dont want to waste time uploading....its all good anyway mate :good:
Click to expand...
Click to collapse
This is not the mods thread
Great job bud!
Also, remember guys - if you make a MiNCO Mod - share with other's in the MiNCO Plus+ Thread. Chances are someone else would want it too
bs android said:
APatte111: could you upload your 32 height 28 landscape framework-res for v4 rom ?
Great guide.
If you dont want to waste time uploading....its all good anyway mate :good:
Click to expand...
Click to collapse
This framework-res.apk is in place in several of the mods in the MiNCO Plus+ mods and enhancements thread that vomer began... Just download one of the mods and extract the framework-res.apk from one of the .zip files... Probably the easiest way to get it...
Sent from my Galaxy Nexus using xda premium
vomer said:
This is not the mods thread
Great job bud!
Click to expand...
Click to collapse
OK sorry for asking OP if that annoys you
APatte111 said:
This framework-res.apk is in place in several of the mods in the MiNCO Plus+ mods and enhancements thread that vomer began... Just download one of the mods and extract the framework-res.apk from on of the .zip files... Probably the easiest way to get it...
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
Nice APatte, I saw it now, downloaded and tried your framework with vomers standard white for minco rom. Got the failure in back button so guess I have to wait till I get home to a computer to fix it. Thanks for the guide anyway, love different and smaller navbars.
bs android said:
Got the failure in back button so guess I have to wait till I get home to a computer to fix it. Thanks for the guide anyway, love different and smaller navbars.
Click to expand...
Click to collapse
Yeah, if by "failure" you mean the larger back key then that is being caused by the un-edited navigation_bar.xml file which is located in SystemUI.apk>res>layout... You need to delete the two lines mentioned above, re-compile the SystemUI.apk and everything should be golden. Let me know if it doesn't work and I will help ya... Good Luck
Good guide!
Great job man!! Great tutorial!
:good::good::good::good::good:
MAN CHANGE THIS IS WRONG!! Java –jar apktool.jar b frame-work
IT IS java -jar apktool.jar b framework-res
masterchif92 said:
MAN CHANGE THIS IS WRONG!! Java –jar apktool.jar b frame-work
IT IS java -jar apktool.jar b framework-res
Click to expand...
Click to collapse
Thanks, you found a typo and the one mistake in the whole guide... Appreciate that...
Sent from my Galaxy Nexus using xda premium
After looking at 5 or 6 other guides. This one is BY FAR the easiest to understand & includes everything you need to get the job done.
Thanks a ton OP!
i cant seem to find the "@drawable/ic_sysbar_back" & "@drawable/ic_sysbar_back_land" in the navigation_bar.xml file. Any help please? I must mention that i am on AndroidME CM10 1.7.0 and took both files from the cwm zip.
Only repeating line i can find is "@drawable/ic_sysbar_lights_out_dot_large" . Dont know if it is the same.
I ve done some android developing in the past. every linear_layout represents a button, right?
angelossssss said:
i cant seem to find the "@drawable/ic_sysbar_back" & "@drawable/ic_sysbar_back_land" in the navigation_bar.xml file. Any help please? I must mention that i am on AndroidME CM10 1.7.0 and took both files from the cwm zip.
Only repeating line i can find is "@drawable/ic_sysbar_lights_out_dot_large" . Dont know if it is the same.
I ve done some android developing in the past. every linear_layout represents a button, right?
Click to expand...
Click to collapse
Can you upload the navigation_bar.xml file for me so I could have a look...
*** Nice signature by the way *** LOL
Sent from my Galaxy Nexus using xda premium
APatte111 said:
Can you upload the navigation_bar.xml file for me so I could have a look...
*** Nice signature by the way *** LOL
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
here. i uploaded in my dropbox.
https://www.dropbox.com/s/7331l8fqs7a99yg/navigation_bar.xml
Thanks for the signature
---------- Post added at 08:25 PM ---------- Previous post was at 08:17 PM ----------
angelossssss said:
here. i uploaded in my dropbox.
https://www.dropbox.com/s/7331l8fqs7a99yg/navigation_bar.xml
Thanks for the signature
Click to expand...
Click to collapse
actually nevermind that... i just flashed the cwm without the systemui.apk and it seems to be working fine. lol
angelossssss said:
here. i uploaded in my dropbox.
https://www.dropbox.com/s/7331l8fqs7a99yg/navigation_bar.xml
Thanks for the signature
---------- Post added at 08:25 PM ---------- Previous post was at 08:17 PM ----------
actually nevermind that... i just flashed the cwm without the systemui.apk and it seems to be working fine. lol
Click to expand...
Click to collapse
I was going to say, it looks like they have already removed that from the navigation_bar.xml file... The description of the ROM shows that Nav Bar Options are included... You could change the DPI size, compile and see if the back button is larger (which is what deleting those two lines fix)... If it's not (which you stated it's working) then skip that step....
APatte111 said:
I was going to say, it looks like they have already removed that from the navigation_bar.xml file... The description of the ROM shows that Nav Bar Options are included... You could change the DPI size, compile and see if the back button is larger (which is what deleting those two lines fix)... If it's not (which you stated it's working) then skip that step....
Click to expand...
Click to collapse
y i only compiled the framework-res.apk but i thing now my phone became a little laggy. especially when swipping between screens and opening apps.
i'll check it out if i did anything wrong.
angelossssss said:
y i only compiled the framework-res.apk but i thing now my phone became a little laggy. especially when swipping between screens and opening apps.
i'll check it out if i did anything wrong.
Click to expand...
Click to collapse
Check in the ROM and see if there is already a built in option to change the nav bar DPI size... if not, make the changes to the dimens.XML file and then recompile/replace the .apk and re-flash... that should work and everything should be normal...
Sent from my Galaxy Nexus using xda premium
APatte111 said:
Check in the ROM and see if there is already a built in option to change the nav bar DPI size... if not, make the changes to the dimens.XML file and then recompile/replace the .apk and re-flash... that should work and everything should be normal...
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
unfortunately there is not. it only has options to change the buttons order.

Help editing smali

I am trying to edit the smali code in the systemui.apk for a couple mods in the development section. I am having some difficulties. I am trying to use smali/baksmali.
Anyone have a guide or able to provide some steps.
Thanks
First, if you don't have apktool set up Google "How to set up apktool on Windows(or Linux or Mac etc)"
Once set up use this modified apktool and aapt.exe found here. Make sure you select the appropriate aapt.exe depending on you OS
http://forum.xda-developers.com/showthread.php?t=1755243
Rename that modified apktool jar to just apktool.jar and place the jar and exe in your C:\apktool\ directory
Next, get the framework-res.apk and twframework-res.apk (found in /system/framework/). Place them in your apktool directory
CD your apktool folder and type
apktool if framework-res.apk
apktool if twframework-res.apk
Place your SystemUI.apk in your apktool directory and type
apktool d SystemUI.apk
It'll decompile, complete your mods then recompile
apktool b SystemUI
The apk will be in the SystemUI\dist\
Sent from my SPH-L710 using Tapatalk 2
For me the easiest way is baksmali and smali.
For smali its easy. Just extract the classes.dex and run the decompile command. Simple. You will need java installed.
To recompile just run the recompile command and done. You get a new .dex that you pop I the apk you are editing and delete the old one. Name it the same, push the apk and done.
BTW, the command isent actually "decompile" and "recompile"
You will need a little more java experience to know what the commands are.
fergie716 said:
First, if you don't have apktool set up Google "How to set up apktool on Windows(or Linux or Mac etc)"
Once set up use this modified apktool and aapt.exe found here. Make sure you select the appropriate aapt.exe depending on you OS
http://forum.xda-developers.com/showthread.php?t=1755243
Rename that modified apktool jar to just apktool.jar and place the jar and exe in your C:\apktool\ directory
Next, get the framework-res.apk and twframework-res.apk (found in /system/framework/). Place them in your apktool directory
CD your apktool folder and type
apktool if framework-res.apk
apktool if twframework-res.apk
Place your SystemUI.apk in your apktool directory and type
apktool d SystemUI.apk
It'll decompile, complete your mods then recompile
apktool b SystemUI
The apk will be in the SystemUI\dist\
Sent from my SPH-L710 using Tapatalk 2
Click to expand...
Click to collapse
+1
...and don't forget to use 7-zip and grab the META-INF & androidmanifest
XML files, then put them in build/apk and run recompile command again.
"apktool b SystemUI"
Ok I have tried both methods listed above. Maybe I am not understanding something about each way. What I am doing is using root explorer to copy the SystemUI.apk from system/app and the framework-res.apk from system/framework/
When I use apktook, it decompiles but I dont find any smali code i there. I get a list of 2 folders and 2 files (assets, res, androidmanifest, apktool.yml) there are subfolders but still no luck finding smali code in there.
I tried the smali/baksmali method but i cant seem to find any classes.dex (as I understand it, its located in the SystemUI.apk). Am I looking in the wrong place. I used 7zip to view the SystemUIapk, it shows the same folders I mentioned above minus the apktool.yml and additionally a meta-inf folder and resources.arsc.
Am I looking at the wrong place? It is the stock rom. There is a file systemui.odex should I be doing something with that instead?
The editing that I am trying to do is mentioned here in case it helps. http://forum.xda-developers.com/showthread.php?t=1848611
Thanks
deepsix_69 said:
Ok I have tried both methods listed above. Maybe I am not understanding something about each way. What I am doing is using root explorer to copy the SystemUI.apk from system/app and the framework-res.apk from system/framework/
When I use apktook, it decompiles but I dont find any smali code i there. I get a list of 2 folders and 2 files (assets, res, androidmanifest, apktool.yml) there are subfolders but still no luck finding smali code in there.
I tried the smali/baksmali method but i cant seem to find any classes.dex (as I understand it, its located in the SystemUI.apk). Am I looking in the wrong place. I used 7zip to view the SystemUIapk, it shows the same folders I mentioned above minus the apktool.yml and additionally a meta-inf folder and resources.arsc.
Am I looking at the wrong place? It is the stock rom. There is a file systemui.odex should I be doing something with that instead?
The editing that I am trying to do is mentioned here in case it helps. http://forum.xda-developers.com/showthread.php?t=1848611
Thanks
Click to expand...
Click to collapse
Deodex first then use the apk.
I installed a deodexed version of the stock rom, and then used the apktool directions above. They appear to have worked.
Thanks for the help.

ROM Building: The Basics Part III

Welcome back everyone
For those who are not familiar with the series, I recommend checking out part I and then part II to get caught up on our continued efforts to modify a ROM to your every whim and need.
We will be utilizing some really cool tools today. They come at a price of patience and perseverance, you know, kind of like what Valve expects from all of their loyal customers, and the worst part is....they could release the HL3 in 10 years, and I would still throw money at my screen.
I digress again.
Today we learn how to decompile those sneaky APK's and the necessary Framework files. They are located in the 2 most important folders:
MD4_Version_1/system/app
MD4_Version_1/system/framework
We need to start at the beginning of this topic.
To begin, let us test your ability to use JAVA....Wait STOP! Java? Programming? We do not need to be experts at programming at all, in fact, implementing mods is really a copy and paste procedure for us noobs, but if you know how to JAVA, maybe you can create your own mods that you can share with the community. Also, I am not a programmer, but I do know how to use logic to trial and error the crap out of the mods until they work.
To test if you have JAVA installed, open up a command prompt in Windows (because if you have Linux, you are not going to even be on this beginner's tutorial now are you?)
type in:
Code:
java
You should see
Code:
C:\>java
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-server to select the "server" VM
-hotspot is a synonym for the "server" VM [deprecated]
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
Wait, you did not see this did you? Well it happens, you probably got an Unknown Command or some shenanigans that doesn't look similar to the above?
Do not worry, we will need to add JAVA to the environment variables. First head over to JAVA and download the Java Runtime Environment (JRE). Install as you would by clicking next next next next and next and next.
When it installs, it goes to a specific location. The problem is, sometimes Windows does not recognize that path, which is why when you execute the JAVA command in a command prompt it tells you unknown command. We have to tell Windows to search in the java installation folder that you just installed for the JAVA.exe program so Windows can add it to the list of areas to search when you execute a command.
To do this, we will need to add the path in the environmental variables, java explains that sometimes this should not be necessary. But use this for more information and an understand of how to do this to different operating systems.
My path was the default "PATH" for java
Code:
C:\Program Files (x86)\Java\jre7\bin
Once that has been added to the environmental variables, test out the java code and see if it looks like what I have from above.
After this is done, we will need to install the Android SDK, this can be found here
The SDK, is a software development kit. It will allow for a user to create software for your android phone. This tutorial will not be doing that because that is a very heavy order. It will require the release of the Kraken. I do not recommend releasing the Kraken. Unless it is harmless Cthulhu. He's so adorable.
Anyway, this will install platform tools for us to push files to our phone and allow us to to execute these commands.
Remember, we can add the tools of the SDK to our PATH variable so we can execute these tools in any command prompt and at any location.
If you are having trouble at this point, let me know in the comments below and we can try and address this issue.
Now that we have the basic tools down, we need to understand what the heck that APKTOOL, SMALI and BAKSMALI do.
These tools are used to decompile the our APK and JAR files.
Keep this in mind at all times
APKTOOL will decompile and combile APK FILES
SMALI compiles DEX FILES
BAKSMALI decompiles DEX FILES
Do you know what any of these 3 are? Maybe you do, maybe you don't.
The APK stands for Android application package. It is basically the app. In windows, it would be equivalent to the program. The APK is unique in the sense that all the files in the app are actually zipped inside an APK file.
That logic only deduces, we can open almost any APK file with 7-zip. This is good news until we realize, the APK files are actually encoded in a way. We cannot make serious mods until we de-scramble the code hidden in the APK.
This is where APKTOOL comes into play. The APKTOOL can de-compile the encoded files and put it into a folder for us to work with. We can then make our mods, recompile and then put it into our ROM.
After explaining Smali and Baksmali, we will begin a basic mod.
Smali and Baksmali are actually java archive files. They contain instructions to take a DEX file and de-compile them into very interesting SMALI code. DEX is an EXE file for our Android system. We can only de-compile a classes.dex file for now, for it contains the majority of the rest of the tweaks. As a result, doing this is important and very difficult unless you understand what is going on. We will definitely have examples so do not fret, did I mention a half life reference yet...I don't think so.
So back to APKTOOL, we are going to need to understand what it does before we begin. I am assuming you got your APKTOOL downloaded from here, go to your C: drive and create a folder in there called APKTOOL in there, unzip the downloaded file, there will be a file Setup.bat, execute that file and a command prompt window with Green text will appear, I recommend selection 1 first to ensure you have the latest version, but we do not need to do this.
We will need to press option 2, but it says we must place some files in the other folder first. The files needed are actually the framework files, basically, the way our rom interprets the files are needed for this APKTOOL to operate.We will need to go to our ROM's
MD4_Version_1/system/framework/ folder and copy 2 files
Code:
framework-res.apk
tw-frameworkres.apk
These files will be copied into
Code:
C:\APKTOOL\other
This needs to be done before you select option 2.
Once the files are copied, press 2, then we need to install the first two options, so go one by one and install both.
Then when you are back to the main menu, press 3 and setup the directories for your need.
Personally, I took the
Code:
C:\APKTOOL\other
folder and moved into my own working directory. Assume that the locations will be selected by you for organization. I will use the following folder for reference:
Code:
C:\other
This will have all of the tools I need, while you are at it, create a new folder in their called Smali and copy the Smali.jar and BakSmali.jar files in there, they will of course be named something else like smali-1.4.2.jar and baksmali-1.4.2.jar
Rename the files to make life easier
Code:
from
smali-1.4.2.jar
to
smali.jar
and
baksmali-1.4.2.jar
to
baksmali.jar
Back to APKTOOL, now back to me, Now back to APKTOOL, now back to me.
We will be victimizing a specific APK to get modding started.
Before we get started, this is where we start version controlling more seriously. As each mod you add could cause a freeze, hang, bootloop or whatever, so go to the folder of your ROM, select the four files
META-INF
system
boot.img
installbusybox
right click them and "Add to Archive". Zip file only remember, compression level( Normal to no compression is fine)
Now
Lets grab a copy of SecPhone.APK located in the system/app folder
And put it into
Code:
C:\other
Open a command prompt and navigate to that location of the APKTOOL
Execute the following command
Code:
apktool d SecPhone.apk SecPhone
If done successfully, you will something like
Code:
C:\other>apktool d SecPhone.apk Secphone
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\<Your User Name>\apktool\framework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
C:\other>
This means it successfully decoded the file. We will have a folder called SecPhone that has a bunch of folders.
Navigate to the following folder:
Code:
C:\other\Secphone\res\raw
There are 2 .ogg files. Well well well, I thought we took care of these, hmm, guess we need to change these to whatever you need to. Let's assume you did this already and have replaced them. We will need to stop the "mods" for now, for we are learning a process not a mod per se.
So we are done "modding" the file, I know it is not a BIG mod but we are trying to learn how to do this now so we can do the heavy stuff later. Now we can continue to recompile the file.
Go back to command prompt and direct yourself to
C:\other>
Click to expand...
Click to collapse
The put in the following command:
Code:
C:\other>apktool b SecPhone new-SecPhone.apk
Notice we changed 3 things, the d became a b, the second option is the folder we are recompiling, the third is the name of the new file
You should then see something that might be worrisome:
Code:
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'reject_cause_location_reg_fail' has no default translatio
n in C:\other\SecPhone\res; found: es pt
aapt: warning: string 'reject_cause_location_registering' has no default transla
tion in C:\other\SecPhone\res; found: es pt
aapt: warning: string 'stms_version' has no default translation in C:\other\SecP
hone\res; found: ja
I: Building apk file...
C:\other>
The warnings will be acceptable for the time being as they are related to a different language setting. If you are in English, you will be fine. If you are not, then that is a different tutorial altogether. Also, there is a very particular code bug that occurred the very first time I ran these commands and caused a catastrophic failure, more than any Movie-to-Game adaptation could ever be,
But you think you are done here, well that is not true. You see,
We have compiled the new APK file but unfortunately, it is a system file, we cannot sign this file to tell Android it is legit, we will have to cheat at this point, just like Valve did by creating any other project except Half Life 3 after number 2, you know they have enough funding for it, they are making it, and if I get kidnapped, I will probably be in a basement at Valve which I won't mind if they give me a grav gun. On a side note, while Brian Cranston would make a great Gordon Freeman, I still think Hugh Laurie would do a good job, just saying.
So back to our dilemma. We have created a new file called new-SecPhone.apk, open it with 7-zip, do not do anything yet, open the SecPhone.apk file you should have, it is the original file in the C:\other folder, we will need to drag two files for signature's sake
Copy the
Code:
Meta-INF Folder
AndroidManifest.xml
directly into the new-SecPhone.apk file. This can be done by dragging the files.
This will allow Android to think the file is signed and legit.
Take the new-SecPhone.apk file and copy it to your desktop and rename it to SecPhone.apk
Then place it into your ROM's system/app folder.
Your "first Mod" is ready to go, pretty easy actually but I really think the method is what many of us lack and this centralizes the effort. When you want to mod any System file, this process has to be done.
Its not a crazy mod, that will be after we explain how to modify files with Smali and BakSmali.
That will be in the next part of this set of series. These keep getting longer, I know, but we have a boat ton to cover. I think a central place to go-to for this information is important instead of jumping around to so many places for information. Eventually, the plan is to stick them as one big post I hope so we can integrate the vast amount of knowledge flowing.
Let me know what you think in the comments below, feedback is important, I felt this is so far the most complicated of the series and it will only get crazier. Luckily we can ask questions and keep this series going with an understanding for ROM building and see how much effort goes into someone else's effort modifying one of these ROM's out there, this is just a stock ROM mod tutorial, imagine something like CyanogenMod or any crazy ROM with a boat ton of features. It is time consuming and they deserve mad props for their amazing work.
Again great stuff. Can't wait for the next tutorial!
Sent from my SPH-L710 using xda app-developers app
bigpappags3 said:
Again great stuff. Can't wait for the next tutorial!
Sent from my SPH-L710 using xda app-developers app
Click to expand...
Click to collapse
He is very informative, and puts it in ways I can understand!
------------------------
Sprint Galaxy S3
Need Help? PM
Hit the "Thanks" button if I helped!
I'm stuck
I've downloaded the APKTOOL zip, and there is no setup.bat file in the unzipped package. There are only two files in the package and nothing else. One is an application called aapt, the other is a batch file called apktool. Both of which when executed briefly open a command prompt window that closes before I can read what they say. I've followed every direction to a "T" thus far, and can't figure out what to do. I thought that perhaps I had a bad download, but I've re-downloaded the file several times without success. Any suggestions would be incredibly helpful.
Might have a solution
balcoresbane said:
I've downloaded the APKTOOL zip, and there is no setup.bat file in the unzipped package. There are only two files in the package and nothing else. One is an application called aapt, the other is a batch file called apktool. Both of which when executed briefly open a command prompt window that closes before I can read what they say. I've followed every direction to a "T" thus far, and can't figure out what to do. I thought that perhaps I had a bad download, but I've re-downloaded the file several times without success. Any suggestions would be incredibly helpful.
Click to expand...
Click to collapse
Well it seems they have changed up quite a few things on the Wiki page, the version I was using was 1.5.2, the package has moved around and it seems these instructions are as obsolete as they are dependent on a website to not change things around.
They still offer the 1.5.2 of course but in the archives, suppose it was my fault linking to a constantly changing website than to link to the files directly that I used which I was considering.
This is the link
https://code.google.com/p/android-apktool/
zalooa said:
Well it seems they have changed up quite a few things on the Wiki page, the version I was using was 1.5.2, the package has moved around and it seems these instructions are as obsolete as they are dependent on a website to not change things around.
They still offer the 1.5.2 of course but in the archives, suppose it was my fault linking to a constantly changing website than to link to the files directly that I used which I was considering.
This is the link
https://code.google.com/p/android-apktool/
Click to expand...
Click to collapse
Thanks @zalooa. I'll give it a go tonight for sure. I appreciate you getting back to me!

Categories

Resources