[TOOL] Windows tool for patching services.jar for V6 SuperCharger (0.9.0.6)

Status
Not open for further replies.
Search This thread

pepcisko

Senior Member
Feb 2, 2007
838
627
Try zep's tools for the moment. Update to this one coming next week.. currently it's way outdated.

Sent from my MB526 using xda premium
 
  • Like
Reactions: mixednuts

keithpeng

Member
Mar 10, 2013
7
0
Banting
www.facebook.com
Hi, I'm new here. I'm sorry if my question sounds stupid.
So I have S3 i-9300 with CM10.1 NIGHTLY ROM. I'm trying to run the tool but it requires the phone to be in "Charge only" USB mode. I couldn't find this option. When I pull down the notification bar it only provides me with "MTP" and "PTP" USB mode. I search through the settings still got no clue how to do it. Some help please?
Thanks in advance.
 

pepcisko

Senior Member
Feb 2, 2007
838
627
MTP should be working as long you have usb debugging enabled for adb connection, although I can't test - none of my two devices support that.
Anyway - please use Zep's tool from here : http://xdaforums.com/showthread.php?t=1914159
I still didn't find time to update this one. #growls

---
requested mods to close this thread temporarily.
 
Last edited:
  • Like
Reactions: mixednuts
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 146
    temporarily "abandoned" .. please use Zep's ultimatic jar power tools instead.

    ----------------------------------------------------------------------------------------------------------------------------------------------

    I hate that Zeppelinrox's thread is being cluttered with OT questions about this.. so opening a new thread. Please post any JellyScreamPatcher.exe questions here. Thanks.
    ----------------------------------------------------------------------------------------------------------------------------------------------

    [experimental] Windows tool for patching services.jar for V6 SuperCharger

    Opening note: When replying to this post, please do not quote it!!! Or quote selectively.
    For each fully quoted reply a puppy will die somewhere in the world. If you love puppies as much as I do, you'll stop quoting long posts.. thank you :)


    ----------------------------------------------------------------------------------------------------------------------------------------------

    Code:
    #include <std_disclaimer.h>
    /*
    * Your warranty is now void.. LOL I guess you knew it already.
    *
    * I am not responsible for bricked devices, dead SD cards,
    * thermonuclear war, or you getting fired because your phone bootloops. Please
    * do some research if you have any concerns about features included in my utility
    * before using it! YOU and only YOU are choosing to make these modifications.
    * I'm providing no ETA's, though usually I'm responding PM's in a timely manner ;)
    *
    * While the tool provides some backup functionality, allowing you to roll back to
    * a working system, feel free to create a nandroid backup trying this ;)
    *
    */

    For downloads and changelog, see Post #2

    ----------------------------------------------------------------------------------------------------------------------------------------------

    Preface:

    Many of us V6 Supercharger users have been flashing nightlies nightly and dailies daily, resulting in the need for a patched services.jar almost daily :p since the automatic web patcher no longer works for Android 4.1.1 Jellybean files, we had to stick with manually patching this files as described in Zep's guide here. Eventually Zep prepared several versions of the Jelly_Scream_Smali_Patcher_Test_x.sh script, which does the job perfectly, but the user still has to get his services.jar, extract the .smali files, put them to the phone, put the script to the phone, run it in the phone's terminal, copy the patched .smali files back to the PC etc. etc. and for many of us, this is time consuming (and difficult for others). Time is money, right? :)

    Currently, this tool is using a ported version of the ALL_ROMS_Ultimate_Jar_Power_Tools-Jelly_ISCream+Maximum_MultiTasking_Mods-Smali_Patcher_Test_11.sh script for patching.

    So... here an automated workflow, which assumes a few things:

    • you are running a MS Windows operating system (tested on Win7 x64)
    • you have Java installed. This was tested with Java7, should run fine on Java 6 as well. In the Q&A section below I provide a link to download Java. Make sure that java.exe is accessible from any folder (is in PATH). Some version of Java 7 installs the binaries into the windows/system32 folder, other versions use different folders (e.g. "C:\Program Files\Java\jre7\bin"), so you need to know where the binaries are. Make sure you have that folder in your PATH. If not, just google how to add a folder to the PATH, there are many tutorials on the web.
    • [optional] you know how to connect your phone to the PC via USB
    • [optional] you have ADB drivers installed (either via Android SDK or from your phone's manufacturer)
    • [optional] you know how to enable USB debugging in your phone and did that :)
    • [optional] the USB connection mode is NOT "mass storage" (for the online mode) - please set it to "Charge only" or "None" (varies from device to device)

    Before you start:

    The following needs to be done only once. Of course, when Zeppelinrox updates his shell script, I'll be updating my tool and this guide to provide a new download file.

    1. download the 7zipped tool (single archive) to your PC . Make sure you always download the latest version (link in the changelog)
    2. extract it to an empty folder (e.g. c:/super/ .. just like in the ICS Guide) so that you get a nice folder structure like this - see explanations for the folders as well:
      Code:
      C:.
      │   JellyScreamPatcherV6_0.9.0.6.exe
      │
      ├───adb                         
      │       adb.exe
      │       AdbWinApi.dll
      │       AdbWinUsbApi.dll
      │
      ├───backup                      
      ├───cwm                         
      │       signapk.jar
      │       testkey.pk8
      │       testkey.x509.pem
      │       update.odex.zip.empty
      │       update.zip.empty
      │
      ├───dist                        
      ├───framework                   
      ├───odex                        
      │       dexopt-wrapper
      │
      ├───scripts                     
      │       deodex-pusher.sh
      │       dexopt-wrapper.sh
      │
      └───smali                       
              baksmali
              baksmali.jar
              smali
              smali.jar
              version.txt

    Before we start, I'll explain the folder structure.

    Code:
    adb       - support folder, includes google's adb tool
    backup    - this folder will include your old files
    cwm       - support folder, includes files for generating cwm compatible update.zips
    dist      - this folder will include the patched files for further processing
    framework - this is the working folder, where files will be compiled/decompiled/patched
    odex      - support folder, includes the binary for odexed ROMs in-phone final patching
    scripts   - support folder, includes files for online mode
    smali     - support folder, includes the smali/baksmali tool

    How to patch the services.jar file

    The following assumes you have a "stock" (or unchanged) services.jar in your phone's ROM or in my tool's framework subfolder .

    Note: The current version should still be considered as beta-release. While it works for me (most of the computer stuff works when I'm near it, my family has been puzzled about this since long ago.. LOL), it may not work for you. Please report any bugs you find (thread, PM) and I'll be happy to fix them. Although I inserted many "hit the Enter" prompts into the tool, it's always good to run the tool from a console so that you can keep the output in case you flash through the workflow too fast :p

    Also, the tool maintains an activity.log file where it flushes messages about what's happening. If you encounter a bug, send me this file. Please do not copy/paste the log contents into the thread!!! Attach it. Or upload to any cloud service and send me the public URL.

    Tip: When running the tool, feel free to enlarge the command prompt window vertically ;)


    After running the tool and passing the initial screen, you will be presented with a choice between online and offline mode.

    Online mode

    Online mode assumes that the phone is connected via USB. In this mode, the tool can pull all the information from the phone. Not only the files, but system variables, as well as some debug info (e.g. is the ROM odexed?)

    • Connect the phone via USB
    • Enable connection mode "Charge only" or "None". This won't work, if the phone is in "Mass Storage" mode!
    • Sit back and enjoy (and don't forget to answer the tool's questions!)
    • After patching there will be a warm reboot


    Offline mode

    Offline mode means, that there will be no interaction of the tool with the phone via USB. You need to do all the file transfers and in case of odexed ROMs, the final in-phone patching, manually. Also you will have to enter some other information into the tool manually.

    1. make sure to copy your /system/framework/services.jar to the tool's framework folder. If you have an odexed ROM (e.g. stock), copy the whole /system/framework folder contents to the tool's framework folder.
    2. make sure to know your system's version because the tool will ask for it
    3. make sure to know your BOOTCLASSPATH variable. It can be pulled from the phone using the command
      Code:
      adb.exe set | grep BOOTCLASSPATH
    4. make sure you know if the ROM is odexed or not

    After patching, you will need to transfer the patched files to the phone and perform manual patching/replacement:

    Odexed ROM:

    For odexed ROMs, there is some more patching required that you can do in the phone.

    1. copy services.jar from the 'dist' folder to the sdcard
    2. copy 'dexopt-wrapper' from the 'odex' folder to the sdcard
    3. copy 'dexopt-wrapper.sh' from the 'scripts' folder to the sdcard
    4. Make sure they are in the card's root folder !!
    5. In the phone, open Script Manager or any other app that can run shell scripts with superuser rights.
    6. Open the app, run the dexopt-wrapper.sh script. A warm reboot may occur, since the script will restart the framework
    7. Reboot to recovery, Clean Cache, Clean Dalvik Cache
    8. That's it :)

    Deodexed ROM:

    • update-signed.zip in the dist folder
      Copy this file to your sdcard, then reboot to cwm recovery and install it from there. Then do a Dalvik Cache wipe, Cache wipe and reboot.
    • services.jar in the dist folder
      You can copy this file to phone's /system/framework folder and replace the existing one. Make sure that the new file will have owner/group 'root' and permissions 644. Then reboot to recovery, clean Cache & Dalvik Cache.



    Rollback

    In case something goes wrong, there should be a message about that in the activity.log file.
    Feel free to send this file to me - either attach (not paste!!!) the file to a post in this thread, or upload it to any of the cloud services and tell me the URL. I'll take a look.

    Before patching, the tool creates backup of the files as a CWM recovery compatible update.zip file. It will sit in the backup folder. This is your way back to a working system. Of course, you can do a nandroid backup..


    So what is the tool actually doing?

    Very easy to explain.

    1. it pulls the services.jar (and odex files if needed) from your phone to the working folder (or takes an existing one that you put into the folder)
    2. it uses the baksmali.jar to decompile the services.jar/odex
    3. creates a backup of the unchanged files
    4. it runs a ported perl version (and compiled to exe) of Zeppelinrox's JellyScream patcher script (v6) to patch the .smali files
    5. it uses smali.jar to compile the new classes.dex
    6. inserts the new classes.dex back to the services.jar
    7. [optionally] it pushes the new services.jar back to the phone
    8. [optionally] for ODEXed ROMs, created services.odex from the patched services.jar
    9. [optionally] for deODEXed ROMs, it creates and signs an update.zip that can be flashed in CWM recovery
    10. collects the garbage and exits with a nice message .. LOL

    Q&A

    Q: It doesn't decompile the services.jar and complains that the .smali files don't exist !!!
    A: Yeah, probably your Java is crap. Install Java JRE from Oracle's web (http://java.com/en/download/index.jsp), it will offer you the latest version. I tested with Java 7, but latest releases of Java 6 should work as well.

    Q: Getting java errors "not recognized" "not found" and so !!!
    A: You probably don't have the java executable in the system PATH. Search the web on how to do this. Example - Java7 installs its binaries to the <system>:\Windows\System32 folder, other versions may act differently and they may have the binaries in a different folder (e.g. "C:\Program Files\Java\jre7\bin") . That folder needs to be in the PATH.

    Q: I'm getting bootloops after patching the services.jar with this tool!
    A: Make sure to Wipe Cache, Wipe Dalvik Cache and Fix permissions in the CWM recovery. ALso, feel free to send me your original services.jar, I'll take a look. If you have an odexed ROM, send me the whole /system/framework folder and the activity.log file generated while using this tool in "online" mode.

    Q: After reboot with the new services.jar file, it says "Android is upgrading" and optimizing apps, even though I did not wipe my dalvik cache.
    A: Well, yes that is expected. It will take a while, depending on how many apps you have installed.

    Q: Will my phone's memory be blazing fast and effective after this?
    A: No, you still have to run the V6 Supercharger script.

    Q: Does it run on Linux?
    A: Not yet, but it will. I need some more internal testing to release a Linux version.

    Q: Does it run on ODEXed ROMs?
    A: Yes !!!

    Q: Why is the executable so large???
    A: Blame PAR :) long story short, I wrote my stuff in Perl and used Perl to port Zep's stuff as well. Then I compiled the script to exe using the PAR::packer package, resulting in the huge executable. I know, there is another way, to use Activestate's PDK (Perl Development Kit), but the license is approx. $250 and I just don't have that money for spending on a single tool. PDK creates much smaller files (approx. 1/3rd), but for now we have to stick with what we have :)

    Q: Tool fails and in the log I see messages like "failed to copy 'C:/super/backup/services.jar' to '/mnt/sdcard/services.jar': Permission denied"
    A: Make sure the USB connection mode is other than "Mass Storage". It can be "Charge Only" or "None", really this is depending on the device you own.

    Q: Isn't there a virus included in the executable?
    A: LOL.. No. This community gave me a lot since 2007 and I have no intention to harm it in any way. If you are using NOD32 and it starts complaining about the URL to my file I posted above, let me know. ESET support is pretty quick in identifying and fixing false warnings :)

    Enjoy.. and feel free to PM me in case of any questions. I'll keep this post updated all the time.

    Thanks

    - Zeppelinrox for the V6 Supercharger and the associated scripts/tools
    - Rexstor for the ODEX guide
    - Android community for all the other tools (smali/baksmali/sign)
    - Google for Android... luv ya!!!

    If you feel like I deserve a beer for what I've done, feel free to consider donating to Zeppelinrox first as I'm just making his fabulous work a tiny bit more accessible. And if you still think I deserve a beer, you can use the button below.

    42
    downloads and changelog

    Downloads

    http://dev.pepcok.info/jellyscreampatcher/JellyScreamPatcherV6_0.9.0.6.7z

    Changelog

    0.9.0.6 [2012-09-23]

    • still using ALL_ROMS_Ultimate_Jar_Power_Tools-Jelly_ISCream+Maximum_MultiTasking_Mods-Smali_Patcher_Test_11.sh :)
    • added a proper error reporting when sdcard is not writable in online mode

    0.9.0.5 [2012-09-20]

    • using ALL_ROMS_Ultimate_Jar_Power_Tools-Jelly_ISCream+Maximum_MultiTasking_Mods-Smali_Patcher_Test_11.sh
    • multiple users with Odexed ROMs have reported this version to work. Feel free to try :)
    • with online mode, there is a framework restart after patching, causing warm reboot of the device.

    0.9.0.4 [2012-09-13]

    • using ALL_ROMS_Ultimate_Jar_Power_Tools-Jelly_ISCream+Maximum_MultiTasking_Mods-Smali_Patcher_Test_11.sh
    • Warning for odexed ROM users - proceed with cautions, many have reported bootloops (even with previous version). Investigating

    0.9.0.3c [2012-09-12]

    • patcher: Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_9.sh
    • fixes STUPID bug with storage detection (I hope)

    0.9.0.3b [2012-09-12]

    • patcher: Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_9.sh
    • storage detection, as requested by one of the users (thanks Zep for the code! :) )
    • fixes in shell scripts for online mode
    • removal of the -f flag for rm commands

    0.9.0.3 [2012-09-11]

    • patcher: Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_9.sh
    • odex: if the baksmali decompile fails (e.g. file missing, although being in BOOTCLASSPATH), the tool will create an alternate BOOTCLASSPATH based on the files that were pulled from the phone and try decompile again. It even this fails, then I guess the world will end in 2012
    • ui: revamped the whole ui, user is now selecting offline vs online (adb) mode at the beginning
    • ui: added a proper note for the user to make sure to clean cache/dalvik cache when rebooting for the first time with the new services
    • ui: added instructions for the user in offline mode (when he wants to do the final steps manually)
    • internal: added some file exists checking, online (with adb) mode works better now and is prettier :p
    • other: as always, please read what the tool says.

    0.9.0.2 [2012-09-06]

    • patcher: Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_9.sh
    • instead of using crappy adb commands, the final patching is done via shell scripts in the phone - please help me test that. I already restored my phone's system partition 4 times (since patching a GB MotoDefy+ with ICS HTC Evo services is not healthy, but necessary for my testing), all the final patching seems to work fine here. Tested for both odexed and deodexed files and my phone already hates me
    • the tool will make a backup of your original services.jar/odex file into a CWM recovery update.zip (will be in the backup folder) .. that's your way back from potential hell
    • fixed a typo in manual API level selection - thanks for catching

    0.9.0.1 [2012-09-05]

    • patcher: Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_9.sh
    • few fixes (shell user detection, trying to implement better /system rw mount )

    0.9.0 [2012-09-05]

    • patcher: Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_9.sh
    • initial support for ODEXed ROMs - alpha version. I need testers please ! Since my phone does not have any odexed ICS or JB, I was able to test with sample files from xda fellow members end-to-end, but the real full fledged experience, I can't verify

    0.8.9.2 [2012-09-05]

    • patcher: Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_9.sh
    • minor update to capture the system calls, stdout and stderr into the log, for people who have problems with java. Let's see how it works

    0.8.9 [2012-09-04]

    • patcher: Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_9.sh
    • updated adb communication
    • added proper logging
    • internal preparation for ODEX ROMs (yeah, 0.9.0 will work with ODEXed ROMs !!!)
    • added framework folder as the working folder (reduces file clutter.. LOL)

    0.8.5 [2012-08-27]

    • patcher: Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_9.sh
    • update-binary from Titanium Backup

    0.8.4 [2012-08-26]

    • patcher: Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_8.sh
    • minor fixes only

    0.8.3 [2012-08-25]

    • patcher: Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_8.sh
    • this one should work with services.jar files where the smali files don't include debug information

    0.8.2 [2012-08-23]

    • some more checks for "non-compatible" data, will provide warnings to the user in case of "incompatible" services.jar. Users seeing that message should proceed with caution until the next version. Zeppelinrox is aware of the potential problem.

    0.8.1 [2012-08-22]

    • patching based on Zep's v7 script
    • resolves patching issue with the services.jar from the Alliance 2.1 ROM for Galaxy Note (GT-N7000)
    • resolves a weird compilation error when running the executable

    0.8 [2012-08-22]

    • First public version, based on Zep's v6 patcher
    10
    FYI I added this to Post 2 of the SuperCharger thread...
    B) Equally Effective AND EASIER than A) - use the Jelly ISCream Automatic Patcher for Windows!

    This does everything that is explained in this very post - from start to finish! Yep... it does Steps 1 to 9!

    I know... it's complicated... this is what you do...

    1. Plug in your phone
    2. Run the Windows exe to patch and install services.jar!

    OK?
    8
    update 0.9.0.3

    Update

    I just uploaded a new maintenance release. Why maintenance? I'm waiting for Zep to update the Jellypatcher to v11 and temporarily I disabled the Time Killer fix in this release. So it's still based on Jelly_IScream+Time_Killer_Killer--Smali_Patcher_Test_9.sh. But read the changes to see what's new, actually it should fix the behavior for some users.

    In fact, I'm quite happy that I was able to finish this update, because it will streamline the user experience a little bit and that's important too. When Zeppelinrox releases his v11 update, I'll include it in the 0.9.0.4 pretty quickly (see? no eta given! LOL). This time it took me a fair while, due to weekend and 'helluva' workload during the first two days of this week. I certainly hope I'll be faster next time :D

    Also, I checked a couple of files from a few users who reported bootloops. Honestly - I can't tell what's wrong with these files. Patching is being done correctly on them (exactly the same results as patched with Zep's shell script) and as long as they get proper owner/group/permissions via the shell script, they should work fine. I'd like to ask users who had problems with bootloops, to clear cache/dalvik cache and fix permissions in CWM recovery when doing the first reboot with the patched services.jar/odex.

    I still have a few files to check and will do it later today, then I'll provide a "report" :)

    Changes

    • odex: if the baksmali decompile fails (e.g. file missing, although being in BOOTCLASSPATH), the tool will create an alternate BOOTCLASSPATH based on the files that were pulled from the phone and try decompile again. It even this fails, then I guess the world will end in 2012 :)
    • ui: revamped the whole ui, user is now selecting offline vs online (adb) mode at the beginning
    • ui: added a proper note for the user to make sure to clean cache/dalvik cache when rebooting for the first time with the new services
    • ui: added instructions for the user in offline mode (when he wants to do the final steps manually)
    • internal: added some file exists checking, online (with adb) mode works better now and is prettier :p
    • other: as always, please read what the tool says.

    Todo

    • fix that stupid rm -f message for "weird" versions of busybox
    • implement v11 of Zeppelinrox's patcher script as soon as released
    • update the opening post of this thread - after 0.9.0.4 . I'll post revised instructions too, with screenshots if needed.

    ok... what's missing?

    Download

    http://dev.pepcok.info/jellyscreampatcher/JellyScreamPatcherV6_0.9.0.3.7z
    5
    I just came back "online" (not counting tapatalk when I was away from the PC).
    Working on the files checking now (as my other duties allow) and an update will be released during night today (I'm in GMT+2).
    Sorry for waiting :)