Deprecated. - EVO 4G Themes and Apps

Deprecated.

Deprecated.

Deprecated.

I must be missing something..but how do i get to the com/android/server/status?

backdown said:
I must be missing something..but how do i get to the com/android/server/status?
Click to expand...
Click to collapse
This reference assumes that you already know how to recompile a framework file using smali/baksmali.

You're my hero for this, steel.
Just saying.
This is something that has driven me straight up the wall. Having so many useless icons means that when I finally do get some notifications, they get pushed right off the edge. I really can only seem to fit ~4 notifications most of the time before I get the arrow.

Well I've got the necessary lines changed to take out the location icons... Now to repackage it. Thanks for this!

Uh... I've never signed a .jar before. Anyone???
EDIT: I attached the services.jar I edited. It has to be signed for the phone to even boot up. Hopefully someone can sign this.

This is hot... I like it a lot. I have been looking for something like this for quiet awhile. Now to read up on smali/baksmali. I know how to edit a .jar file but there are "files" within that file.... Great... But I have to learn at least one thing a day right. If anyone has insight for me feel free to enlighten us but google search will suffice for now.

webby_s said:
This is hot... I like it a lot. I have been looking for something like this for quiet awhile. Now to read up on smali/baksmali. I know how to edit a .jar file but there are "files" within that file.... Great... But I have to learn at least one thing a day right. If anyone has insight for me feel free to enlighten us but google search will suffice for now.
Click to expand...
Click to collapse
Start here: http://code.google.com/p/smali/.

Thank you very much for posting this. This has been something bothering me since I got the device.
I have no idea how to use these tools, but I will figure them out.
EDIT: Figured it out. The steps worked! My taskbar is so clean and beautiful now!
Here are some VERY BASIC directions. Use at your own risk. They worked for me.
Make a backup of your services.jar on your device (or alternatively make a nandroid backup): adb shell cp /system/framework/services.jar /system/framework/services.jar.bak
Get services.jar from your device: adb pull /system/framework/services.jar .
Extract classes.dex from services.jar
Decompile the .dex file: java -jar baksmali.jar classes.dex -o outputdir
Make desired edits to the files now in outputdir/
Recompile the .dex file: java -Xmx512M -jar smali.jar outputdir/ -o classes.dex
Add the new (modified) classes.dex file to the existing services.jar file (which is actually a zip file)
Cross your fingers and push services.jar back to your device: adb push services.jar /system/framework/services.jar
Reboot device: adb reboot

How about someone post two edited and signed files to share with everyone else...?

EVOme said:
How about someone post two edited and signed files to share with everyone else...?
Click to expand...
Click to collapse
I believe (please correct me if I'm wrong) the services.jar could be different in certain ROMs or themes. It's better to make the edits yourself on the file that came off your device to preserve the integrity of the rest of your system.
EDIT: What we need is an app that makes the edits on the device for us...

Thanks, Xak

EVOme said:
Thanks, Xak
Click to expand...
Click to collapse
Sure thing. By the way, I love (and concur with) your avatar

So, as usual, I made this a lot more complicated than it needs to be. Somehow I was un-signing services.jar. I don't know. I got it to work now though. WORD!

many thanks to xak and the OP. with your help i was easily able to get rid of that pesky gps on/off icon! i appreciate the tips

Nice, this made me learn smali/baksmali and edit services.jar according to what I want.
Thanks!

webby_s said:
This is hot... I like it a lot. I have been looking for something like this for quiet awhile. Now to read up on smali/baksmali. I know how to edit a .jar file but there are "files" within that file.... Great... But I have to learn at least one thing a day right. If anyone has insight for me feel free to enlighten us but google search will suffice for now.
Click to expand...
Click to collapse
Very useful information about services.jar, smali/baksmali, classes.dex can be found HERE
As someone else mentioned, they learned how to use smali/baksmali and do customizations themselves. My OP along with the link posted here gives you all the info you need to perform these mods yourself, and at the same time you will learn a great deal on customizing your evo; The benefits of which are endless!
One final note, you need to use the services.jar from the ROM you are running, THEY ARE NOT interchangeable due to the fact that almost all ROM devs add some customizations into their roms.

SteelH - thanks for posting this! I love learning new things, so this was interesting... wasn't exactly sure where to start though, so these steps from xak were a great help.
xak944 said:
Thank you very much for posting this. This has been something bothering me since I got the device.
I have no idea how to use these tools, but I will figure them out.
EDIT: Figured it out. The steps worked! My taskbar is so clean and beautiful now!
Here are some VERY BASIC directions. Use at your own risk. They worked for me.
Make a backup of your services.jar on your device (or alternatively make a nandroid backup): adb shell cp /system/framework/services.jar /system/framework/services.jar.bak
Get services.jar from your device: adb pull /system/framework/services.jar .
Extract classes.dex from services.jar
Decompile the .dex file: java -jar baksmali.jar classes.dex -o outputdir
Make desired edits to the files now in outputdir/
Recompile the .dex file: java -Xmx512M -jar smali.jar outputdir/ -o classes.dex
Add the new (modified) classes.dex file to the existing services.jar file (which is actually a zip file)
Cross your fingers and push services.jar back to your device: adb push services.jar /system/framework/services.jar
Reboot device: adb reboot
Click to expand...
Click to collapse
In addition to these steps, I wanted to mention a few things... these might be obvious to most, but hopefully they help someone.
- to extract and re-add classes.dex from/to services.jar, use winzip
- to modify the .smali files that Steel mentions, use notepad
- you will need to mount /system as read/write before you can push services.jar back to the phone
- it took a long time for my phone to reboot... i got pretty nervous
thanks again, I love not having the alarm and gps icons taking up space

Related

[SOLVED] Looking for help to remove clock from status bar.

Was searching the forums looking for a way to remove the clock from my status bar and have come to the conclusion it may be a little over my head at this point. Can make me a flashable zip to remove the clock? Or maybe some step by step instructions on how I would accomplish this? Thanks in advance.
Update 3/26---------------------------------------------------------------------------
JKILO is working on a flashable .zip for MikShift, so until then here's how you do it manually....
Instructions for removing status bar clock on an odex rom:
Props to JKILO and riggsandroid for helping a total noob and doing most of the work. Also thanks to Steelh for showing us the lines to replace. His method for deodex roms is here. If I forgot to add anyone that helped out, let me know. I always throw props where its deserved.
You are modding at your own risk. Nobody who helped bring this to you is responsible for bricked phones or temper-tantrums.
Requirements:
-Rooted Evo Shift
-Odex Rom
-Windows (I used Windows 7. If you are using another os, I'm sure you can figure it out. If not, ask)
-sdk properly set up
-smali\baksmali
-dexopt-wrapper
-knowledge of the above things (at least have the ability to google for info)
-a nandroid backup of your phone (for obvious reasons)
-patience
-/system mounted as r/w (I did this in terminal emulator from my phone: type:
"su" then hit enter. type: "mount -o rw,remount -t ext3 /dev/block/mmcblk0p26 /system" then hit enter)
First thing you need to do is pull services.jar from /system/framework;
-"adb pull /system/framework/services.jar"
Next you need to open up services.jar with 7zip or winrar or something similar
Pull classes.dex out into a working folder with smali\baksmali
(I just did everything in my platform-tools folder in sdk so I didnt have to switch back and forth. You can do it however you want.)
Open command prompt as administrator
Cd to your work folder
Type this line:
java -jar baksmali.jar classes.dex
This will will create a folder named out in your work folder
Navigate to \com\android\server\status and look for StatusBarPolicy.smali
Open StatusBarPolicy.smali with Notepad or something similar
Search for:
.line 593
invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->updateClock()V
Add the following line two spaces under that to look like this:
invoke-virtual {p2, v3, v6}, Lcom/android/server/status/StatusBarService;->setinvisibilty(Landroid/os/IBinder;Z)V
It should look like this now:
.line 593
invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->updateClock()V
invoke-virtual {p2, v3, v6}, Lcom/android/server/status/StatusBarService;->setinvisibilty(Landroid/os/IBinder;Z)V
Now click file then save as. Be sure to change the file type or youll save it as a text file that is useless to you.
Now head back to your command prompt.
still being cd'd to your work folder, type this:
java -jar smali.jar out
This will create a new .dex file named out.dex. Rename it to classes.dex and replace the classes.dex from services.jar with the new one you just made.
Now place the modified services.jar and dexopt-wrapper on your sdcard and plug your phone into your computer. (charge only)
Back to command prompt in your platform-tools directory
Type these commands in the order they appear, hitting enter after each one:
-adb shell
-cd /system/bin
-busybox cp /sdcard/dexopt-wrapper /system/bin
-busybox chmod 755 dexopt-wrapper
-cd /sdcard
-dexopt-wrapper services.jar new.odex /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/com.htc.framework.jar:/system/framework/com.htc.android.pimlib.jar:/system/framework/com.htc.android.easopen.jar:/system/framework/com.scalado.util.ScaladoUtil.jar:/system/framework/com.orange.authentication.simcard.jar
- busybox dd if=/system/framework/services.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
-cd /system/framework
-busybox cp /sdcard/new.odex services.odex
-busybox chmod 644 services.odex
-sync
-reboot
Your phone will reboot and, viola! NO Clock!!!!
bobtsunam said:
Was searching the forums looking for a way to remove the clock from my status bar and have come to the conclusion it may be a little over my head at this point. Can make me a flashable zip to remove the clock? Or maybe some step by step instructions on how I would accomplish this? Thanks in advance.
<Blaze One>
Click to expand...
Click to collapse
on page 2 of this forum.
http://forum.xda-developers.com/showthread.php?t=966190
riggsandroid said:
on page 2 of this forum.
http://forum.xda-developers.com/showthread.php?t=966190
Click to expand...
Click to collapse
Saw that one but I havent done anything to that extent before. Was really hoping someone had a zip out there I could flash. Oh well. Maybe in the future. Until then ill try my hand at compiling....
<Blaze One>
bobtsunam said:
Saw that one but I havent done anything to that extent before. Was really hoping someone had a zip out there I could flash. Oh well. Maybe in the future. Until then ill try my hand at compiling....
<Blaze One>
Click to expand...
Click to collapse
what rom are you on?
riggsandroid said:
what rom are you on?
Click to expand...
Click to collapse
Currently on infinite's 2.0.
<Blaze One>
So I'm still trying to figure this out. From what I read I need to edit system/framework/services/classes? How would I go about editing this?
<Blaze One>
bobtsunam said:
So I'm still trying to figure this out. From what I read I need to edit system/framework/services/classes? How would I go about editing this?
<Blaze One>
Click to expand...
Click to collapse
Download apktool - http://code.google.com/p/android-apktool/
Follow instructions to setup your machine (installing framework, etc)
Decompile the services.jar in the /system/framework folder
Edit the lines indicated in teh smali files and recompile.
Push updated services.jar to your phone, reboot (takes a while, has to rebuild dalvik cache) and you should be good to go.
Thanks. I'll attempt this when I get home. If/when I get this completed, is it possible to make a general .zip file for others to flash if they are interested in doing the same thing? I've seen the question posed on many forums but haven't found a file that can be flashed. Would be nice to have something everyone can benefit from...
Edit: I'm guessing its gonna be Rom specific?
bobtsunam said:
Thanks. I'll attempt this when I get home. If/when I get this completed, is it possible to make a general .zip file for others to flash if they are interested in doing the same thing? I've seen the question posed on many forums but haven't found a file that can be flashed. Would be nice to have something everyone can benefit from...
Edit: I'm guessing its gonna be Rom specific?
Click to expand...
Click to collapse
Definitely rom specific. Unique for themes as well, I believe.
Sent from my MikShift.
smoothtaste said:
Definitely rom specific. Unique for themes as well, I believe.
Sent from my MikShift.
Click to expand...
Click to collapse
Figured as much. Hopefully I will be able to pull this off. I have not done any programming related stuff on Android yet. Most I've done is change an icon or two but that was pretty simple using ninjamorph. I literally know nothing about the file structure or coding. Might he time to start learning java at least if I'm gonna get into modding to this extent. We shall see how all this goes later tonight.
<Blaze One>
I have been trying to rebuild services.jar after editing StatusBarPolicy.smali and for some reason it doesn't work. I get something to this extent:
Exception in thread "main" java.lang.NullPointerException
(and then a bunch of other lines...)
Any idea what's goin on?
By the way, I'm replacing this:
.line 593
invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->updateClock()V
With this:
.line 593
invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->updateClock()V
invoke-virtual {p2, v3, v6}, Lcom/android/server/status/StatusBarService;->setIconVisibility(Landroid/os/IBinder;Z)V
Does this look right?
Thanks for any help...
Ok....I noob'd it. When a saved the changes to the StatusBarPolicy file I saved it as a text file somehow. Was able to build services.jar and push it back but the changes didn't take or something. Clock is still there. Am I editing the right line with right changes?
bobtsunam said:
Ok....I noob'd it. When a saved the changes to the StatusBarPolicy file I saved it as a text file somehow. Was able to build services.jar and push it back but the changes didn't take or something. Clock is still there. Am I editing the right line with right changes?
Click to expand...
Click to collapse
Just want to make sure - you restarted? It will take a little while because it has to rebuild the Dalvik Cache cause you modified the .jar file.
Yeah I actually mounted /system from recovery and pushed back in from there. I even tried it a second time, formatting dalvik cache. Do I need to restart an additional time?
<Blaze One>
bobtsunam said:
Yeah I actually mounted /system from recovery and pushed back in from there. I even tried it a second time, formatting dalvik cache. Do I need to restart an additional time?
<Blaze One>
Click to expand...
Click to collapse
No that should work the way you're doing it. Not sure...
riggsandroid said:
No that should work the way you're doing it. Not sure...
Click to expand...
Click to collapse
Just remembered something I saw as services.jar was rebuilding. Right before it finished it said sources not found. Don't know if this gives a clue. Also I'm running dreads blue honeycomb theme. Would that have something to do with it?
<Blaze One>
Figured I would post the steps I took in case I'm messing it up somehow. I'm using Windows 7.
First thing I did was adb pull services.jar from /system/framework using: adb pull /system/framework/services.jar
Moved services.jar to a folder I created on the root of my c: drive called test.
Opened cmd as an administrator.
Decoded services.jar using : apktool d services.jar which created services.jar.out in my test folder.
Navigated to StatusBarPolicy.smali @ c:\test\services.jar.out\smali\com\Android\server\status
Edited the lines as stated previously.
Opened cmd back up and rebuilt with: apktool b -f -d services.jar.out which put the new services.jar in a new folder called build located in services.jar.out
Noticed at this point that the meta file wasn't in services.jar so I copied from the original to the new.
Then pushed back to phone while in recovery using: adb push services.jar /system/framework and booted.
See anything I'm doing wrong?
<Blaze One>
You don't need apktool to do that. Use smali.jar and baksmali.jar to decompile and recompile.
http://code.google.com/p/smali/
Download the two jar files under featured downloads. For ease of typing, rename them baksmali.jar and smali.jar, respectively, and put them in c:\. Open as archive with 7zip to pull the classes.dex file out. Move classes.dex to c:\. Open admin cmd prompt and type:
java -jar -Xmx512M baksmali.jar c:\classes.dex
This will dump classes.dex into a folder c:\out. Make your smali edit then to recompile the dex file type:
java -jar -Xmx512M smali.jar c:\out
This will produce c:\out.dex. Move the file to your Desktop, rename it classes.dex and put it back in your services.jar. Push the file in recovery, no need to clear dalvik cache and it should work. If it's still not working, link me your original services.jar and I'll try to get it working for you.
EDIT: btw, kudos to you for taking the initiative to learn this. I have much respect for that.
EDIT 2: Are you on 2.0 odexed or deodexed?
Sent from my PG06100 using Tapatalk
tambourineman86 said:
You don't need apktool to do that. Use smali.jar and baksmali.jar to decompile and recompile.
http://code.google.com/p/smali/
Download the two jar files under featured downloads. For ease of typing, rename them baksmali.jar and smali.jar, respectively, and put them in c:\. Open as archive with 7zip to pull the classes.dex file out. Move classes.dex to c:\. Open admin cmd prompt and type:
java -jar -Xmx512M baksmali.jar c:\classes.dex
This will dump classes.dex into a folder c:\out. Make your smali edit then to recompile the dex file type:
java -jar -Xmx512M smali.jar c:\out
This will produce c:\out.dex. Move the file to your Desktop, rename it classes.dex and put it back in your services.jar. Push the file in recovery, no need to clear dalvik cache and it should work. If it's still not working, link me your original services.jar and I'll try to get it working for you.
EDIT: btw, kudos to you for taking the initiative to learn this. I have much respect for that.
EDIT 2: Are you on 2.0 odexed or deodexed?
Sent from my PG06100 using Tapatalk
Click to expand...
Click to collapse
Its mikshift lol we've been tryin to figure it out together..so odexed
Sent from my PG06100 using XDA App
You know apktool uses small baksmali right?
i find it easier to use the same program for stuff - its nice that apktool does both .jar and .apk files.
tambourineman86 said:
You don't need apktool to do that. Use smali.jar and baksmali.jar to decompile and recompile.
http://code.google.com/p/smali/
Download the two jar files under featured downloads. For ease of typing, rename them baksmali.jar and smali.jar, respectively, and put them in c:\. Open as archive with 7zip to pull the classes.dex file out. Move classes.dex to c:\. Open admin cmd prompt and type:
java -jar -Xmx512M baksmali.jar c:\classes.dex
This will dump classes.dex into a folder c:\out. Make your smali edit then to recompile the dex file type:
java -jar -Xmx512M smali.jar c:\out
This will produce c:\out.dex. Move the file to your Desktop, rename it classes.dex and put it back in your services.jar. Push the file in recovery, no need to clear dalvik cache and it should work. If it's still not working, link me your original services.jar and I'll try to get it working for you.
EDIT: btw, kudos to you for taking the initiative to learn this. I have much respect for that.
EDIT 2: Are you on 2.0 odexed or deodexed?
Sent from my PG06100 using Tapatalk
Click to expand...
Click to collapse
Sent from my PG06100 using XDA App

Need someone to compile an APK for me

Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Thanks!!
Here's what I need compiled:
http://mikelierman.com/SystemUI.apk.zip
0vermind said:
Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Thanks!!
Here's what I need compiled:
http://mikelierman.com/SystemUI.apk.zip
Click to expand...
Click to collapse
What did you use to decompile it? APK Manager from this thread?
http://forum.xda-developers.com/showthread.php?t=695701
Oh and once you compile it, you don't have to sign it because is a system app and not a regular app.
0vermind said:
Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Click to expand...
Click to collapse
What errors are you getting from apktool? It's going to be hard for someone else to compile an apk that has not been decoded by them and not knowing what files have been changed. Letting us know at least what .png or .xml files were modified would be a start but will work best if we could just figure out why you aren't able to build with your modifications.
The first thing I noticed from the zip you attached is that it's missing the apktool.yml file that should get created a package is decoded. Second, make sure to pull /system/framework/framework-res.apk so resources can be decoded/built properly. If you are using APK Manager, use option 10 to decode with framework-res.apk. If you are just using apktool run the command "apktool if framework-res.apk" before decoding.
mazdarider23 said:
Oh and once you compile it, you don't have to sign it because is a system app and not a regular app.
Click to expand...
Click to collapse
SystemUI.apk actually does get signed using the platform key. The easiest way to do so in my opinion is to use ZipSigner 2 on your phone. Also, once you've placed the modified SystemUI.apk into /system/app make sure it's permissions are rw-r--r--(chmod 644 /system/app/SystemUI.apk) and it's owner:group is root:root(chown 0:0 /system/app/SystemUI.apk). Next reboot to recovery, wipe dalvik-cache and cache, then reboot.
MongooseHelix said:
What errors are you getting from apktool? It's going to be hard for someone else to compile an apk that has not been decoded by them and not knowing what files have been changed. Letting us know at least what .png or .xml files were modified would be a start but will work best if we could just figure out why you aren't able to build with your modifications.
The first thing I noticed from the zip you attached is that it's missing the apktool.yml file that should get created a package is decoded. Second, make sure to pull /system/framework/framework-res.apk so resources can be decoded/built properly. If you are using APK Manager, use option 10 to decode with framework-res.apk. If you are just using apktool run the command "apktool if framework-res.apk" before decoding.
SystemUI.apk actually does get signed using the platform key. The easiest way to do so in my opinion is to use ZipSigner 2 on your phone. Also, once you've placed the modified SystemUI.apk into /system/app make sure it's permissions are rw-r--r--(chmod 644 /system/app/SystemUI.apk) and it's owner:group is root:root(chown 0:0 /system/app/SystemUI.apk). Next reboot to recovery, wipe dalvik-cache and cache, then reboot.
Click to expand...
Click to collapse
Well I'm glad you told me because little old me has been modifying system apps since the days of the nexus one and I've yet to sign one....I think is all depends on who's doing the modification...hahahaha....Good luck 0vermind on finding someone to compiling your systemui.apk!
mazdarider23 said:
Well I'm glad you told me because little old me has been modifying system apps since the days of the nexus one and I've yet to sign one....I think is all depends on who's doing the modification...hahahaha....Good luck 0vermind on finding someone to compiling your systemui.apk!
Click to expand...
Click to collapse
I'm not quite sure what to make of that comment...I certainly wasn't trying to step on your toes so I apologize if it came across that way. Just wanted to help avoid and rule out any issues that might come up. With APK Manager or by using 7zip, you can move the manifest and/or META-INF folder containing the signature from the original but to imply that system apps are not signed is incorrect.
I also think it is important that those messing with system apps understand that there are different keys used to sign apps. For anybody reading this that wants to figure out how certain packages are signed, here's a bit of an explanation. If we extract SystemUI.apk, we see a directory called META-INF. This holds the key/signature info. The key's serial number can be determined with the following command:
Code:
keytool -printcert -v -file SystemUI/META-INF/CERT.RSA | grep SerialNumber
You can check other apks/jars and noticing which have matching serial numbers, meaning they are signed with the same key...
platform key - SystemUI.apk, Settings.apk, Phone.apk, etc
shared key - Contacts.apk, UserDictionaryProvider.apk, etc
test key - Calendar.apk, DeskClock.apk, etc
google proprietary key - Vending.apk, Talk.apk, etc (including some market user apps like Maps, VoiceSearch, Docs)
MongooseHelix said:
I'm not quite sure what to make of that comment...I certainly wasn't trying to step on your toes so I apologize if it came across that way. Just wanted to help avoid and rule out any issues that might come up. With APK Manager or by using 7zip, you can move the manifest and/or META-INF folder containing the signature from the original but to imply that system apps are not signed is incorrect.
I also think it is important that those messing with system apps understand that there are different keys used to sign apps. For anybody reading this that wants to figure out how certain packages are signed, here's a bit of an explanation. If we extract SystemUI.apk, we see a directory called META-INF. This holds the key/signature info. The key's serial number can be determined with the following command:
Code:
keytool -printcert -v -file SystemUI/META-INF/CERT.RSA | grep SerialNumber
You can check other apks/jars and noticing which have matching serial numbers, meaning they are signed with the same key...
platform key - SystemUI.apk, Settings.apk, Phone.apk, etc
shared key - Contacts.apk, UserDictionaryProvider.apk, etc
test key - Calendar.apk, DeskClock.apk, etc
google proprietary key - Vending.apk, Talk.apk, etc (including some market user apps like Maps, VoiceSearch, Docs)
Click to expand...
Click to collapse
Thanks, I didn't know this! I'm glad there's people like you and mazdarider23 on this forum that know **** like this!!!

[Q] Guide Request-- How to Implement Krylon's CIQ Removal

Hello. I would like to know if anyone has an actual beginner's guide to CIQ removal. For a minute, there was a guide that didn't quite have all the bugs worked out of it, but it was removed. I've been trying to follow Krylon's thread on rootzwiki, but it seems to stop short of telling people how to actually recompile everything and push it back to the phone. It would be helpful and informative to be walked through this process once the CIQ files have been deleted from the decompressed classes.dex files and .xml manifest.
Thanks
Note: So far, I have figured out that autosmali can be used to smali the files back into a classes.dex file, which can be reincorporated into the associated .jar files using 7zip. Seems simple enough. However, the process of getting framework-res updated seems to be more complicated, and requires answering some questions about. Specifically: 1. Option 11 asks (a) Is this a system apk? (b) Aside from the signature, would you like to copy over any additional files that you didn't modify from the original apk in order to ensure least # of errors? I have answered "yes" to 1.(a) and "yes" to 1.(b), which told me to delete the .xml and the resources.arcs file from a temp directory before completing the compile. This whole process has left me with three modified files (framework.jar, android.policy.jar, and framework-res.apk (unsigned)). Now what do I do with them?
Note 2: Looks like I can sign the framework-res.apk file using option 12.
Once you are done modifying the files you need to either put them in an update.zip and flash or push them with adb to their respective folders.
As for someone giving a step by step I doubt that will happen. It seems like the ones that do know how to do alot of the modifications to roms, are pretty vague when they post how to's. Most of the time it seems like they just don't want to share the information. Why I don't know, but that is just my opinion. I am sure I will probably get flamed for saying this but again this is just my opinion.
You can search the forums and find most of the information here and there. Then you need to put it all together and hope it works.
My thought's would be to have a seperate area in the forum to post just Tips, Techniques and How To's. Then alot of the people that want to learn how to theme and build roms would have an better source to find their answers than having to search all the forums. Again just my .02 cents worth...
Hope no one is offended by this as that is not my intention.... XDA is a great source for information...
quick steps..
Decompile Framework.jar, delete the entire carrieriq dir and all it's contents, recompile.
delete /system/xbin/iqbridger
DONE
Makes the rest dead code.
tablador said:
Hello. I would like to know if anyone has an actual beginner's guide to CIQ removal. For a minute, there was a guide that didn't quite have all the bugs worked out of it, but it was removed. I've been trying to follow Krylon's thread on rootzwiki, but it seems to stop short of telling people how to actually recompile everything and push it back to the phone. It would be helpful and informative to be walked through this process once the CIQ files have been deleted from the decompressed classes.dex files and .xml manifest.
Thanks
Note: So far, I have figured out that autosmali can be used to smali the files back into a classes.dex file, which can be reincorporated into the associated .jar files using 7zip. Seems simple enough. However, the process of getting framework-res updated seems to be more complicated, and requires answering some questions about. Specifically: 1. Option 11 asks (a) Is this a system apk? (b) Aside from the signature, would you like to copy over any additional files that you didn't modify from the original apk in order to ensure least # of errors? I have answered "yes" to 1.(a) and "yes" to 1.(b), which told me to delete the .xml and the resources.arcs file from a temp directory before completing the compile. This whole process has left me with three modified files (framework.jar, android.policy.jar, and framework-res.apk (unsigned)). Now what do I do with them?
Note 2: Looks like I can sign the framework-res.apk file using option 12.
Click to expand...
Click to collapse
Don't use option 12.
NEVER SIGN A SYSTEM APK
krylon360 said:
Don't use option 12.
NEVER SIGN A SYSTEM APK
Click to expand...
Click to collapse
Thanks krylon for the quick fix.
If, for completeness, I wanted to put all of these modified files on my phone (unsigned), how would I do it? Last time I tried, I used a root file explorer and my phone started bootlooping immediately after placing framework-res.apk on the phone. Adb was not available, so I had to reflash in order to put the file back the way it was. I was thinking maybe to adp push the file instead of copying it with the explorer.
adb push then reboot.
but, it's best to do it as a fresh install.
Thanks, I will give that a try.
Followed these directions 3x, but when I boot up my phone with these changes, the Android System process stops responding every time i boot my phone. I can bypass the error message fine, though.
edit: Well, after reflashing it 2 more times with the exact same rom, it doesn't happen anymore. MEH, who knows?
One of Raver's ROMs did that too. I think it is a dependency to something you removed. It was fine on the ROM. One FC when you boot ROM and that was it.

How to re-odex?

Normally to decompile my dex files I use smali and baksmali, how can I re-odex them?
Id like to get my service.jar re-odexed so I can try and push it to my phone via a zip update.
Sent from my MB865 using xda premium
[mini HOW-TO] Re-Odex (or create a new .odex file)
Fall of Enosis said:
Normally to decompile my dex files I use smali and baksmali, how can I re-odex them?
Id like to get my service.jar re-odexed so I can try and push it to my phone via a zip update.
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
It all needs to be done on your phone, live.. with adb.
Here's how I accomplished it - I will use the services.jar in this example. Just change the file name and path to existing .odex accordingly for other files (not sure if all steps are required exactly, but it has worked for me multiple times with different jars and SysUI apk):
Requirements:
Odexed system
adb
dexopt-wrapper
Put this dexopt-wrapper file (unzip first) in /system/bin with 775 permissions:
X X X
X....X
X....X
Probably a good idea to reboot after pushing that file, if you use root explorer (like I did).
Put the deodexed services.jar (or other jar/apk file you want to make an new odex of) on your sd card.
Go to /system folder (with root explorer or equal) and mount it R/W (not sure if this is necessary - but won't hurt)
Put your USB connection to "Charge only" mode.
Go here (big props and credit to jhotmann for this) and follow steps 8-12 (I've recreated the steps with the A2's bootclasspath below).
The bootclass path is located in the /init.rc file at the root of your phone.
Connect with adb (do a adb devices check to make sure you're all good).
To create the new odex:
Code:
adb shell
su
cd /sdcard/
dexopt-wrapper services.jar new.odex /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar
I know it's a long entry for those who don't work with command lines often (like me), but double check your entry before hitting enter.
To copy the signature from the existing odex (change path to /system/app/.. if necessary):
Code:
busybox dd if=/system/framework/services.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
Done! Rename new.odex (created on your /sdcard) to services.odex since that is your new signed odex file...
You can then get that on your odexed system by your choice of method (adb push, update.zip, root explorer push, etc.. - note: please know what you are doing before trying to push files with root explorer! - you cannot simply copy and paste!)
Or, if you want to deodex it right away again for some odd reason like I did (personal issues )... Take the services.jar and the new services.odex from your sdcard and put them on your computer - and open the services.jar with 7-zip (maybe winzip) and delete the classes.dex file from the 7-zip window. Now you have a fresh new set of .jar/.odex files ready for deodexing (I did this all with the SystemUI.apk last night, that's why I elaborated and re-typed this whole thing today..).
Frigging brilliant man.
Much appreciated. I'm super sick and my USB cable is at work.
Once i get it back on Wednesday, I'll work all this out. If I could thank you twice I would.
Thanks man!
Sent from my MB865 using xda premium
Fall of Enosis said:
Frigging brilliant man.
Much appreciated. I'm super sick and my USB cable is at work.
Once i get it back on Wednesday, I'll work all this out. If I could thank you twice I would.
Thanks man!
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
Not a prob.
And, I updated the dexopt-wrapper link so it's easier to download - just unzip it first..
Good luck on your quest.. let me know if you catch any snags along the way - and i'll try and help you out.
Sent from my mind using XDA
Ok sooo, I think we (or most likely me) are confused on what I wanted to do. I don't want to make a NEW odex file. I need to recombine my modded classes.dex BACK with the service.jar.
Since I needed to modify some script in the services.jar I had to de-odex it so I had a classes.dex file to use baksmali with so I could modify it. Once I modded it I used smali to create the NEW MODDED classes.dex. And now I need to re-odex(bad terminology?) them to re-combine the services.jar with the classes.dex so the modded services.jar could be used on a odexed ROM.
I'm working on a de-odexed version also, but I'd like to be able to offer both
Fall of Enosis said:
Ok sooo, I think we (or most likely me) are confused on what I wanted to do. I don't want to make a NEW odex file. I need to recombine my modded classes.dex BACK with the service.jar.
Since I needed to modify some script in the services.jar I had to de-odex it so I had a classes.dex file to use baksmali with so I could modify it. Once I modded it I used smali to create the NEW MODDED classes.dex. And now I need to re-odex(bad terminology?) them to re-combine the services.jar with the classes.dex so the modded services.jar could be used on a odexed ROM.
I'm working on a de-odexed version also, but I'd like to be able to offer both
Click to expand...
Click to collapse
So, you have a deodexed services.jar (with an unedited classes.dex inside)? And, you also have an edited classes.dex (the new modded one). Just drag and drop the new modded classes.dex into the services.jar file with 7-zip to overwrite the old one.
Then I would check out the mods on a deodexed system, and provided they work, then go through the re-odexing process (separating that classes.dex from the apk and creating a new odex file) as described above to get it working on odexed systems.
Hope that helps.. Good luck!
Yes sir, you are correct. That was the first thing I tried to do was just drag and drop the modded classes.dex with 7zip, save it, however when i tried to flash the "modded" ROM it can't install the system folder because (according to Jim), when I modded copied the new classes.dex, I changed the size, and so the signature needed to be changed as well. They mismatched.
Fall of Enosis said:
Yes sir, you are correct. That was the first thing I tried to do was just drag and drop the modded classes.dex with 7zip, save it, however when i tried to flash the "modded" ROM it can't install the system folder because (according to Jim), when I modded copied the new classes.dex, I changed the size, and so the signature needed to be changed as well. They mismatched.
Click to expand...
Click to collapse
Not sure about the details of that.. I know the signatures can be tricky, but I've modded a few apks/jars similarly with no problems... when you say "can't install.." is that it wouldn't flash in recovery, or you bootlooped?
Just wouldn't flash at all.
And thanks for all your help man.
Sent from my MB865 using xda premium
I've updated the 2nd post with more detail on creating a new odex file...
Not to be a "rooster" (replace with your word of choice) or anything, but maybe this info has a place somewhere besides the general threads..?:angel: (and what is up with these new Smilies and posting reply layout?) - it just seems so hard to come by good literature on this process (which, I suppose, is a process so rarely needed though...)
So I need to perform the processes above while running in an odexed environment correct? Does this process change the deodexed APK we are running the script on to an odexed one as well as create a new .odex file for that APK? I am just confused about what the result is after running the script. For my situation I want to take 2 deodexed files (systemui and sec settings.apk) and odex them. Then push them into an odexed rom. Once I run the script above what am I left with?
Didact74 said:
So I need to perform the processes above while running in an odexed environment correct?
YES.
Does this process change the deodexed APK we are running the script on to an odexed one as well as create a new .odex file for that APK?
(Yes, it will create a new odex file that you will need to rename, but..)NO. You will need to take the classes.dex out of the deodexed apk/jar - use something like 7-zip. Unless you only edited smali, then you really only need the new odex file.
I am just confused about what the result is after running the script. For my situation I want to take 2 deodexed files (systemui and sec settings.apk) and odex them. Then push them into an odexed rom. Once I run the script above what am I left with?
Click to expand...
Click to collapse
I broke up your quote with my best answers...
As for what your're left with is a new.odex file, properly signed, if all goes well. You are going to need to do it for each of your deodexed files.
Rename them, remove the classes.dex from the deodexed files you used, and get them on your phone however you choose (I prefer zip packages and a restore.zip in case something goes wrong).
Also note that the bootclass path is different from GB to ICS.. and among different devices of course. Check init.rc file if need be. I posted the one to use for A2 ICS (think it may be the same for razr too) here: http://forum.xda-developers.com/showthread.php?t=1753659
I can't garuntee you won't have problems, but good luck... if you do you could try the dexopt-wrapper from here: http://forum.xda-developers.com/showthread.php?t=1645950 - just unzip it first obviously (but I think it's the exact same file though..)
Btw, it's all done with adb, one line at a time.. not really a script, but thank you for the idea - maybe a batch file?
Sent from my phone's mind
Great, thank you for the detailed response. Last question.
What if I have the original SystenUI.odex and SecSettings.odex files that used to be attributed to them before i deodexed them? Can I simply reuse those without having to run through the adb process?
Thanks,
Didact74 said:
Great, thank you for the detailed response. Last question.
What if I have the original SystenUI.odex and SecSettings.odex files that used to be attributed to them before i deodexed them? Can I simply reuse those without having to run through the adb process?
Thanks,
Click to expand...
Click to collapse
But, you deodexed them to edit the smali files in the classes.dex right? So, no, you will need to use the new odex files that are created from the modded deodexed files you used..
If you never edited any of the smali files, then you didn't need to deodex in the first place... you only need to deodex in order to mod the smali files - everything else in the apk can be modded as is on odexed systems.
Sent from my phone's mind
Thank you very much. Can you repost the wrapper file? Its not downloading correctly.
Didact74 said:
Thank you very much. Can you repost the wrapper file? Its not downloading correctly.
Click to expand...
Click to collapse
Updated the link in Post #2 with a zip file - you need to unzip it first then move it.
Thank you.
So I am getting an error trying to re-odex. See the attached image of the error.
Weird thing is that even though I get an error it still creates the new.odex file. I triedto go through the entire process even though I was getting errors and it just got stuck on the boot screen and never loaded. Anything in my error attached raise any flags?
Thanks,
Didact74 said:
Thank you.
So I am getting an error trying to re-odex. See the attached image of the error.
Weird thing is that even though I get an error it still creates the new.odex file. I triedto go through the entire process even though I was getting errors and it just got stuck on the boot screen and never loaded. Anything in my error attached raise any flags?
Thanks,
Click to expand...
Click to collapse
Hmmm... First thing I can think of is: are all of those framework files in the bootclass path that you used actually in your /framework folder? With our A2, in ICS there are a few extra .jar files listed that were not actually on our phone, so I had to remove those from the path...
I will try to make a new odex myself and make sure that's not a standard error message... @Fall of Enosis, you recall what it spits out?
EDIT: Shoot - forgot I'm deodexed right now... will attempt later or hear back from Fall by then..
alteredlikeness said:
Hmmm... First thing I can think of is: are all of those framework files in the bootclass path that you used actually in your /framework folder? With our A2, in ICS there are a few extra .jar files listed that were not actually on our phone, so I had to remove those from the path...
I will try to make a new odex myself and make sure that's not a standard error message... @Fall of Enosis, you recall what it spits out?
EDIT: Shoot - forgot I'm deodexed right now... will attempt later or hear back from Fall by then..
Click to expand...
Click to collapse
Yes, all .jar files listed in my bootclass were located in the framework directory.
Nevermind...my mistake. I had an issue with my files not being deodexed correctly from the start. I went back and deodexed, made the edits to res and smali then odexed using the method above again and all went well!
Thanks!

[HOW-TO] Decompile ICS and above apk and jar files MANUALLY

With the number of ICS ROMs that are popping out, I imagine the majority of people are spending their time on ICS rather than Gingerbread or Froyo. With that in mind, here's a little guide on how to decompile ICS .apk and .jar files (such as the troublesome SystemUI.apk) with ease so that you can mod them to your heart's content. I assume this method will work for other versions of Android as well. Just so we understand each other, this just helps you decompile the classes.dex. If you want to decompile an entire app or jar file there are other guides for that.
NOTE: We will NOT be using ApkTool, Apk Manager, or StudioAndroid to do this. Mainly because I have had trouble in the past using those applications to decompile certain files. So, here is an ALL MANUAL way.
What you need:
Deodexed .apk/.jar file
smali.jar
baksmali.jar
7zip or Betterzip (whether you are on Mac, Linux, or Windows)
terminal/cmd (depending on what you're running)
You can get the smali.jar and baksmali.jar files from here: http://code.google.com/p/smali/downloads/list
Download these files:
Code:
baksmali-1.3.3.jar
smali-1.3.3.jar
and rename them to:
Code:
baksmali.jar
smali.jar
Now that you have both files, place them somewhere you'll remember (like a folder on your Desktop). For the purposes of this guide, my files will be in .../Desktop/ICS
Ready? Okay, here we go.​
Open up your desired ICS .apk or .jar file with 7zip or Betterzip and extract the classes.dex and move it into the directory where you have baksmali.jar and smali.jar (For example, I move the classes.dex file to .../Desktop/ICS)
Open up terminal or cmd
cd to your directory
Example:
Code:
cd .../Desktop/ICS
Type the following:
Code:
java -jar baksmali.jar -o classout/ classes.dex
This will decompile the classes.dex file and create a folder inside .../Desktop/ICS called classout where all of your smali files will be located.
Go into the classout folder and make your smali edits
Compile your classout folder into new-classes.dex by typing this into terminal:
Code:
java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
Rename new-classes.dex to classes.dex
Take your newly compiled classes.dex and put it into your ICS .apk or .jar using 7zip or Betterzip
Profit
Have fun :highfive:
Nice to have a write up on this in the Inc forums instead of having to hunt it down all the time. I've found it best to use smali and baksmali too, the apk aps were just too flaky for me.
kzoodroid said:
Nice to have a write up on this in the Inc forums instead of having to hunt it down all the time. I've found it best to use smali and baksmali too, the apk aps were just too flaky for me.
Click to expand...
Click to collapse
Yeah I've had similar experiences as well. This method was the only one that worked flawlessly for me. Hopefully it works for you and everyone else who needs to modify ICS files.
I've used it in GB to do some of the modifications to the status bar, like hide the clock. Took the better part of a day googling to actually find a write up on how to use baksmali and smali as I couldn't get apkTool or apkManager to decompile or compile classes.dex properly. Now I know where to find the instructions when I need them again.
thank you for this nice write up. It did really help me
Man you are just awesome for posting this, I have been googling how to decompile and recompile .apk's and .jar's for a couple of days and nothing has worked. This worked great the first time around and was very simple to follow. I just hope that once I am done making my editsI do not have any troubles re compiling the .jar I am working with lol.
You know it is so ironic that I found your guide here on XDA. It seems like everytime i want to learn how to do something like this I can google all day without much success on finding something that works. But when I do find something that works around 90% to 95% of the time it is here on XDA. You have got to love XDA...
T-Macgnolia said:
Man you are just awesome for posting this, I have been googling how to decompile and recompile .apk's and .jar's for a couple of days and nothing has worked. This worked great the first time around and was very simple to follow. I just hope that once I am done making my editsI do not have any troubles re compiling the .jar I am working with lol.
You know it is so ironic that I found your guide here on XDA. It seems like everytime i want to learn how to do something like this I can google all day without much success on finding something that works. But when I do find something that works around 90% to 95% of the time it is here on XDA. You have got to love XDA...
Click to expand...
Click to collapse
Yeah XDA does seem to be the go-to place for everything lol. Glad to know it worked for you
Note that you still need apktool in order to decompile/recompile XMLs and PNGs in apk files.
kong said:
Note that you still need apktool in order to decompile/recompile XMLs and PNGs in apk files.
Click to expand...
Click to collapse
Are there no other standalone command line tools for those tasks?
SifJar said:
Are there no other standalone command line tools for those tasks?
Click to expand...
Click to collapse
I would like to know that as well...
Wow, thank you very much. I'm going to have fun with this.
Sent from my Desire HD using xda premium
Thanks for the tutorial, I have successfully extracted the classes.dex but i cant seem to find where to add this code:http://forum.xda-developers.com/showpost.php?p=16485374&postcount=15 in the NotificationManagerService.smali file. I have even opened up a file that supposedly has the patch in it but could not locate it. A point in the right direction would be appreciated.
Great tutorial awesome work
Sent from my Galaxy Nexus using Tapatalk 2
i wan to edit samsungcamera.apk...
i can not find classes.dex inside this apk....
only got META_INF,res,AndroidManifes.xml and resources.arsc....
Have you decompiled it first?
Sent from my Galaxy Nexus using Tapatalk 2
Hey I made some changes in the AssetManager.smali and now I can't recompile. Getting this error Error: Unable to access jarfile smali.jar
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Cannot find file or directory "classout/"
at org.jf.smali.main.main(main.java:184)
didi1985 said:
i wan to edit samsungcamera.apk...
i can not find classes.dex inside this apk....
only got META_INF,res,AndroidManifes.xml and resources.arsc....
Click to expand...
Click to collapse
Is your rom deodexed?
Sent from my PantechP9070 using xda premium
Great guide easy to understand.
Thank you.
Reply To Thread
This is one of the best tutorial... Keep it up bro!
Help me, i can't edit .smali, because i don't understand smali,.
have any help?
like convet to java or any langgue ?

Categories

Resources