[Defy General] rootdefyxt320:
Defy XT535 Permanent CWM/2nd-init

Hey, I have found a sh hijack in the init.rc files. I extracted the SBF and and I reviewed the init.rc of Defy XT535. There was an exploit Motorola left and it is called loggerlauncher. It is also the same exploit in the Fire XT530 to boot into 2nd-init. I don't own a XT535 but I have tried it on my Defy Mini (using the Defy Mini CWM 6 of course) and it works. :)

What is 2nd-init?

2nd-init lets you boot into custom init.rc scripts and custom recoveries such as CWM, TWRP therefore letting you to use and flash custom ROMs such as Cyanogenmod, AOKP, AOSP ROMs. 2nd-init DOESN'T let you boot custom kernels or unlock the bootloader. 2nd-boot is the one that lets you boot custom kernels but the there are no sources to compile 2nd-boot kernel for Qualcomm Chipsets. 2nd-init runs from the /system partition therefore it is impossible to brick your phone. Remember the bootloader and the recovery partition is locked out and signed so we have to run custom recoveries from the internal memory. It is IMPOSSIBLE to hardbrick your Defy XT535.

More information can be found at: http://cvpcs.org/blog/2011-06-14/2nd-init._what_it_is_and_how_it_works

Why do we have to use 2nd-init?

The Motorola Defy XT535 bootloader is locked so we can't flash custom kernels and recovery. This is when 2nd-init comes into play. It loads up before the Android system loads therefore letting you to boot into custom init.rc scripts and a custom recovery to flash ROMs, make nandroid backups and etc.

I have made a CWM 6 version for the Defy XT535.

Requirements:

- Make sure phone is rooted

- Make sure you have USB Debugging enabled

How to install CWM and 2nd-init for Defy XT535 on Gingerbread (Android 2.3.7):

1. Extract the zip file making sure all the files in the same place.

2. Enable USB Debugging by going to Settings -> Applications -> Development -> USB Debugging and check the box.

3. Double click on the file named Runme.bat.

4. Don't disconnect phone until it says '[*] 2nd-init and CWM Recovery installation complete!'

How to install CWM and 2nd-init for Defy XT535 on Ice-Cream Sandwich (Android 4.0.4):

1. Extract the zip file making sure all the files in the same place.

2. Enable USB Debugging by going to Settings -> Developer Options -> USB Debugging and check the box.

3. Put phone in Camera Mode by going to the Notifications bar, select USB Mode and select Camera Mode.

4. Double click on the file named Runme.bat.

5. Don't disconnect phone until it says '[*] 2nd-init and CWM Recovery installation complete!'

How to Load CWM recovery on Defy XT535:

1. Press Volume Down before the soft key lights load up.

2. Use volume keys to navigate and power button to select options.

3. To load CWM select Recovery then Custom Recovery and it should load up your desired recovery.

How to boot into 2nd-init:

1. Press Volume Down before the soft key lights load up.

2. Use volume keys to navigate and power button to select options.

3. To boot into 2nd-init select Boot, then select 2nd-init.

4. To boot into stock select Boot, then select Stock.

Known issues:

2nd-init:

- adb shell not working

- Can't download apps in Google Play

To restore nandroid backup use this command:

adb reboot bootloader

fastboot flash system system.yaffs2.img

fastboot flash userdata data.yaffs2.img

CWM 6 (CWM 6.0.3.2):

- Asks to disable recovery flash when selecting 'Reboot system now'. Make sure select no or you will soft brick your phone!

- Maybe Nandroid Restore issues.

Credits:

- Skilax_CZ for inventing 2nd-init.

- Aweosomeabhjeet for bootmenu and the sh hijack of loggerlauncher.

- Enox.co for CWM 6.

NOTE: Make sure you delete the folder /system/bootmenu and the file /system/etc/init.d/97bootmenu (if there is one) by using a file manager such as ES File Explorer, Root Explorer before using the installer!

If there are any issues please report to me.

NOTE: I have attached a fixed script in the attachments please delete the old Runme.bat file and replace with the new Runme.bat from the zip file. This script is universal for GB and ICS.