[Desire HD General] Roberto_Lim:
Creating a return to stock flashable zip

I do not have any background in programming or engineering. Editing scripts is something I realized I could do after reading through the thread on the LeeDroid ROM.

I had been using apps to adjust voltage levels of the processor, and the settings would not stick past reboot. LeeDroid's post showed me how I could adjust "vdd_levels" in a different way: by editing a file in the system/etc/init.d setting of your phone.

I started by manually editing files using Root Explorer. The new settings would take effect on reboot. I recommend that you edit using editor in an Android app designed for the purpose, like Root Explorer. Editing Android text files with Windows notepad could remove UNIX coding.

Of course, a bad edit could result in a phone which would not boot or enter into boot loops. So if you plan to do this I recommend that you first create a return to stock zip.

If you have a zip which would restore the stock zip file that you plan to edit, at worst a bad setting creates a problem that can be fixed by a simple battery pull, and flashing the return to stock file.

So lets learn how to create a flashable zip with a return to stock file.

The file that needs to be edited for setting and tweaking governors and clocks speeds is normally:

1. 01sysctl

2. 07sysctl

3. 00start

4. Something else :silly:
​

A have created a blank template which you can edit and which you should download and edit as part of this tutorial.

DOWNLOAD THE ATTACHMENT (having dinner. feeding dog. will upload it after) .

1. After you download the attachment, unzip and lets start editing the files inside.

2. Open the folder returntostock-template and you will see two folders:

META-INF

system

3. First lets copy the file to plan to edit into the /returntostock-template/system/etc/init.d folder.

If you are planning to edit the system/etc/init.d/01sysctl file, copy 01sysctl and paste it in

/returntostock-template/system/etc/init.d/

When you flash the zip you are creating the contents of /returntostock-template/system/etc/init.d/ will be flashed into /system/etc/init.d/

4. No, go into the META-INF folder.

5. Open the file called CERT.SF with a text editor. It should looks something like this:

I highlighted in bold the line you may have to change. If you are editing the 01sysctl file than you can leave it as is. If you are editing the 00start file you can change the line to read:

6. Next, open the file called MANIFEST.MF. It should looks something like this:

I highlighted in bold the line you may have to change. If you are editing the 01sysctl file than you can leave it as is. If you are editing the 00start file you can change the line to read:

7. THIS LAST STEP IS OPTIONAL, BUT IT IS NICE TO PERSONALIZE YOUR WORK. Next, go into the com folder, and than the google folder and finally the android folder.

8. Open the file called updater-script with a text editor. What you should see should look like this:

You can change the NAME OF ROM HERE to anything you like. It will be displayed when the script is flashed.

9. Okay, were almost done. You can rename the folder to returntostock-template to something which will remind you what it is like CoolICSROM-returntostock or anything else you like.

10. Zip the file, and it is ready to use.

Now lets make another flashable zip, this time to set a new default governor.