[Recovery] CWM-Green w/BacksideUpdater Auto-Install

JerryScript

Daydream Believer
Mar 8, 2011
2,055
1,559
0
Visit site
Updated 05022012!
[INFO]
Introducing CWM Green Recovery V3.3
Download CWM-Green-Recovery-05022012.img
md5sum e3963b7709fe23c2ae5667e318e50d96
A ClockworkMod 5.0.2.8 based recovery for the Optimus V
With extended support for automatic installation of ROM packages
Via the BacksideUpdater
Video below! (devs see second post)
[/INFO][NOTE]
Why another recovery?
Current recoveries for the Optimus V have some built in support for automatic installation of OTA and update packages.
This has never been utilized by ROM developers for the OV, and I hope to change that
by making the process a little less scary for everyone.
Together with the BacksideUpdater, you can now quickly and effortlessly install ROM updates!
(ROM Developers see second post)

What's different?
--For manual usage by rebooting into recovery, I've added the ability to wipe cache and dalvik cache together.
(will be adding option to format boot+system+data as well)
--I've also added an option to verify a backup, use it after manually making a backup check the md5sums (sd-ext is a pain).
--For automatic installation, I've added the ability to wipe cache and dalvik cache together, and enabled
the text-gui during the auto-install process so you can see what is happening.
--There are also options for full-wipe/format+auto-install, and installing any ROM or theme zip file (even ICS).
--Based off IHO recovery source, with fix for UMS (Universal Mass Storage), so you can mount your sdcard in recovery
--Home key is the select now, no more messing with that two-stage camera key (always worried it would break)

--And of course I made it Green ;)
[/NOTE][WARN]
Do Not Flash A Radio With This Recovery!​
The radio updates are known to be dangerous and can/will brick your phone!
[/WARN][WARN]
Do Not Use ROM Manager With CWM-Green!!!
ROM Manager depends on a particular set of functions in CWM
CWM-Green may have changed some if not all of these functions!
This Could Brick Your Phone!
[/WARN][WARN]
Standard Brick Warning:
Making changes to the software and/or firmware on your phone could brick it beyond repair.
Read the stickies and all posts relevant to the actions you want to perform before proceeding.
I offer no warranty or guarantees that this will not brick your device!
[/WARN][INFO]
CWM Green Recovery Installation Instructions
Preparation: Download CWM-Green-Recovery-05022012.img and put it on your phone's sdcard
md5sum e3963b7709fe23c2ae5667e318e50d96

If you are running BACKside-IHO on your phone:
1--Open the BacksideUpdater
2--Press the menu key and select Install A Recovery
Note- with BacksideUpdater V3.2 + there is an option at the bottom of the Show All Versions popup list

Or

Simple Terminal Installation:
1-- Open Terminal and type in the following:
Code:
su
flash_image recovery /sdcard/CWM-Green-Recovery-05022012.img
2-- Reboot ;)
Note - There is a space before and after the word "recovery"
Note2- Change the path to the file to where you have it on your sdcard, example /sdcard/download/CWM-Green-Recovery-04172012.img
[/INFO][INFO]
BacksideUpdater V3.2+ Auto-Install Instructions

Beginning with version 3.2, BacksideUpdater will offer you the option to automatically install a ROM update!
No more fumbling around in recovery worried you might select the wrong option and mess up your phone!

Note 04172012 -- There is an update to BACKside-IHO with the BacksideUpdater v3.2 with Auto-Install

Note -- Only works with ROMs that have the BacksideUpdater built in (devs see second post)​

1- Open the BacksideUpdater
2a- Follow the prompts to download the latest ROM update
2b- Press the Menu key and select Choose A Zip From Sdcard -or- Show All Versions, then follow prompts to select file
2c- Press the Menu key, then press More, then Choose any ROM or Theme (skip to 5 now)
3- BacksideUpdater will verify the package file size and md5sum
4- Select Reboot Recovery
5a- Select Manual Install to reboot into recovery and manually install the ROM or theme
5b- Select Automatic Install to automatically install the ROM or theme
5c- Select Auto Install Full Wipe to automatically wipe/format+install the ROM

The phone will reboot into recovery and perform the desired operations, all automatically! ;)

Note - this is a video of V2.1, will try to get a V3.3 video up soon ;)
[YT]http://www.youtube.com/watch?v=R8d50Wn7XAo&list=PL2A986C7DD8DE2ECD&index=7&feature=plpp_video[/YT]

Note - Wiping/Formatting during Auto-Install, auto backup/restore, and verify backup, are only supported by CWM-Green.
Note2- Auto-Install has been tested and is known to work with BobZhome, IHO, and Drew's-Touch recoveries.
Note3- The video was made before I enabled the text gui in recovery that shows installation progress.
[/INFO][NOTE]
Trouble Shooting

If you have any problems using either the recovery or BacksideUpdater,
Please post here. If you had an issue with recovery, please attach this file:
/cache/recovery/last_log

In some cases, the recovery boot-command-block is picky about being written to.
If an auto-install fails on the first attempt, please try one more time before posting.

If you get a signature error, please post the build date you were attempting to install,
where you downloaded it from, it's md5sum, and last_log.​
[/NOTE]

Download CWM-Green-recovery-05022012.img
md5sum f75b2f33e3fa376f59af4d3602f41bf0

Thanks to Koush for the original CWM code base, Blarf for help in fixing the UMS bug in IHO, nijel for hitting me over the head with a brick, the CM team, the AOSP team, BobZhome, mrg666, tdm, LeslieAnn, Whyzor, gannon, tvall, and a whole lot more! ;)
 
Last edited:

JerryScript

Daydream Believer
Mar 8, 2011
2,055
1,559
0
Visit site
The BacksideUpdater is available to all Optimus V developers who would like to include a simple and worry free method in their ROMs for users to install update packages. It is a simple java based apk, but it must be built into the system due to permissions it requires (unless some wizard out there knows another way).

Basic flow:
- User opens app
-- App checks for network connectivity, and offers to open Network Settings if no connection is available
--- App downloads ROM manifest file (set in /res/values/strings.xml) and parses it
---- App checks current build date against most recent version available in ROM manifest
----- If new version is available, app offers to download it now
----- If already up to date, app notifies user, and user can use the menu to select other options
------ During download, app can show a progress indicator, or user can complete it in the background
------- Once download is complete, app checks md5sum to verify download is not corrupt
-------- If verified, app offers to reboot into recovery, or install later
--------- If user chooses to reboot recovery, app offers choice to reboot for manual install, or automatic installation
---------- If user selects manual, system reboots into recovery via PowerManager
---------- If user selects automatic installation, system writes update package location to /cache/recovery/command and reboots via PowerManager

Menu Options:
- Choose Zip From SDCard: Allows user to manually select ROM zip file, which will then be checked against the currently selected values (build date)
- Show Changelog: Shows the changelog of the currently selected build date
- Show All Versions: Shows a popup list with all the versions available in the manifest, once selected, that build date's values are loaded
- Backup/Restore: Shows options to create a nandroid backup, or restore one from the sdcard
- Install A Recovery: Allows user to select a recovery img from the sdcard to install
- Install any ROM or Theme: Allows user to automatically install any compatible zip file (even ICS)
- Exit: Fully exits the app

Once in recovery:
- If using CWM-Green-Recovery, recovery checks for /cache/recovery/command
-- If not found, recovery boots as normal
-- If found, recovery executes each line individually, then reboots to execute the next
--- Once installation is complete, recovery reboots the phone

Everything done in recovery is done automatically without any user interaction. Once the user selects Install ROM Now in BacksideUpdater, they can put the phone down and walk away for 5-10 minutes, then come back to pick up their automatically updated and ready to use phone!


Including the BacksideUpdater in your ROM depends upon the method you use to create the ROM. If building from source, it's as easy as adding the source files to the build tree and editing the make files appropriately (see below). If you create ROMs via apktool and making changes to the update zip package, you may have signature issues. The reboot permission requires system signature, which is built into the apk when building from source, but must be added after the fact if you edit update zip packages.

Building from source:
Code:
cd android/system/packages/apps
git clone git://github.com/JerryScript/BacksideUpdater.git -b gingerbread
Edit the /res/values/strings.xml manifest_url value to reflect the value of your ROM's manifest location

Edit device_thunderc.mk (or your ROM's equivalent) to add the BacksideUpdater.apk during the build:
Code:
PRODUCT_PACKAGES += \
    gps.thunderc \
    ....     .... \
    BacksideUpdater
This should allow you to build as normal with /system/app/BacksideUpdater.apk now included in your package, optimized based on your build method (ota vs bacon etc).

The manifest file Example (last two builds of BACKside-IHO):
Code:
20120409,http://www.mediafire.com/?djasvdxbgtey3ex,Synced with CyanogenMod-- Fix for quick unlock bug that prevented passwords over 8 characters from working-- Workaround for allowing more systemui elements to be themed-- Typo fixed in dalvik that caused some thread crashes-- Three fixes in webkit to prevent crashes due to garbage collection-- -- Added the ability to show or hide system icons in the status bar including wifi - 3g - bluetooth - sync - gps-- Fixed the delay bug in home key double tap to launch custom activity-- Added ability to check radio version to BacksideUpdater by long-pressing the screen,d90fc847bfc23d4d7148d4f71bdefbb4,BACKside-IHO-VM670-04092012.zip,66~
20120401,http://www.mediafire.com/?vetxl20r8dd6xdx,--Synced with CM -- fix for swiping actions that get stuck on corners -- fixes for pattern lockscreen showing battery status and pin request even if lockscreen is disabled -- option to disable ICS rotation animations are now a part of CM -- --Fixed bootanimation chooser to work with most file managers --Tweaked system icon colors to better match connected status colors --Added options to hide alarm clock and signal bars in system icons --Added easter eggs to thank LeslieAnn for the use of her build server and jcase for his work rooting the security update,ea8f3024af8061d450ac478750cd53b5,BACKside-IHO-VM670-04012012.zip,68~
The manifest file is a csv (comma seperated values) format, with each build date on a single line, with the following required details:
-Build Date in YYYYMMDD format
-Download URL
-Change Log (uses double dashes (--) to parse newlines)
-md5sum
-Download file name
-Download file size
-Block ends with a tilde and newline (~\n or ~<return>)
Generic Example:
Code:
20120417,http://www.mediafire.com/some_file,CHANGE_LOG_HERE,1324kj4b1j51h55n12q25baa,MyROM-Update.zip,68~
Stay away from most non-alpha-numeric characters, experimentation will tell if you can use a symbol or not. Experiment by changing your local copy of BacksideUpdater to use a local manifest, then change it back when releasing to your users. ;)

Note- In V3.2+, there is some left over code, you should include this as the last line of your manifest, or change the code in your repo that checks for a recovery version while building the version list to display. Will have a fix up soon, it's intended to make installing CWM-Green easier for the user.
Code:
20120417,http://www.mediafire.com/?7v3eqw64s8a47re,Changelog--new version of ClockworkMod recovery for the Optimus V--Supports BacksideUpdater Auto-Install options--Adds ability to wipe cache and dalvik-cache in one step,f75b2f33e3fa376f59af4d3602f41bf0,CWM-Green-Recovery-04172012.img,4

To Be Tested:
-- Installing as a normal apk instead of pushing to system/app
-- Pushing to system/app, then re-signing with one of the on-phone zip signers available on Google Play
-- Changing the code to rely 100% on exec, rather than using PowerManager (might not need as many permissions that way)

Updated 05022012 (see OP)
 
Last edited:

rukin5197

Well-known member
May 26, 2011
1,105
628
0
Visit site
Jerry, how would I go about adding the updater to my 'not-built-from-source' ROMs such as almost all of them? I'm sure I can just decompile it and fix it up (Although I don't have the ROM set up in Git, which I could), but is there a way to git clone and build only the apk? In an empty repository?
 

JerryScript

Daydream Believer
Mar 8, 2011
2,055
1,559
0
Visit site
F***in awesome Jerry, you rock!

Can CWM green be flashed with Joey Krims flash_image GUI?

Sent from my VM670 using Tapatalk 2

Yes, should be able to install it via any standard recovery installation method. Easiest is to put it on the sdcard and open Terminal and type in:
Code:
su
flash_image recovery /sdcard/NAME_OF_RECOVERY.img
;)
 
  • Like
Reactions: droidmyme

JerryScript

Daydream Believer
Mar 8, 2011
2,055
1,559
0
Visit site
Jerry, how would I go about adding the updater to my 'not-built-from-source' ROMs such as almost all of them? I'm sure I can just decompile it and fix it up (Although I don't have the ROM set up in Git, which I could), but is there a way to git clone and build only the apk? In an empty repository?

I'm not sure ATM, we are going to have to experiment. Attached is the latest build of the apk built in Eclipse instead of with a ROM's source. Start by trying to add it to your system folder. See if it works or you get permission issues.

I've never ported a ROM, always built from source, so we are going to have to figure this one out by trial and error. ;)
 

demoport

Well-known member
Aug 23, 2011
100
15
0
Visit site
Installed the recovery and your latest BACKside IHO build, can't wait for the format boot+system option!

As always Jerry, you rock :)
 

rukin5197

Well-known member
May 26, 2011
1,105
628
0
Visit site
I'm not sure ATM, we are going to have to experiment. Attached is the latest build of the apk built in Eclipse instead of with a ROM's source. Start by trying to add it to your system folder. See if it works or you get permission issues.

I've never ported a ROM, always built from source, so we are going to have to figure this one out by trial and error. ;)

Alright I'm trying it now!
One other thing: is the layout for this (https://github.com/JerryScript/BACKside-IHO/blob/master/legacy)
date,link,changelog,md5sum,filename,number?
 

droidmyme

Well-known member
Apr 7, 2012
824
64
0
Visit site
Yes, should be able to install it via any standard recovery installation method. Easiest is to put it on the sdcard and open Terminal and type in:
Code:
su
flash_image recovery /sdcard/NAME_OF_RECOVERY.img
;)

I wish I could. When I type this in, it returns "flash_image: file not found."

I have the flash_image.bin file in my DropBox. I just don't know where it goes.

Sent from my VM670 using Tapatalk 2
 

Forum statistics

Threads
942,898
Messages
6,916,439
Members
3,158,728
Latest member
ThatDude