Showing posts with label GUIDE. Show all posts
Showing posts with label GUIDE. Show all posts

[Guide][CWM][Root][ICS] Universal proper rooting for most ICS phones

Guide to Root your ICS phone
S2 + Samsung + not Samsung phones
No more waiting for custom kernels

This topic provides universal root methods to bypass the use of custom kernels. I took the time to write it as I was tired from waiting for a Dev to publish a custom kernel for the last firmware released. Moreover, now that CF_root thread is rarely updated, many people are asking for a new way to root their phone.

I will try here to reference most threads and ways to root your phone. Some methods will let you root as soon as you get the new ROM, no more waiting for some dev to release a kernel for you.


I will not list here custom kernels that come with root, you can find them in other threads.

As a general rule, do not forget to take extra precautions when you flash anything: ALWAYS DO A NANDROID BACKUP IN CWM



Method 1 - Recommended
Push superuser + Busybox (Now v1.20.2) with CWM



- Universal and will probably work on any ICS phone, if you have a CWM image. No longer wait for a modded kernel
- Only copies superuser and busybox, nothing else is touched
- Easy to unroot
- Flash through CWM image from stock recovery
- No Yellow Triangle
- No custom counter increased
- Stock kernel untouched


It is derived from original thread here (do not forget to say thank you to Rachmat3). I modified it to include Chainfire superSU last version + BusyBox last binary. I now added last ChainsDD superuser optional CWM_Root file
http://forum.xda-developers.com/show....php?t=1501719


Instructions:

  • Download recovery-clockwork-touch-5.8.1.5-galaxys2.zip, the last cwm touch for i9100 Galaxy S2
    For other phones, download the cwm image from here http://clockworkmod.com/rommanager
  • Put the previously downloaded CWM zip file on your external sd card
  • Download the root file:
    - CWM_Root_SuperSU.0.93_Busybox_1.20.2_Update2.zip for Chainfire SuperSU (the one that comes with CF_Root)
    - CWM_Root_Superuser_3.1.3_Busybox_1.20.2.zip if you prefer the classic ChainsDD superuser.
    I advise SuperSU for 2 reasons: it lets you unroot from within superSU application and it lets you migrate to ChainsDD superuser if you like later
  • Copy the CWM_Root_XXX.zip file you downloaded to internal or external sd card
  • Boot into stock recovery (volume up+home+power), and select "apply update from external storage". Now select the recovery-clockwork-touch-5.8.1.5-galaxys2.zip file you copied in previous step (this step gives a temporary flash that will disappear after reboot)
  • You get CWM touch recovery interface (this custom recovery is temporary, not permanent)
  • Inside CWM, select "install zip from sdcard". Now, select "choose zip from sdcard" (directs to internal sdcard) or "choose zip from internal sdcard" (directs to external sd) and point it to the attached "CWM_Root_XXX.zip"
  • It will add SuperSU or Superuser last version apk to system/app, last superuser binary (su) to system/xbin and busybox last version to system/xbin, all with correct file permissions.
  • Reboot and you get permanent root + busybox installed on your stock kernel.
  • To unroot, do the above steps and replace the file CWM_Root_XXX.zip by the attached CWM_Unroot_SuperUser-Busybox-Uninstaller-Update1.zip. It will delete superuser, su and busybox files





Method 2
CF_Root + stock kernel + [optional] Mobile Odin Free version

Here, you use an older CF_Root kernel, and flash your newer stock kernel

  • Flash the CF_Root kernel with odin
  • No stock kernels for you? use Mobile Odin free version (see below)
  • After flashing the stock kernel, root will usually stay and you will be reverted back to your stock recovery instead of CWM recovery





Method 3
Insecure Kernels + SuperOneClick + [optional] Mobile Odin Free

Not tested by me. You get superuser instead of Chainfire superSU + an older busybox
  • No insecure kernel for your ROM? Just try a kernel from same ICS version, it usually works fine for rooting
  • Flash the insecure kernel with odin
  • Put your phone on USB debugging mode (System Settings / Developer Options)
  • Launch SuperOneClick and root using auto or psneuter method. Do not use the ZergRush Exploit as it is meant for older exploited GB versions
  • No stock kernel for your ROM? Use Mobile Odin Free version (see below)





Method 4
Insecure Kernels + S2 Root - For SAMSUNG Devices

  • It will do the same as in method 3, but using a newer and better supported tool than SuperOneClick
  • You have to flash an insecure kernel, root with S2Root and flash again your stock kernel
  • It roots using Chainfire SuperSU and busybox 1.20.1 at time of posting
  • Author is a recognized developer and offers great support
  • You are still depending on author to release a custom kernel for all your new ROMs





Mobile Odin Free version
Flash your stock kernel from complete ROM file

Now that Intratech stopped releasing stock kernels in his thread, rooting using methods 2 and 3 can be a problem. In fact, you will not be able to flash your newer original stock kernel after rooting with insecure or cf_root older kernel. You can look in above lyriquidperfection thread for a stock kernel to flash in odin. But, if you do not like to wait for him to release a kernel, you can get Mobile Odin Free version

  • From your stock tar.md5 ROM file, extract the zimage file (your stock kernel)
  • Put zimage file on external sd card
  • Run Mobile Odin and specify the zimage file in kernel box like in this image:
  • Flash, you get your stock kernel and root is normally left





Mobile Odin Pro (Payed) version
Root + Flash - You should consider buying it.

With this method, you will have SuperSU from chainfire (that can be updated from market) but no Busybox.
You can install busybox from market or from attached CWM_Root_Busybox_1.20.2_Only-Update1.zip file in this thread

  • If you want to flash a full new rom, put the tar file on the external_sd. Point all boxes to the ROM tar file. Enable EverRoot option like in image below. Flash
  • If you flashed your ROM using odin and only want to root, proceed like in Example 4 above to flash only the kernel (zimage file from your actual ROM). Enable EverRoot option and flash
  • Now, install BusyBox from market or flash my CWM_Root_Busybox_1.20.2_Only-Update1.zip file with cwm to get last busybox.





Chainfire - adbd Insecure app
Getting switchable insecure kernel WITH stock kernel

One of the advantages for some people in CF_Root kernel is the insecure mode. Now, you can have insecure kernel like behavior without flashing a custom kernel. There is a magic app for that, signed Chainfire.
Thread + free download link here:
http://forum.xda-developers.com/show....php?t=1687590

And you can buy it from market to support author:
https://play.google.com/store/apps/d...chainfire.adbd

Instructions, quoted from chainfire
If you are running a stock (made by the phone manufacturer) kernel on your device, chances are adbd is running in "secure" mode, even if you are rooted. This app lets you run adbd in "insecure" mode, which gives you root access in "adb shell", allows access to system files and directories through "adb push/pull", and lets you run the "adb remount" command to make your /system partition writable.

Of course, your device must already be rooted for this to work. It may not work with "S-ON" devices and locked bootloaders.

This app does not make any permanent changes to your device - a reboot will undo any modification. That's why there is also the option to enable this feature at boot.

Note that if you have USB connected when the app activates or deactivates adbd root mode, you may need to unplug/replug the cable or run "adb kill-server" on your computer before adb will work again.




Feel free to comment or suggest enhancements

Here is a mirror, same as attachments:

Last updated downloads

recovery-clockwork-touch-5.8.1.5-galaxys2.zip
http://www.mediafire.com/?fb1xti3v1c111ul

CWM_Root_SuperSU.0.93_Busybox_1.20.2_Update2.zip (compiled binary by Stephen Stericson)
http://www.mediafire.com/?ov9anvsfaypd71p

CWM_Root_Superuser_3.1.3_Busybox_1.20.2.zip
http://www.mediafire.com/?tcuhu2khu0auodd

CWM_Root_Busybox_1.20.2_Only-Update1.zip (compiled binary by Stephen Stericson)
http://www.mediafire.com/?dx5dffhh19iamy9

CWM_Unroot_SuperUser-Busybox-Uninstaller-Update1.zip
http://www.mediafire.com/?i2olhfv08l0w355

[HOW TO][Windows] Manually Deodex For Holiday ICS

This is mod for ODEXED ICS based ROMs. When using the Dsxida's kitchen, there was a slight problem. so I made some modifications to AutoDEOTool


Manually Deodexing :

to decompil an odex file you needs the BOOTCLASSPATH..
It is a list in specific order of some framework .jar files..
It is different in function of the APKs

Run AutoDEOToolMain.bat

1.Place the JARs and corresponding ODEX files in the directory "_framework".
Otherwise, place deodexed framework JARs into the directory "deodexed_JAR".
2.Place the APKs and corresponding ODEX files in the directory "_app".
3. To deodex framework files
-For non standard odex however a specific bootclass path must be defined..
-select to 6
place the bootclass path for framework

Code:
core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:widget.jar:android.policy.jar:services.jar:apache-xml.jar:HTCDev.jar:HTCExtension.jar:com.htc.framework.jar:filterfw.jar:com.htc.android.bluetooth.jar:com.htc.fusion.fx.jar:wimax.jar:com.orange.authentication.simcard.jar:com.htc.android.rosie.jar
4.To deodex APKs files for at&t vivid
-select to 4
place the bootclass path for APKs files

Code:
am.jar:android.policy.jar:android.test.runner.jar:apache-xml.jar:bmgr.jar:bouncycastle.jar:bu.jar:com.android.future.usb.accessory.jar:com.android.location.provider.jar:com.cequint.platform.jar:com.discretix.drm.api.jar:com.google.android.maps.jar:com.google.android.media.effects.jar:com.google.widevine.software.drm.jar:com.htc.android.bluetooth.jar:com.htc.android.rosie.jar:com.htc.framework.jar:com.htc.fusion.fx.jar:com.htc.htcSceneManager.jar:com.htc.lockscreen.fusion.jar:com.htc.sunny2.jar:com.orange.authentication.simcard.jar:com.qik.enabler.jar:com.scalado.caps.jar:com.scalado.util.ScaladoUtil.jar:core.jar:core-junit.jar:ext.jar:filterfw.jar:framework.jar:HTCDev.jar:HTCExtension.jar:ime.jar:input.jar:javax.obex.jar:modemwarmup.jar:monkey.jar:pm.jar:services.jar:svc.jar:widget.jar:wimax.jar

4.To deodex APKs files for velocity
-select to 4
place the bootclass path for APKs files

Code:
am.jar:android.policy.jar:android.test.runner.jar:apache-xml.jar:bmgr.jar:bouncycastle.jar:bu.jar:com.android.future.usb.accessory.jar:com.android.location.provider.jar:com.discretix.drm.api.jar:com.google.android.maps.jar:com.google.android.media.effects.jar:com.google.widevine.software.drm.jar:com.htc.android.bluetooth.jar:com.htc.android.rosie.jar:com.htc.framework.jar:com.htc.fusion.fx.jar:com.htc.htcSceneManager.jar:com.htc.lockscreen.fusion.jar:com.htc.sunny2.jar:com.orange.authentication.simcard.jar:com.scalado.caps.jar:com.scalado.util.ScaladoUtil.jar:core.jar:core-junit.jar:ext.jar:filterfw.jar:framework.jar:HTCDev.jar:HTCExtension.jar:ime.jar:input.jar:javax.obex.jar:modemwarmup.jar:monkey.jar:pm.jar:services.jar:svc.jar:widget.jar:wimax.jar

Credits and thanks goes to:
xavierjohn22 auto DEODEXTOOL
XDA-Developers
Football
Too many people
The 'No Idea' Blog
via

Attached Files
File Type: rar AutoDEOTool_ICSForHoliday.rar -  (7.70 MB, 769 views)

[GUIDE] The Noobs Guide to Android ROM'ing

Work in progress..

Now the purpose of this guide is only one, to guide you through “cooking” your own stock flashable ROM from a shipped ROM… That’s it. It’s not hard but it does help you start the journey of the real dev work. There are to many "Devs" around that just do something like this guide and copy files from other ROMs to theres, And this DOES NOT make you a Developer so please dont go posting stock deodexed ROMs everywhere and call yourself a Developer

Before starting I’m going to assume you have setup the correct ADB Drivers for your device although not really needed to make a ROM, it does make it easier in the long run.
Once you run through this guide you will have a stock ROM with ROOT permissions, DeoDexed, Zipaligned, Busybox and init.d support. From there you can modify your ROM to your hearts content, all this is doing is making your base. The real Dev work is .smali editing, modifying .xmls making your own apps, etc... This guide will just help you to not rely on other members to release "Stock deodexed ROMs"


Wording:

ROM = An Android Operating system
Cooking = Making your own ROM
Shipped ROM = A Stock ROM for your device, e.g. a RUU.exe etc…
Kitchen = The Dsixda’s ROM Kitchen
ADB = Android De-Bugging
CWM = Clockwork Mod Custom Recovery
zImage = Kernel controls CPU, Battery etc.
Modem/Radio = Controls cell signal, internet etc.
ROOT = ROOT Permissions, access to the ROOT or / of your device, kind of like the Windows folder on your computer.
DeoDexed = Removing the .odex files from a ROM to allow for .apk customizing e.g. Theming etc..
.apk = Android application file
Init.d = Allows the running of scripts such as Memory tweaks and SD-Card tweaks etc.
SU = Superuser
CMD = Windows Command Prompt
MOD = Modification
ADB Short codes that may be helpful later:

Type these directly into your CMD window with your device plugged in.

adb reboot recovery = Reboots your phone straight into recovery mode
adb reboot = Reboots your phone
adb push = use this to push files to your phone, make sure you are in the folder with the file you want to push in CMD (Example, adb push c:\android\SystemUI.apk /system/app)
adb logcat = Tells you what your phone is doing.
adb remount = Remounts the partition specified (Example, adb remount /system)


Note 1:

When making a ROM the overall concept is the same for every device that runs CWM or any other custom recovery. The only main difference is extracting the files you need from the Shipped ROM
Note 2:

It makes it easier to have a shortcut to your kitchen folder and any others you need in your favourites or dektop


Part 1. Setting up the “Kitchen”

Go to THIS FAQ and choose the method you prefer to install on. If you are running Windows I recommend the Cygwin way. It’s easier and you don’t need to keep booting between Linux and Windows, You don’t even need Linux if you do it the Cygwin way. And please do get the pictorial guide HERE, it helps A LOT for “noobs” and don’t forget to install the Java JDK if you do Windows Option 1. Keep in mind that doing it on Ubuntu IS much faster.

NOW IF Cygwin is to difficult for you, just download Ubuntu and install it next to windows.


Part 2. Extracting the files you need.

There are a few different ways you can do this, the main ones are:

For HTC Devices
  1. Get a RUU.exe from the internet for HTC Devices and extract the system.img and boot.img
  2. Download the RUU and run it on Windows, proceed until you get to the screen with the picture of the phone, see bellow. – (No you don’t need to plug your phone in)


  3. Open your Start Menu on Windows
  4. In the Windows 7 search bar type %temp% and hit enter
  5. In the folder that opens click in the search box in the top right corner and search ROM.zip
  6. Drag ROM.zip to your desktop, open and extract system.img and boot.img to your desktop.
________________________________________________

For ANY Android Device (Or if you cant get them any other way)
  • Using a backup of a stock ROM, This way gives you the ability to make a ROM from pretty much any device that has CWM installed.
  • Taking the system.img and boot.img from the backup folder
________________________________________________

For Samsung Devices:

Extracting the following from a Samsung Shipped ROM
  • factoryfs.img (and optionally: cache.img, zImage, modem.bin)
  • TAR file containing factoryfs.img (optional: cache.img, zImage, modem.bin)
  • ZIP file containing factoryfs.img (optional: cache.img, zImage, modem.bin)

Any of these above methods can be used and the extracted files placed in the ORIGINAL_UPDATE folder of the kitchen in the next step. If your device is not compatible with these methods check the device list in this THREAD for more guides.



Part 3. Setting up the working folder.

Now we have the files needed to make our ROM let’s get to it!
  1. Go to your kitchen folder then the original_update folder and place your files in It
  2. Start the kitchen by starting Cygwin and typing cd kitchen then ./menu
  3. Hit option “1. Setup working folder from ROM” press enter again
  4. Select the option you want from the list e.g. “(1) system.img and boot.img
  5. Rename the folder if you wish but it doesn’t matter, hit enter
  6. If you are working from system.img and boot.img you need to run through the extraction process in next step. Most new ROMs use an EXT4 file system so if you are unsure just hit option “2 – Run Ext2Explore (EXT3/EXT4)” and follow the instructions in the Cygwin window (If you are just using a .zip or .tar etc. you don’t need to do this step.)
  7. When that’s finished hit “3 – I’m finished unpacking / abort
  8. Finally hit Y to see you working folder details once its run through the process.



Part 4. Add the options you want to add

A good thing to do now is, keep it simple. The kitchen is best to use only for making your ROM base, once you have the .zip file most customizing can be done from there unless you need to edit the boot.img etc. but we are not going to get into that in this guide.

Now, we are going to make a simple ROM base optimized for speed and functionality. Follow the next steps and by the end you will be ready to build the ROM.
  1. The most obvious of all, we will add “ROOT Permissions”. So choose option 2.
  2. Always stick with Chains method so hit option F, this won’t take long at all, wait for it to finish the press enter to continue.
  3. Next add Busybox with option 3, hit Y to continue and enter when finished.
  4. Most people disable boot sounds (option 4), I usually just do it later if I choose to.
  5. Don’t worry about Zipaligning because we will do it when we build the ROM.
  6. Next choose option 0 for advanced options.
  7. If you ROM isn’t already DeoDexed choose option 11
  8. If you wish you can backup both folders but I usually don’t bother.
  9. Then select option B to Deodex BOTH folders, this one will take some time, on an HP Laptop core2duo with 4gig of RAM takes about 15 minutes.
  10. Now add /data/app functionality so choose option 13 and select Y to continue, This allows you to move apps from the system folder to your /data/app folder before the install, which in turn allows the end user to uninstall the apps if they wish. This can ONLY be done with certain apps, like apps you get from the market.. YouTube, Google Maps, Twitter etc. DO NOT put dependent apps like SystemUI.apk etc in the /data/app folder.
  11. Next add the Nano text editor on option 14
  12. Next add Command Shell or “Bash” with option 15
  13. Next add init.d support with option 17 to allow the running of init.d scripts, sometimes you may have to manually add the init.d folder to your ROM at the end or before build, either way it doesn’t matter.

Now we are ready to build the ROM and flash it. Understand that all these are optional, if you want to you can just deodex the ROM and go straight to option 99 and build the .zip file. This is just what I recommend you do

  1. Next go to option 99 when you’re ready to build your ROM.
  2. For now you will choose option 1 “Interactive Mode
  3. When it asks you to Zipalign your .apk’s you can now choose Y and it will quickly run through and Zipalign all the .apk’s in your build.
  4. Once finished, it will start building you ROM.zip file this may take about 5-10 mins on a slow computer or if your CPU is busy already.
  5. When that’s finished it will ask you to either continue with the updater-script or not, this is always a YES for you guys, so hit Y and move on.
  6. Now we need to Sign our ROM, this is always a YES also
  7. The final step is to either rename your ROM or not, it doesn’t matter if you do it now or just rename the .zip file later, so do what you wish and hit enter.
  8. Congratulations you have made your first ROM! You can now backup your current setup in CWM and flash it from your SD-Card, be sure to do a full wipe if it’s the first time and install it.

Note 1:

Sometimes you may get an error and CWM wont flash it, USUALLY this is because the kitchen has screwed up the updater-script but this doesn’t often happen. If it does take one from another ROM on the SAME DEVICE (<< IMPORTANT) and add it to your ROM.
Part 5. Further Mods and tweaks:
Resources:

via 

[HOW TO][Windows] Manually Deodex and Odex back

The purpose of this thread is to give basics to manually deodex and odexing back framework and apk files

Credits and Thanks to :
jubeh
Decad3nce
software_samurai
JKay
LeoMar75

and many others I forgot
Theory :

WHAT IS AN ODEX FILE?

In Android file system, applications and framework files come in packages with the extension .apk or .jar. These APKs or JARs contain certain .odex files whose supposed function is to save space. These ‘odex’ files are actually collections of parts of an application that are optimized before booting. Doing so speeds up the boot process, as it preloads part of an application. On the other hand, it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution.

THEN COMES DEODEX

Deodexing is basically repackaging of these APKs or JARs in a certain way, such that the .odex files are reassembled into classes.dex files directly integrated inside the APKs or JARs. By doing that, all pieces of an application package are put together back in one place.
For now, we need Baksmali.jar and Smali.jar to deodex, it seems these tools are not perfect and it seems to be why deodexed stock browser is laging/freezing.
This is the reason why there is a return to odexed customROMs

Prerequisites :

You will need these files :

* backsmali.jar
* smali.jar
* custom java.awt.jar
* dexopt wrapper
* recent version of busybox
all included in the attached .zip (end of post)

You will also need :

* your GS2
* with the official odexed firmware you want to mod
* rooted and with root explorer (pay app but really usefull) and with CWM recovery (better )
* ADB installed and working in su (#)
* copy dexopt-wrapper in /system/bin/ and giving it 755 permissions (using root explorer or command: chmod 755 /system/bin/dexopt-wrapper
* optional (if errors during odexing back) overwrite installed busybox with the one included here in /system/xbin/
You have to know :
* even on stock firmware (odexed) there are some deodexed .apk (like framework-res.apk in /system/framework/ and like some .apk in system/app/)

Tip on Windows "Vista / 7" : open a CMD prompt in a specified folder

1. Select the folder you want to open in the command prompt
2. Right-click on it while holding the Shift key
3. Select Open command window here


Manually Deodexing :

theory :

to decompil an odex file you need Baksmali.jar and you needs the BOOTCLASSPATH
BOOTCLASSPATH is a list in specific order of some framework .jar files

** To decompil and re-odex back .odex from JAR file you need to use the BOOTCLASSPATH specified in the init.rc file located in the root folder of your GS2 : (open init.rc with notepad ++)

Extract of I9100 init.rc :
export BOOTCLASSPATH /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

** To decompil an .odex from APK file, BOOTCLASSPATH is different in fonction of the APKs, so the lazy way is to include all the .JAR files of the framework folder
2 applications : Emails.apk and MobilePrint.apk needs one more custom java.awt.jar

1/ put in the same folder :

* apk to deodex
* all system/framework files
add :
* custom java.awt.jar
* baksami.jar
* smali.jar
* zipalign.exe
2/ open CMD prompt in this folder (see above for how to)

3/ Deodexing Framework file (I will take android.policy.jar for example) :

* BAKSMALI of the android.policy.odex :

Code:
java -Xmx1024m -jar baksmali.jar -c :core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar -x android.policy.odex
* This create an out folder. You can now modify some files (like adding Advanced power menu)

* SMALI the /out folder in a classes.dex file :

Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
* finally deodex your android.policy.jar :

open android.policy.jar with 7zip without extracting
push the classes.dex created in the 7zip window in the root folder
close the 7zip windows and here is your deodexed android.policy.jar

4/ Deodexing APK in system/app (I will take SystemUI.apk for exemple) :

* BAKSMALI of the SystemUI.odex :

Code:
java -Xmx1024m -jar baksmali.jar -c :am.jar:android.policy.jar:android.test.runner.jar:bmgr.jar:bouncycastle.jar:com.android.location.provider.jar:com.google.android.maps.jar:com.samsung.device.jar:com.yamaha.android.media.jar:core.jar:core-junit.jar:ext.jar:framework.jar:ime.jar:input.jar:java.awt.jar:javax.obex.jar:libvtmanagerjar.jar:monkey.jar:pm.jar:sec_feature.jar:seccamera.jar:sechardware.jar:secmediarecorder.jar:services.jar:sqlite-jdbc.jar:svc.jar:twframework.jar -x SystemUI.odex
* an out folder is created. You can modify the files inside if you want.

* SMALI the /out folder in a classes.dex file :

Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
* finally deodex your SystemUI.apk :

open SystemUI.apk with 7zip without extracting
push the classes.dex created in the 7zip window in the root folder
close the 7zip windows and here is your deodexed SystemUI.apk
* extra step for APKs : zipaplign of your new deodexed SystemUI.apk
--> In the same CMD prompt windows, type :

Code:
zipalign -v 4 SystemUI.apk zip_SystemUI.apk
A zip_SystemUI.apk file is created. Delete your deodexed SystemUI.apk and rename zip_SystemUI.apk in SystemUI.apk



ODEXING BACK :

the theory :

*You will need to copy the (custom) deodexed file (.jar or .apk) in the system/framework/ folder of your phone.
*You will use dexopt wrapper (already copied in your phone) to obtain a new .odex file (patched_android.policy.odex for example)
* You will copy the signature of original .odex file to patched.odex file - if not, the phone won't boot ...
How To :
1/ backup your original files (apk jar and odex) to /sdcard/Mod/
2/ copy modified deodexed files (.apk and .jar) in /system/framework/ of your GS2

Now we are going to odex back

3/ open a CMD prompt in the folder of adb.exe (usualy /android-sdk-windows/platform-tools/)
4/ type command :

Code:
adb shell
su
## for .JAR file :
dexopt-wrapper /system/framework/XXX.jar /system/framework/patched_XXX.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

response must be :
--- BEGIN '/system/framework/android.policy.jar' (bootstrap=0) ---
--- waiting for verify+opt, pid=7194
--- would reduce privs here
--- END '/system/framework/android.policy.jar' (success) ---

## for .APK file :
dexopt-wrapper /system/framework/XXX.apk /system/framework/patched_XXX.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
--> This will create the patched_XXX.odex file

Now we need to copy signature from original .odex file to patched .odex file cause Dalvik need files signature integrity in order to boot.

5/ always in the same CMD prompt windows :

Code:
# if not already done ...
adb shell
su

# copy the original .odex and .jar in system/framework (not .apk) :
cp /sdcard/MOD/original.XXX.odex /system/framework
cp -f /sdcard/MOD/XXX.jar /system/framework # where XXX.jar is the original odexed .jar

# give all permissions to XXX.odex files :
chmod 777 /system/framework/original.XXX.odex
chmod 777 /system/framework/patched_XXX.odex

# copy signature :
busybox dd if=/system/framework/original.XXX.odex of=/system/framework/patched_XXX.odex bs=1 count=20 skip=52 seek=52 conv=notrunc

response must be :
busybox dd if=/system/framework/original.XXX.odex of=/system/framewor
k/patched_XXX.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
20+0 records in
20+0 records out
20 bytes (20B) copied, 0.002042 seconds, 9.6KB/s
Now the signature is copied over the patched_XXX.odex

Notice :
a - if you don't have response after busybox dd command : busybox is not installed or you have a to old version, use the busybox included in the attached .zip
b - if you don't have the last response line : 20 byte
 via
Attached Files
File Type: zip all_for_deodexing_reodexing new.zip -  (5.38 MB, 3274 views)

Open Panel

Blogroll

counter