[Q] Framework Jar File - Android Themes

I am trying to create a reboot option for my galaxy tablet. I am in the proccess of using smali/baksmali to edit some files...the problem is when I adb pull the framework jar there is no classes file in the zip. The only thing in there is the META-INF obviously and a file called preloaded classes...this is considered just a file, not a class file. Should I not have a .class file?
EDIT-------------------------------------------------
I looked, what I mean is that there is no classes.dex file
Thanks

Found the problem. I am using a stock rom that hasn't been deodexed. I had to use baksmali to deodex the framework.odex file. Of course if you do this you have to have the right bootclasses in the folder or the file will not decompile right, and from what I have read you need that to happen in order to compile it back into a odex file. I should deodex the whole rom, but I am still new at this and don't want to create a boot loop
-Peace

Related

Dexopt Wrapper

I'm sure most of you know that optimization using dexopt wrapper creates an odex file but removes the classes.dex file in the apk. My question is, how do you remove that .odex file and change it back to a classes.dex file? I'm wondering because once I have a classes.dex file I'm going to disassemble it with baksmali see what I can do and figure out. Any help is appreciated, thanks.
alritewhadeva said:
I'm sure most of you know that optimization using dexopt wrapper creates an odex file but removes the classes.dex file in the apk. My question is, how do you remove that .odex file and change it back to a classes.dex file? I'm wondering because once I have a classes.dex file I'm going to disassemble it with baksmali see what I can do and figure out. Any help is appreciated, thanks.
Click to expand...
Click to collapse
dexopt-wrapper does not remove the dex file from the apk, unless we do it different ways, i run dexopt-wrapper ***.apk ***.odex from adb. how do you do it? and anyway, if you used dexopt-wrapper, just get the rom you flashed before doing dexopt-wrapper and you should have the full apks already in there
I'm trying to get a classes.dex file from the Phone.apk from hero builds .As you can see in my signature I'm working on porting the HTC Dialer to cupcake builds. The Phone.apk included in JaCHero2.63 just doesn't have the .dex file ,but it has the .odex file. All apks in that build that are optimized with odex do NOT have a classes.dex file in the original apk file. I'm wondering if it's possible to merge the .odex and the .apk so i can get a workable classes.dex file.

Deodexed?

What does deodex mean?
What is a deodexed rom/kernel?
Sent from my SAMSUNG-SGH-I897 using Tapatalk
Well since no one answered the question
from what i understand its like unzipping it so you can add stuff. Or fix things. But i may be way off here as im still a noob.
Http://lmgtfy.com/?q=What+is+a+deodexed+rom%
Sent from my SAMSUNG-SGH-I897
http://code.google.com/p/smali/wiki/DeodexInstructions
This tells you how to deodex a odex file. Basically an odex file is an optimized file that has device specific information regarding the dependencies of the BOOTCLASSPATH .jar files. They're primarily core.jar, ext.jar, framework.jar, android.policy.jar and services.jar. The process of deodexing is to extract all of that information for the odex file and create a classes.dex to put into the apk associated with the odex file. You have to basically tell the program, baksmali, what .jar files to look at but it takes a bit of research and trial and error to get a classes.dex file generated. You then need to add it to the apk and resign it, which requires yet another program autosign.
This process is not for the impatient or the faint of heart. You can actually do this on your PC with the correct files. Feel free to correct me if I'm wrong, I've just started messing around with deodexing.
Thanks!!!!

Recompile APK help

I'm a noob at this... I searched the forum but couldn't find any information.
Could someone more knowledgeable explain to me how to decompile and recompile apk's?? More specifically the framework-res??
I read that you can't simply unzip and then rezip... so what do I have to do?
The apk's are zip files that contain the resources (icons, bitmaps, sounds, etc.) as well as the code compiled in a classes.dex file. You can replace the resources after deodexing, but I don't think you will be able to change the compiled code in classes.dex unless you have the source code.
Sent from my SAMSUNG-SGH-I897 using XDA App
So for instance... if I have a clockwork flashable battery mod... and I unzip that... and edit colors of icons in the framework-res.apk, then can I just save the files, recompress and it will still flash properly?
And another thing.. if you have a clockword flashable .zip how do you change it so that you can flash via stock recovery? I know that simply renaming it to update.zip and trying via stock will not work. Is it a hard process, do I need a special program on my pc??
make your life easier..
search xda for Apk Manager
jslee1020 said:
So for instance... if I have a clockwork flashable battery mod... and I unzip that... and edit colors of icons in the framework-res.apk, then can I just save the files, recompress and it will still flash properly?
And another thing.. if you have a clockword flashable .zip how do you change it so that you can flash via stock recovery? I know that simply renaming it to update.zip and trying via stock will not work. Is it a hard process, do I need a special program on my pc??
Click to expand...
Click to collapse
I am not sure about editing apk's. To create a flashable zip file through stock recovery, you need to have the META-INF folder correctly created with a working updater script and the manifest and certificate files that you get by signing the zip file. Look into playing with the HTC android kitchen on the chef central section here to automate that process.

framwork-res.apk modifying

Hi,
i'am searching for a guide how to manipulate correctly the framework-res.apk.
All ways i have tested fails.
I would modify some symbols in Notification bar (battery 1%) but all Time the my Phone run into bootloop or all Application Crashes after Startup.
I've tryed Apk Manager 4.9 / and Manualy with apktool.
Help plz .....
what i did :
1-extract apk (i use 7zip/WinRAR)
2-edit/replace image file(s)
3-repack with zero compression level ('store' level)
4-sign the apk
5-replace file using apk or create flashable recovery zip.
regards.
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
PapaDocta said:
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
Click to expand...
Click to collapse
But when i add some new Files and Edit some XML the Sign will be Corrupted ?
no it won't...
You need to do two copies.. the original file and the moded one...
1. make a backup of the original file
2. extract the original file using apktool
3. edit and modify anything you like
4. compile the edited file
5. rename the compiled file to framework-res.zip and take the modified resources.arsc
6. using winrar or 7zip open (to view not extract) the backed up framework-res.apk
7. place the moded resources.arsc into the backed up framework-res.apk
by doing this you retain the original signature of the backed up file and not breaking it..
Thx, will test it ;-)
kowalski99 said:
But when i add some new Files and Edit some XML the Sign will be Corrupted ?
Click to expand...
Click to collapse
Android system, signs system apk's on boot, you shouldnt sign them
Sent from my Desire HD using Tapatalk
My signed apk just work well.
AFAIK, we only cant re-sign htc's apk.
PapaDocta said:
signing the framework-res.apk will not work.. will make the device go into bootloop
what you need is extract the framework-res.apk using apktool and edit the things you want and then compile it again using apktool .... now open the original framework-res.apk and replace the file resources.arsc with the edited compiled one..
this way you will retain the signature of the original framework-res.apk
Click to expand...
Click to collapse
The right approach always depends, what you want to change. There is no need to decompile, if you only change a few standard png. If you change xml in values folder like color, styles or arrays, you can certainly not delete resources.arsc - resources have nothing to do with the signature anyway. So if you want to play safe, you should insert the original Meta-Inf (signature) and Android Manifest after compile. It is also recommended to zipalign the final apk in order to reduce RAM usage.
thanks he_stheone64 for the clarification.. i reached that conclusion based on my own research on the net and yeah i used to change the XML files to add language support and that the only way that worked with me..
And be sure to have a working and up-to-date sdk before trying to use apktool...
First, using a old sdk release i got a partially working result (few graphics bugs and strange reboots), then with a badly updated sdk on top off the old i got apktool making many errors. Finally, re-installing the last sdk from start i got apktool and my resulting apk working correctly.

[INFO]Editing system files (smali,dex,apks)

NOTE: If you want to edit framework-res.apk or systemui.apk, follow this guide, it's the best available:good:
http://forum.xda-developers.com/showthread.php?t=2086771
Now, lets start
smali, dex....whaaat?
It's simple our odexed ROMs have .apk which use .odex files which contain cache. When the ROM is deodexed the .apk contains classes.dex which now contains information present in the .odex files!:good:
Smali is nothing but disassembled .dex file! The .dex file is disassembled into java code which can be edited via Notepad ++( simple notepad works too)
WHY?
Why do you need to edit classes.dex !
For me, i was trying to make CRT on/off animation which required editing classes.dex in service.jar!
More edits where classes.dex inside services.jar is needed
- Changing status bar clock color
- Changing text color in notification bar
- More? Tell Me!:highfive:
HOW?
Requirements: Java SDK!
I have APK Multi Tool, although it decompiles .apk and .dex files inside the apk, it doesn't provide option to decompile a separate classes.dex!
Still it's best software for decompiling apks and more!
Smali-Me 1.0
Download and Instructions:
http://www.wrapcode.com/android/baksmali-smali-dex-files/
ROM Tools by iamareebjamal - More noob friendly
http://forum.xda-developers.com/showthread.php?t=2163286
Once you have decompiled classes.dex, you'll get various folder with various files. Edit the files required and then recompile!
So after generating new classes.dex, put it back to services.jar by opening the file in winzip!:good:
ONE MORE THING
Make your own flashable zip
The recompiled systemui.apk or framework-res.apk, when pushed via root explorer give lot of force closes. This is normal, however if u wish to avoid it u can create a cwm flashable zip for the same!:good:
I'm attaching the sample.zip here and u can add your files in the specified folders. For more details read the source forum:
http://forum.xda-developers.com/showthread.php?t=1721680
Reserved- for more stuff!
Subscribed.. will see what it is later
Hey, add this to your guide, i far more easier and nice to look at too than smali me
http://forum.xda-developers.com/showthread.php?p=40435351#post40435351

Categories

Resources