How to recompile modified AndroidManifest.xml? - Android

I used
HTML:
apktool d -r app.apk
to decompress the app (without
HTML:
-r
I can't rebuild it back).
I used
HTML:
axmldec -o AndroidManifest2.xml AndroidManifest.xml
to decompile the manifest file.
Now I want to do a small change and recompile it back but I can't find any tool that does it.
How can I modify AndroidManifest.xml file and recompile it back?
The only available tools I found allow to decompile but not recompile.

Related

[Q] Deodex-ing SystemUI

I'm having some problems with deodexing SystemUI
I have honestly no idea what these bootclasspath-things are.
So I need some help to find the right bootclasspath
When I try:
Code:
baksmali -x SystemUI.odex
it comes that "Error occured while loading boot class path files."
Code:
baksmali -c <what-shall-i-write-here?> -x SystemUI.odex
Bump?
Sent from my GT-I9100 using XDA Premium App
Buuuuuuuuuuuuuuuuuuuuuuump..
specifically I don't know what bootclasspath files are used, but it doesn't matter.
it doesn't matter if you put all the contents from the framework folder into your working directory and then baksmali will "find" them...if they are in the working directory.
all you need to do is
Code:
baksmali -x SystemUI.odex

Is there a READABLE guide on how to decompile/recompile .jar and .dex?

I was able to do this about a month ago and I deleted all my files but now I am in need of it as I am trying to make an overscroll glow for this phone and I can't even remember where to start.
Skyler2Dope said:
I was able to do this about a month ago and I deleted all my files but now I am in need of it as I am trying to make an overscroll glow for this phone and I can't even remember where to start.
Click to expand...
Click to collapse
http://code.google.com/p/android-apktool/
apktool is what I use, works like a champ!
I have downloaded that but I dont know where to start really...any help would be much appreciated.
Needed:
Android sdk
Winrar
smali/baksmali tool
How to get the .jar you want:
Go into command get to platform folder inside Android sdk.
(example I'll use Android.policy.jar located in /system/framework/)
Code:
adb pull /system/framework/Android.policy.jar
This pulls .jar to your platform-tools folder. Now open .jar with winrar and extract classes.dex into tools folder; where smali and baksmali files are. Go into CMD this time get into the tools folder.
Run this in CMD
Code:
java -jar baksmali.jar /dexout/ classes.dex
Make your changes to the dex now that it's extracted. When your ready to recompile use this command:
Code:
java -Xmx512M -jar smali.jar /dexout/ new-classes.dex
Now just move new-classes.dex to desktop and rename to classes.dex then drag into .jar file we used earlier. Now to push back to phone I like to go into cwm when I'm pushing back to phone so that there is no issues.
Code:
adb push Android.policy.jar /system/framework/
Reboot or boot if you pushed whole in cwm.

[How-To]Smali/Baksmali .dex files from.jar

Posted this in a reply and figured I'd also post it as a thread so it's easier to find.
**Always backup any original file before modifying. If your phone doesn't boot push that backup to your phone.**
Needed:
Android sdk
Winrar
smali/baksmali tool
How to get the .jar you want:
Go into command get to platform folder inside Android sdk.
(example I'll use Android.policy.jar located in /system/framework/)
Code:
adb pull /system/framework/Android.policy.jar
This pulls .jar to your platform-tools folder. Now open .jar with winrar and extract classes.dex into tools folder; where smali and baksmali files are. Go into CMD this time get into the tools folder.
Run this in CMD
Code:
java -jar baksmali.jar /dexout/ classes.dex
Make your changes to the dex now that it's extracted. When your ready to recompile use this command:
Code:
java -Xmx512M -jar smali.jar /dexout/ new-classes.dex
Now just move new-classes.dex to desktop and rename to classes.dex then drag into .jar file we used earlier. Now to push back to phone I like to go into cwm when I'm pushing back to phone so that there is no issues.
Code:
adb push Android.policy.jar /system/framework/
Reboot or boot if you pushed whole in cwm.
For some reason this is not working I keep getting the help menu
jared407 said:
For some reason this is not working I keep getting the help menu
Click to expand...
Click to collapse
yea same with me
edit, just realized that was some old parameter most likely that was just telling the directory to put the files to.
Read the help file and found out the default is "out" so just leave that part out the /dexout/ part and its good to go.
check this thread here for updates on commands to use
http://forum.xda-developers.com/showthread.php?t=549309
remember to change the name of the smali and backsmali files because the ones you probably downloaded have the versions in there.

need help deodex secphone.odex

Hello
I am trying to Deodex my SG4 stoke rom secphone.odex
I read almost all threads here before posting this but still have some errors..
that's the steps I did
1-Pull framework folder from my phone and put it under c:\framework
2-run this command
java -jar baksmali.jar -d C:\framework -x secphone.odex
and it generate the "out" folder..
3- run this command
java -Xmx512m -jar smali.jar out -o classes.dex
and it generates the classes.dex file
4-Open the secphone.apk with 7zip and add the classes.dex on the root..
now when i put the secphone.apk on my phone and set permissions, the phone app always gives error that it stopped and keep poping this error until i restore the original apk..
whats missing me here to have it work?
regards
Hi Romeo,
Did you found a solution? I have the same problem.
Thanks
Me too, same problem.

Deodex lollipop system app? Having trouble.

So I have the latest smali and baksmali jar files from google. I have everything setup correctly. Baksmali and smali are in a folder named smali on my C: directory. SystemUI.odex is also in that file. I also have my entire framework directory from my ROM on the root of my c drive. I'm trying to deodex SystemUI.odex. when I run this command in command prompt : "java -jar baksmali.jar -d C:\framework -x SystemUI.odex" I get an error stating that systemUI.odex is not an apk, dex or odex file....... Any idea what the issue is?
Sent from my Nexus 5 using xda premium

Categories

Resources