PATCHING SERVICES.JAR IN KITKAT ROMS:
Ahhh, the Nexus 6 is just about to roll out. Google is giving away all his remaining Nexus 5 phones
by updating (very generously) their replacement policy. They get rid of stockpiles of N5s and make their customers happy in one shot.
It is rumored that the new N6s and N9s will run Android L out of the box, and Google even released a developer preview, dedicated to... well, us: the enthusiasts, the programmers, the developers, the ones that don't settle for mediocrity, the ones that won't ever accept "this is the standard, take it and shut up", the ones that "why should I stay with this, when I can modify it and get it to perform better and in new ways?".
As sad as this may be, though, our loved Supercharger still didn't get an update for our KitKat builds; zeppelinrox is apparently MIA, and we are still waiting for His Return. While we were waiting, though, some people found a way to 100% supercharge android kitkat builds. This is the heart warming story of how they made it...
But first, a friendly reminder:
If you're updating your rom, be sure to have a backup.
Why, you ask? Well, first because you always have to make a backup before you change something, you fool.
"Thou shalt not update without backing up first".
Second,
If something in the new updated ROM is different from the old one (with this "something" being probably services.jar), you can't just use the old patched services.jar from your old build. You'll get stuck at boot. If this happens, you have to re-do the entire patching process using the new ROM's services.jar.
I just updated to a new nightly and couldn't get past boot logo, because I used my old patched services.jar from the old build.
So, if you find yourself in this mess, the solution is to do the entire process again.
Here is the entire KITKAT patching process, for the joy of all of you lazy people out there who like being spoon fed and cba to search (well, I don't blame you, it was kinda boring):
[GROCERY LIST]:
1: Assuming you already have notepad++ (you don't? Go get it), get the compiler and decompiler and all that stuff here, extract everything in a folder, we will call this folder "stuff".
2: Get the updated smali and baksmali here (new link as of 26 march 2016); the files that you are looking for are [[[ OLD baksmali-2.0.3.jar and smali-2.0.3.jar (as of 5 august 2014) /OLD ]]] baksmali-2.1.1.jar and smali-2.1.1.jar (as of 26 march 2016). Move these 2 files inside "stuff" and rename them as baksmali.jar and smali.jar. Yes, replace the old ones with these two.
3: Get the ROM's new services.jar. It can be found in /system/framework. Save it in the "stuff" folder.
[/GROCERY LIST]
4: Edit the 1.bat file. Change android.policy.jar to services.jar. It must look like this: "java -jar baksmali.jar -x services.jar -o classout" (from this "java -jar baksmali.jar -x android.policy.jar -o classout").
5: Run that and it will create a new folder inside "stuff", called "classout". Go to classout\com\android\server\am and open ActivityManagerService.smali with notepad++ or equivalent editor. Change the values like
gu5t3r indicates here.
It's easy to find these values.
Just copy the string above them and ctrl-f it. You will find it without too much hassle. Change the old value (should be the same as the red one) with the new green value. SAVE THE EDITS (CTRL-S).
7: Do the same with ProcessList.smali. Red values to green ones. SAVE THE EDITS! This is considerably more enjoyable (because it's SHORTER, hence FASTER).
8: PHEW! You're almost done, you just did the worst part. Now (did you save the edits?) get back to the root of "stuff" and execute 2.bat. A wild "classes.dex" file appears! Go, Pikachu, open services.jar with an archive viewer and replace the classes.dex file inside the archive with the new, patched one we just recompiled!
9: It's super effective! Now you have a fresh new services.jar ready to be thrown back at your android system. Copy it in the root of your sdcard, then run these commands,
EITHER from the terminal emulator:
Code:
busybox mount -o remount,rw /system
busybox cp /sdcard/services.jar /system/framework/services.jar
busybox chown root:root /system/framework/services.jar
busybox chmod 644 /system/framework/services.jar
busybox sync
reboot
OR if you cba to type these on your smartphone, copypaste them (and execute them in order, one by one) via windows command prompt (be sure to have usb debugging on) by running:
where " "command" " is the command that you would run in Terminal Emulator, like this:
Code:
adb shell busybox mount -o remount,rw /system
or this:
Code:
adb shell busybox cp /sdcard/services.jar /system/framework/services.jar
10: You are now aware that there was no number 6. Go on, check it. Mind blowing, isn't it? Yeah, I know, incredible. Makes you wonder about reality itself. Who knows how many hidden things you didn't notice in your life. Who knows how many things you won't notice in the future?
11: ???
12: Profit