Help editing smali - Sprint Samsung Galaxy S III

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.

Related

[HELP] Bootloop making transparent notification background

Hello,
I have been reading up and followed some instructions to make a transparent notification background.
I used ADB to pull framework-res.apk and services.jar from my phone (running MCR R9) and replaced the status_bar_background.png in the framework-res.apk (I didn't extract, just dragged the replacement png in to the "zip") and then I followed the following instructions to edit the services.jar:
It's not really hard to do it on your own:
First download smali.jar and baksmali.jar from here http://code.google.com/p/smali/
Open the services.jar file for example with winzip, 7z, winRar, or whatever.
Unzip the classes.dex file to your sdk/tools/ folder and place the baksmali and smali file there too. After that open a new commandbox an run following line:
java -jar baksmali.jar -o out/ classes.dex
You'll have a new folder now called "out". Browse to "out/com/android/server/status" and open the file called StatusBarService.smali with a text editor like notepad.
Search for ".line 1773" and you'll find also "const/4 v5, 0x2"
Just change this to "const/4 v5, -0x3" and save the file.
Open again a new commandbox and run this:
java -Xmx512M -jar smali.jar out/ -o edited-classes.dex
Now you'll have a new dex file called "edited-classes.dex".
Delete the old file an rename the new in "classes.dex".
Open again the services.jar file with any zip tool and overwrite the classes.dex file with the one just created.
-------------
I then used update packager to create a signed update.zip of both the framework-res.apk and services jar (they were in a subfolder called framework and the script was set to copy the folder to SYSTEM) but I just get a bootloop and a whole load of force closes.
Can someone who is making themes please help me out and tell me what I am doing wrong?
Many thanks in advance
David p
Tried again following the instructions on this thread http://forum.xda-developers.com/showthread.php?t=732370 and using xUltimate-TP.exe but still ended up with a bootloop. Thank goodness for Nandroid!
I would still appreciate a helping hand though if any themers care to assist.
Thanks
David P

[q] Which apktool for ICS?

I think I am doing something wrong, and curious anyone know which specific versions of apktool will compile and decompile ICS and where might I be able to find them?
Thanks
I've had success with apk manager 5.0.2, as long as you register framework and system ui with your computer. My only issue so far is it doesn't like decompiling with dependencies, as it keeps telling me it isn't the right one, when it clearly is. I'm open to a better option too, if anybody has one.
When you say register you mean copy the framework, and systemui.apk file from the rom you are working on and do this command?
Code:
apktool.jar if framework-res.apk
What I did is download apktool one for decompile and one for compile bases on this thread:
http://forum.xda-developers.com/showthread.php?t=1427959
OK so this is what I did, I download apktools 1.4.2 and apktools 1.4.3. I am using 1.4.2 to decompile, and 1.4.3 to recomple.
So I created a folder called c:\apktools and put both apktool.jar in there but and renamed apktools.1.4.2 to apktools
and ran the following commands:
Code:
java -jar apktool-decompile.jar if framework-res.apk
then
Code:
java -jar apktool-decompile.jar d SystemUI.apk
then decompiled email.apk
Code:
java -jar apktool-decompile.jar d Email.apk
That all worked fine, now I wanted to see if I can recompile without even making a change before I started making changes, and ran this command after I renamed apktool to apktool1.4.2 and the 1.4.3 version to apktool.jar:
Code:
java -jar apktool-recompile.jar b Email
And it starts to build but then gets a ton of errors:
Code:
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
C:\Downloads\nexus\apktools\Email\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more
I would love to know what I am doing wrong.
Thanks
OK here is an update I was able to decompile and recompile framework-res, and SystemUI, using the method of decompile with 1.4.2, and then recompile with 1.4.3
I was able to decompile and recompile other apk using 1.4.3, for example Calculator.apk, But for some reason Email.apk will not recompile using same method.
Here is what I did so far that works:
1) install framework with apktool 1.4.2 - rename apktool.jar.1.4.2 to apktool.jar
Code:
java -jar apktool if framework-res.apk
2) decompile framework-res with apktool 1.4.2
Code:
java -jar apktool.jar d framework-res.apk
3) recompile framework-res with apktool 1.4.3 - rename apktool.jar to apktool.jar.1.4.2, then rename apktool.jar.1.4.3 to apktool.jar
Code:
java -jar apktool.jar b framework-res
I did the same eact thing with SystemUI, first decompile with 1.4.2 then recompile with 1.4.3 and it worked. Also as a test I was able to decompile and recompile SystemUI with 1.4.3.
I was able to decompile and recompile Calculator.apk using 1.4.3, but for some reason Email.apk will decompile but not recompile with either 1.4.2 or 1.4.3
If anyone has any ideas that be great.
Thanks!
Try to decompile with this apktool version and then recompile with 1.43
http://dl.dropbox.com/u/348210/apktool.zip
Here you go fellas, I saw this thread ages ago and only just stumbled across it again now. I have been using the apktool for a while now along with dsixda's kitchen as an extra add in.
Basically you will need to use the combination of tools attached in the zips.
Install the new aapt.exe in the windows directory (it comes from SDK16) and that will enable across all environment variables.
Then use the batch script called apktool to run install of framework
Code:
apktool if framework-res.apk
Once you have done that you can decompile any of the system apps with either apktool1
apktool2
or
apktool3
eg:
(and this IS only an example...I am not 100% sure what combination I DID use at the time?)
Code:
apktool1 d -f Mms.apk
then to rebuild
Code:
apktool2 b -f Mms
Use your ^ arrow or v arrow to shuffle through repeated scripts. like for example above if I didn't get a clean build I will push ^ and then try
Code:
apktool1 b -f Mms
Note: always call the -f force variable as it will induce the apktool to overwrite what is written to the directory and will not interferr with the next succession of build attempt.
if it fails again....then ^ and change 1 for the remaining number which is 3 like.. so
Code:
apktool3 b -f Mms
There is no consistency between ICS apps on the rebuild but almost all apps decompile with apktool3 in my scripts. In some instances widgets need to decompile with another one when you get a magic numbers errors, but essentially all will work with a combination of 1,2 or 3
There are 2 others in there also and they are for decompiling and recompiling the framework-res and SystemUI that people have had issues with.
it will be apktook-d-frame.bat
where "-d-" stands for Decompile
and obviously...
"-r-" stands for Recompile
All of these will work from the same directory. as in no getting confused wich jar you renamed to what cause they all look the same when you rename them to apktool.jar LOL (I kept the version number suffix appended for a reason haha) - You don't want to be checking MD5 # against on the website at midnight now do you?
And a working example so no one is confused
Code:
cd\apktool
now at C:\apktool\
At the start I would always do this:
tip
dir *.bat for my listings
use ^ to scroll up and check for reverence
now...where was I? oh yes example....here you go
Code:
apktool if framework-res.apk
(installs)
Code:
apktool-d-frame d -f framework-res.apk
go into windows explorer and fiddle round a bit throw a few pngs here and there and everywhere, make a big mess of a theme .....AND
Code:
apktool-r-frame b -f framework-res
and it will rebuild perfect as!
Now we want the to reuse the META-INF from the original apks unless you want to resign, but the rule of thumb is never resign the system apps unless you want to resign all system apps with the same signature. It is much easier to open "apkoriginal" in 7zip and then open "apkthemed" in the other zip (hint this is located inside the <dist> folder in the apk folder tree from the apk you just broke down) and then drag META-INF from orig over to new.
Push with adb back to phone, or in my case I really like to see a visual of what I am doing (that and I can see an update on apk size attributes on the fly) using Android Commander or Droid Explorer (either are great tools) you can reset the permissions on the file and reboot from the interface using either of these two tools.
Pros and Cons
Pro
Droid Explorer looks more pollished and fancier.
Droid Explorer has a much better representation of symlinks in system
Con
Droid Explorer sometimes does not get root permissions even though it claims that it has? Doing the visual check on the file attributes (i.e. file size) and you will see that the push of the apk file did not happen?
Droid Explorer does not have a good gui for file permissions compared to commander.
Pro
Android Commander will usually almost everytime push the file that you want where you want it every time.
Android Commander has a great gui for permissions (makes up for where it suffers everywhere else compared to droid explorer
Con
Android Commander is hard to tell what is symlinked and what isn't visually...I have looked a systemdump just to be certain sometimes lol
Android Commander sometimes just will not initiate what so ever...it will sit pending and pending and pending and it will **** you to tears....I have no idea what is worse? A windows app like Android Commander not executing or a windows app like Droid Explorer executing and lying about what it did? haha
Lastly to note. Neither of these apps perform complete system locks so when you pull and push apps do not remote the app if it is a system app i.e. delete it. even if you have it pulled to your desktop ready to theme...when you are at max capacity on your system partition. You will quickly learn that apps are greedy and take up space when they are allowed to breath (like a fat chick lycra that **** is not getting back in there!) what happens is you go to push your app back and all of a sudden WTF? There is no room? How can that be?.....hmmmm ok I will remove a couple more apps seeming I think framework-res.apk is of somewhat higher priority compared to say calculator n ****......oops well 3 or 4 apps later I decided to do a system restore and flash my new framework from recovery instead
So hopefully this gives a comprehensive run down on what you need to do and can or cant do. Good luck. Hit thanks if this has helped....it took me a lil while to pull together for you all.
James
ignore the bit about small system partition...just realised this is Galaxy Nexus not Nexus S (like Galaxy S) you guys should for AFAIK have plenty of system space.
PS: Sorry about the the visual of the fat chick in lycra, I am almost certain that did not entertain, but I do hope that the rest of the post was worth that pain. Goodbye
---------- Post added at 05:10 AM ---------- Previous post was at 05:07 AM ----------
PPS: The install of my apktool with the upgraded aapt SHOULD allow Android Commander and/or Droid Explorer apps to now function using your devices. Ignore Droid Explorers image of what ever it places as the phone to sync to.....LOL I would like to know what that is seeming your Galnex users

Decompile/Recompile Jellybean APK's

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®

How to reodex framework of stock rom ?

I wanted to increase number of volume step following this (http://forum.xda-developers.com/showthread.php?t=1411317&page=20)
I pulled the framework.odex and baksmali it but it didn't work because of dependency or something like that. Then I pulled all the odex file in there and succesfully baksmali framework.odex
I edited the smali file needed and then smali it to framework.dex. This is where I'm stuck.
The original framework use odex file, not dex file. So I guess I need to reodex the framework.dex to odex. But all the guides I found about reodex seem to be used for cooked rom, the jar files all have classes.dex in it and there 's no odex file.
Then I tried to put framework.dex into original framework.jar file (after change its name to classes.dex), use command "dexopt-wrapper framework.jar framework.odex", and overwrite the original framework.odex. The device coudn't start, it stuck at "nokia" text (is it called bootloop?)
So what is the proper way to do it ? Thanks
PS: I did it. There is a very similar example here, I missed a few thing: http://www.jordanhotmann.com/2011/08/how-to-change-default-orientation-of.html
MarryJ said:
I wanted to increase number of volume step following this (http://forum.xda-developers.com/showthread.php?t=1411317&page=20)
I pulled the framework.odex and baksmali it but it didn't work because of dependency or something like that. Then I pulled all the odex file in there and succesfully baksmali framework.odex
I edited the smali file needed and then smali it to framework.dex. This is where I'm stuck.
The original framework use odex file, not dex file. So I guess I need to reodex the framework.dex to odex. But all the guides I found about reodex seem to be used for cooked rom, the jar files all have classes.dex in it and there 's no odex file.
Then I tried to put framework.dex into original framework.jar file (after change its name to classes.dex), use command "dexopt-wrapper framework.jar framework.odex", and overwrite the original framework.odex. The device coudn't start, it stuck at "nokia" text (is it called bootloop?)
So what is the proper way to do it ? Thanks
PS: I did it. There is a very similar example here, I missed a few thing: http://www.jordanhotmann.com/2011/08/how-to-change-default-orientation-of.html
Click to expand...
Click to collapse
It's really great that you created something for yourself. But what will be even more greater, if you shared it withe community. So I advise that when you finish with this project and if successful, upload it so that we can also admire your work.

[Q] Theme Help Needed, Decompiling LG System Apps

When decompiling system apps by using apktool through cmd commands I get an "unable to decode" error on everything that is xxhdpi. After decompile I don't have those folders in my res folder. I have updated SDK, apktool (1..5.2), aapt.exe. Anyone have this issue and work through it before? thanks for any help you can give.
ecsnead69 said:
When decompiling system apps by using apktool through cmd commands I get an "unable to decode" error on everything that is xxhdpi. After decompile I don't have those folders in my res folder. I have updated SDK, apktool (1..5.2), aapt.exe. Anyone have this issue and work through it before? thanks for any help you can give.
Click to expand...
Click to collapse
compile apktool from source and it should work.
Thanks, where can I read how to do that?
So I take the new jar (apktool-cli.jar) and rename it to apktool.jar and replace my current one?
ecsnead69 said:
So I take the new jar (apktool-cli.jar) and rename it to apktool.jar and replace my current one?
Click to expand...
Click to collapse
yep
Thanks, I'll give that a try after work.
Do you have one compiled recently you could post? I am having serious problems with my Linux pc. Thanks

Categories

Resources