[Nexus 4 General] droid_legacy:
Some words about my little Script:

I would describe myself as a flashoholic and kinda perfectionist.

I try a lot of different Roms and to get the best results I always want to start from scratch and have a clean base for the new Rom.

So I decided to write a little script that automates the process for me. :lazy:​

Based upon: Android 4.3 AOSP (JWR66Y)

There will be different versions

:

For all versions: THIS WILL WIPE YOUR USERDATA! Make sure you have a backup!

1. Coming from a 4.2 rom:

- flashing latest 4.3 bootloader

- flashing latest 4.3 radio

- formatting system partition

- formatting userdata partition

- formatting cache partition

- flash stock boot.img

- flash stock recovery.img

- write original factory system partition to the device

- write original factory userdata partition to the device

- write original factory cache partition to the device

- again formatting system partition

- again formatting userdata partition

- again formatting cache partition

Now you have a complete "empty" device ready for every new 4.3 Rom.

Your device WON'T boot up until you flash a Rom in Recovery or via fastboot!

Download

2. Just clean install (already 4.3):

- formatting system partition

- formatting userdata partition

- formatting cache partition

- flash stock boot.img

- flash stock recovery.img

Your device WON'T boot up until you flash a Rom in Recovery or via fastboot!

Download

3. Clean install for paranoids ;) (already 4.3):

- formatting system partition

- formatting userdata partition

- formatting cache partition

- flash stock boot.img

- flash stock recovery.img

- write original factory system partition to the device

- write original factory userdata partition to the device

- write original factory cache partition to the device

- again formatting system partition

- again formatting userdata partition

- again formatting cache partition

Your device WON'T boot up until you flash a Rom in Recovery or via fastboot!

Download

Instructions:

- Download file

- Unpack it (using e.g. 7zip or WinRar)

- open the folder

- put your device into fastboot mode by either chosing it in your reboot menu or by powering off the phone and then

push and hold Vol+, Vol- and the power button until you are in fastboot mode

- connect the device to your PC

- execute the "make_it_happen.bat" in the folder

- hold on tight! Your device will reboot a few times during the process (don't worry)

- enjoy fresh and empty Nexus 4. :D

Note:

This is ONLY for the Nexus 4! Don't try it with other devices! It won't work.

You can easily replace the included files with e.g. your prefered kernel (boot.img) or your prefered recovery (recovery.img).

Just extract the *.zip and replace the files! (Be careful with the spelling.) This might save you some time if you always want to start from the same fresh base.

Going to release a version that lets you decide which version you want to use or what you want to flash/erase/format. -> Kinda AiO Version of this little script.

If people are interestes in it, I might release a version of this script that lets you revert to either AOSP stock or Google Factory Image stock (both bootable) without wiping partitions after the flash. (Of course CLEAN.)

At the moment these versions are in order you are directly going to flash a custom rom to your device. Just tell me.

Thanks to:

Google for their factory Image.

franciscofranco for his precompiled AOSP source