[Nexus S Android Development] ahbeng:
This Finalizer zip is meant to be flashed right after any ROM/Kang and kernel. (More tailored for CyanogenMod-based ROMs at the moment, but I had one specially for MIUI in the past, just need to update it. It will work for MIUI, just that it will not remove some MIUI crud.) I have been using and adding to it for the last few months, and just cleaned it up to be more suitable for release.

It is designed to be customized, and roll up everything needed to be done post-flash into one zip. It has been a lifesaver to me as a crack-flasher, using TWRP I can automatically reboot after flashing, so I can just flash my ROM, kernel and Finalizer all together and I'm set.

I take no credit for anything in it except for its organization and my experience testing what can be safely removed over the past few months. I just compiled it into a more standardized framework with instructions, so that anyone can learn how to modify it to their needs, even if they were not aware of what updater-scripts could do before.

What it can do (or not, if customized)

Wipe dalvik cache

Remove unnecessary APKs/files (I've listed >50 but you might not want to remove all of them)

Copy custom APKs, tweaks, init.d scripts, fonts, sounds, ringtones, etc. to /System (the included files are just examples, I've included ad blocking host file, Roboto font, some ICS sounds and updated Superuser/su binary)

Every change is confined to /system so if it removes more than you want, just flash ROM/Kang again and everything will be restored. Then you can modify it to remove less. :p

Instructions

Unzip and customize. (I have tried to strike a safe balance for removal defaults so that most users will not have to comment/uncomment too many lines but you will likely want to customize it at least a bit.)

The most important file: META-INF/com/google/android/updater-script

Open in a text editor (not windows notepad) and you will see what is attached in the code listing below.

A '#' serves to comment out everything following it in the same line. Comment out or uncomment lines as needed in the removal section according to what you need. The rest of the file should be fine as it is, but you may want to edit the Messages section just for cosmetic reasons.

Notes for the rest of the files:

.nomedia - I often unzip, edit and rezip the folder on /sdcard so I do not want the files inside to be picked up by the media scanner

system/app - I included the Superuser.apk from Market as it is newer than in current Nightlys, other ideas: stock/alternative launcher, newer Market, brut.all google maps

system/etc/init.d - put your favorite init.d script tweaks here, every rom/kernel has their own so I didn't include any by default (note: zipalign on boot no longer has much use as every app has been automatically zipaligned nowadays)

system/etc/hosts - to block ads, I've included the latest compiled by AdAway

system/etc/gps.conf - edit as per here to get faster fixes

system/fonts - I've included Roboto, but there are many font threads around, if they come in a zip just extract the .ttf's and replace the font files here

system/media - put bootanimation.zip here, and your custom sounds/ringtones in the corresponding folders. I included some ICS ones for starters

system/xbin - replace su binary there if a newer one comes out, but I'll try to keep it up-to-date

Rezip META-INF, system and .nomedia. Open zip and make sure it contains them directly and not in an enclosed folder.

Enjoy your sleek customized ROM!

Comments, ideas and suggestions would be really appreciated, tell me too if your default preferences disagree with mine, I plan to release several versions in the future, like a version for more experienced users that does not come with default files and another one which does not remove anything by default.

Current META-INF/com/google/android/updater-script:

###Mount /data and /system partitions
mount("ext4", "EMMC", "/dev/block/platform/s3c-sdhci.0/by-name/userdata", "/data");
mount("ext4", "EMMC", "/dev/block/platform/s3c-sdhci.0/by-name/system", "/system");

###Wipe dalvik cache
delete_recursive("/cache/dalvik-cache/");
delete_recursive("/data/dalvik-cache/");

###Remove unnecessary files
delete(
##Not needed after first boot
"/system/app/OneTimeInitializer.apk",
"/system/app/Pacman.apk", #Market apps installer
"/system/app/Protips.apk", #Home screen tips widget
"/system/app/Provision.apk",
"/system/app/SetupWizard.apk",

##Default apps which may be replaced by alternatives
"/system/app/ADWLauncher.apk",
"/system/app/BooksPhone.apk", #Google Books
#"/system/app/Browser.apk", #Needed for Google Voice Search, Talk and Voice
"/system/app/Calculator.apk",
#"/system/app/Calendar.apk",
#"/system/app/Camera.apk",
#"/system/app/DeskClock.apk",
"/system/app/DSPManager.apk",
"/system/app/Email.apk",
"/system/app/FileManager.apk",
"/system/app/Gallery3D.apk",
#"/system/app/GenieWidget.apk", #News & Weather
"/system/app/LatinIME.apk", #Default keyboard
"/system/app/LatinImeTutorial.apk", #Default keyboard tutorial
#"/system/app/Mms.apk", #Default SMS and MMS
"/system/app/SoundRecorder.apk",
"/system/app/Talk.apk", #Google Talk
"/system/app/UserDictionaryProvider.apk", #Needed for default keyboard

##Other apps
"/system/app/CarHomeGoogle.apk",
"/system/app/Development.apk", #Dev Tools
#Downloads app. If removed, default browser FCs if download notification is
#selected while in progress. Does not otherwise affect downloading capabilities
"/system/app/DownloadProviderUi.apk",
#"/system/app/GoogleQuickSearchBox.apk", #Google Search
"/system/app/Stk.apk", #SIM Toolkit
"/system/app/SpareParts.apk",
"/system/app/Tag.apk",
#"/system/app/Torch.apk", #Needed for torch button in notification power widget
"/system/app/VoiceDialer.apk",

##Remove and use Market versions which are often updated before CyanogenMod's
#https://market.android.com/details?id=jackpal.androidterm
"/system/app/AndroidTerm.apk",
#https://market.android.com/details?id=com.koushikdutta.rommanager
"/system/app/RomManager.apk",

##Services
#Bluetooth Share, does not affect other Bluetooth functions
"/system/app/Bluetooth.apk",
"/system/app/CertInstaller.apk",
"/system/app/CMStats.apk", #CyanogenMod anonymous statistics reporting service
"/system/app/CMUpdateNotify.apk", #CyanogenMod Update Notifications
#"/system/app/FOTAKill.apk",
#"/system/app/HTMLViewer.apk",
"/system/app/GoogleFeedback.apk",
"/system/app/MediaUploader.apk",
#"/system/app/NetworkLocation.apk", #Location via mobile network/Wi-Fi (not GPS)
#"/system/app/Nfc.apk",
#Pico text-to-speech engine. If removed, text-to-speech
#will still work, but text-to-speech settings will FC
#"/system/app/PicoTts.apk",
#"/system/app/TtsService.apk", #Text-to-speech, needed for Google Navigation
"/system/app/VpnServices.apk",

##Theme chooser
#"/system/app/ThemeChooser.apk",
"/system/app/Androidian.apk",
"/system/app/Cyanbread.apk",

##Wallpapers
"/system/app/CMWallpapers.apk",
"/system/app/LiveWallpapers.apk",
#"/system/app/LiveWallpapersPicker.apk",
"/system/app/MagicSmokeWallpapers.apk",
"/system/app/VisualizationWallpapers.apk",

##May not be disabled in older ROMs, no harm removing
"/system/lib/egl/libGLES_android.so",
"/system/media/audio/ui/camera_click.ogg",

##Boot animation and sound
"/system/bin/bootanimation",
"/system/media/bootanimation.zip",
"/system/media/audio/poweron/PowerOn.ogg"
); #REMINDER: No comma on last entry

###Extract files to /system and set permissions
package_extract_dir("system", "/system");
set_perm_recursive(0, 2000, 0755, 0750, "/system/etc/init.d");
set_perm(0, 0, 06755, "/system/xbin/su");

###Unmount /data and /system partitions
unmount("/data");
unmount("/system");

###Messages
ui_print("");
ui_print("Beng's Finalizer");
ui_print("Installed:");
ui_print("Custom Font: Roboto");
ui_print("Custom Sounds: ICS");
ui_print("");
ui_print("Tweaked:");
ui_print("gps.conf");
ui_print("hosts file");
ui_print("");
ui_print("Updated System Apps:");
ui_print("Superuser v3.0.6");
ui_print("su binary v3.0.3");