[Desire HD Android Development] Dude360:
No problem :)

Right, apk installation.

Ill explain how I do my setup so you have an understanding and see how far you can actually take the ROM Cleaner ;)

Note: Its another long post!

Pre-ROM Setup

Im a stickler for Superwiping before EVERY rom. I have yet to perform an upgrade on any rom Ive used and as such I have never run into problems.

Before I flash a new rom I take 5mins or so to start updating any apps that need it through the Market, might also buy a few while Im there.

I will then backup any important data I need that isnt in the cloud, Google takes care of all of that ;)

SMS Backup & Restore and Call Log Backup & Restore for those and Ill take a titanium backup of any game progress and also any apps which take an age to re-setup (ie I have 15 ftp setups in AndFTP etc)

I dont really like backup apps like TB or MyBackup, but they do come in handy. I also NEVER backup system data, this can lead to problems when restoring on newer roms.

For apps which use internal backups such as 3G watchdog, folder organizer etc Ill initiate a manual export through the app itself.

SDCard Apps

Some apps may automatically install themselves to the SD card so I double check by going to:

Settings Applications All On SD

If any are ticked I untick and move them back to the phone.

Copy The Apps

Now everythings updated and backed up, Ill load Root Explorer and goto /data/app. This is where your installed apps reside (think 'Program Files' on Windows)

For ref, /data/data/ is where your app data is stored and what apps like TB actually backup.

Now, hit

'Multi-Select' then 'Select All' and 'Copy'

Head over to your SDCard, create a new folder and paste. It may take a while, dependent on the amount of apps you have installed.

Once finished I turn off phone and stick my SD in PC and copy over the folder of apks to my desktop.

Cleaner Zip Setup

Now, again, Im a stickler for neatness so Ill use a batch renamer to remove all the -1 & -2 from the end of any updated apps. This is purely cosmetic on my end but does help to easily identify updated apps for any reason on my next batch install ;)

As some roms install apps from the rom, ie ARHD always has updated versions of Maps, Facebook etc, Ill delete them from the folder otherwise newer versions from the rom will get overwritten by the older versions from the cleaner script.

You can check by opening the rom zip and looking in /data/app to see what apps get installed by the rom.

Now open your cleaner zip, head to /data/app and copy all the apks to the zip.

Simple as that.

Flashing & Pre Installing

When you next use the rom cleaner after installing a rom, all the apps will be 'pre-installed' and as most roms now automatically zipalign on boot, they will be nicely aligned :)

Note that it will add extra time to your first boot of a rom while this process takes place.

Jumping ROMs - The Universal Cleaner

Now, if you like jumping between roms but want to keep your apps and cleaner script the same, you can just add lines to your script.

So as I decided to try Unity last week I edited my script accordingly.

I have a section at the bottom relating to various apks, widgets and system files that only appear in Unty.

So now I can use the same script to clean a Sense 2.1 rom and also a Sense 3 rom while still having all my apps installed.

Finale

Now, it looks like a long process in writing but done once youll see how easy it is is reality. Takes about 5mins to get everything copied across to PC and in the cleaner rom :)

Extras: Framework Mods, Sense 3 Mods, Boot Anis, Themes etc

With framework mods such as those from the UOT kitchen or themes, a boot before flashing is required otherwise it (may) lead to problems such as bootloops or with regards to the Sense 3 Lockscreen, no icons on it.

If you read from the beginning of the thread youll see my battle with the lockscreen and my fight for the infamous one zip to rule them all zip lol

So, I combined all my Sense 3 mods, framework mods, custom modded apps etc into one flashable zip.

Once I have flashed the rom and run the cleaner I allow it to boot and skip all stages of the Setup Wizard.

Once the rom has loaded Ill boot straight back into recovery and flash this mod zip.

Once Ive rebooted I can then begin to setup my phone :)

In reality I can go from a full super wipe to a new rom with all apps and mods installed within 15-20mins.

Extras 2: Advanced Settings Such As OC Daemon Freqs, 4EXT Themes etc

Again, these can all be added to the zip to be flashed either before first boot or the second with the mods.

What My Personal Zips Contain

I hope with this youll be able to see exactly whats capable so far with the cleaner script!

ROM Cleaner

/data/app - 189 app apks
/data/local - android_audio.mp3 & bootanimation.zip

/sdcard/ - VOIX folder structure for callrecorder

/system:
/4ext - Recovery theme
/customize/resources/downanimation.zip
/etc:
/virtuous_oc - My OC Daemon Settings
voicemail-conf.xml - My carriers voicemail settings edited
/media/audio/ - Contains my personal collection of ringtones and notification sounds
build.prop - Edited with my personal settings

Mod Zip

/data/app/facebook.apk - My personal modded facebook

/system:
/app - All my Sense 3 mods combined as well as personal mods of rosie, gmail, mms, twitter and systemui etc etc
/framework - My personal framework-res and com.htc.resources mods
/other Sense 3 mod files

Its amazing what you can actually do with these scripts!

Patric has a few more ideas which hes gonna play with in future releases as do I ;)