[myTouch 3G, Magic Android Development] darkguy2008:
Hey! ^_^

I made a script to remove the bloat from ROMs, add some script functionality and replace some system APKs. It's simple, but really powerful. I use it everytime I get a new ROM because I like plain stock ROMs, with only the system apps. I dunno, I just like it that way :).

So, here it is, ModYourROM LITE! ^^!. It’s intended to be used AFTER A ROM FLASH, INSIDE RECOVERY, AND BEFORE THE FIRST BOOT, but it can run afterwards with no issues, I guess.

ROM Compatibility? for now, it’s been tested only with GingerYoshi 1.1 and 1.2 (awesome ROM by the way :)).

Now…

Very Important Notes, or V.I.N. for short. Yeah, like Vin Diesel, only that he’ll come and punch you right in your face if you don’t read AND follow them =P.

You need to have ADB in your PATH variable, or edit the script accordingly (!!!).

This script is made for Linux. If you’re on Windows, replace "#" by "REM" and remove the first line of the script.

Don’t just bluntly run it. READ what the script does before running it. It’s common-linux-sense.

You need to have busybox run-parts on your ROM for the startup-scripts functionality. GingerYoshi has it, I don't know which other ROMs have it. It's only needed if you want the startup scripts though.

This script creates a folder called “bak” in your SD card, in case you want to redo the changes. Be sure to have it inserted on the phone before running the script.

Last but not least:

I’m not responsible

if this breaks your phone, ROM, flying toaster or BORGizes your phone and assimilates you. This script has been working on my phone & setup without much modifications other than adding/removing a few APKs or scripts, so this is the only guarantee I give you. It hasn’t broken mine, but YDMV (Your Device May Vary). Still, you can PM me or post here and I'll try to help you fix something this script has made. However, I'm no expert so I may - or may not - fix what this script did on your phone.

Now, let’s get our hands dirty:

Create a folder somewhere (ie Destkop). I’ll call it “myr“.

Add your custom APKs into myr/apks. Rename them if needed so they have simple names with no spaces. Stuff like foo.bar.boo.hoo.apk sucks =P.

Add your startup scripts (if any) into myr/scripts (you can find some at the bottom of this post).

Add your boot animation replacement (if any) into myr/boot.

Add the latest busybox for ARM5 (in the case of HTC Magic, busybox-armv5l) into myr/busybox. You can find it HERE. Rename it as busy1184, WITH NO EXTENSION.

Put the following scripts in your myr folder:

myrLITE.sh

#!/bin/sh

# ================================================================================================================
# ModYourROM LITE v1.1 by DARKGuy (dark DOT guy DOT 2008 AT gmail DOT com)
# 6th Jun 2011
#
# WINDOWS USER: Replace # by REM and delete the first line. Be sure to have adb in your PATH environment variable.
# ================================================================================================================

# =====================================================================
# DO NOT REMOVE THIS ADB SEGMENT
# =====================================================================
echo "Mounting..."
adb -d shell mount /data
adb -d shell mount /system
adb -d shell mount /sdcard
adb -d shell mount /sd-ext
adb -d shell mkdir /sdcard/bak

# =====================================================================
# Remove this segment if you don't want to update busybox
# =====================================================================
adb -d push busybox/busybox1184 /sdcard/busy1184
adb -d shell dd if=/sdcard/busy1184 of=/system/bin/busybox
adb -d shell chmod 755 /system/bin/busybox
adb -d shell /system/bin/busybox --install /system/xbin
adb -d shell rm /sdcard/busy1184

# =====================================================================
# Remove these two segments if you don't want/have any startup scripts
# =====================================================================
echo "Adding startup script functionality..."
adb -d shell mkdir /data/local/scripts
adb -d push 90scripts.sh /system/etc/init.d/90scripts
adb -d shell chmod 0750 /system/etc/init.d/90scripts
adb -d shell chown 0:2000 /system/etc/init.d/90scripts

echo "Adding startup scripts..."
adb -d push scripts/noatime.sh /data/local/scripts/noatime.sh
adb -d push scripts/autokiller.sh /data/local/scripts/autokiller.sh
adb -d push scripts/non-rotational.sh /data/local/scripts/non-rotational.sh
adb -d shell chmod +x /data/local/scripts/noatime.sh
adb -d shell chmod +x /data/local/scripts/autokiller.sh
adb -d shell chmod +x /data/local/scripts/non-rotational.sh

# =====================================================================
# Take a look at what apps does this segment remove and delete the
# lines of apps you want to KEEP on your device.
# =====================================================================
echo "Removing apps..."

# Safe to remove
adb -d shell mv /system/app/Protips.apk /sdcard/bak
adb -d shell mv /system/app/PicoTts.apk /sdcard/bak
adb -d shell mv /system/app/TtsService.apk /sdcard/bak
adb -d shell mv /system/app/VoiceDialer.apk /sdcard/bak
adb -d shell mv /system/app/GoogleBackupTransport.apk /sdcard/bak
adb -d shell mv /system/app/GoogleFeedback.apk /sdcard/bak
adb -d shell mv /system/app/GooglePartnerSetup.apk /sdcard/bak
adb -d shell mv /system/app/OneTimeInitializer.apk /sdcard/bak
adb -d shell mv /system/app/ApplicationsProvider.apk /sdcard/bak
adb -d shell mv /system/app/Development.apk /sdcard/bak
adb -d shell mv /system/app/Stk.apk /sdcard/bak

# Bloat
adb -d shell mv /data/app/YouTube.apk /sdcard/bak
adb -d shell mv /data/app/DSPManager.apk /sdcard/bak
adb -d shell mv /system/app/Maxthon.apk /sdcard/bak
adb -d shell mv /system/app/GoogleQuickSearchBox.apk /sdcard/bak
adb -d shell mv /system/app/ThemeChooser.apk /sdcard/bak
adb -d shell mv /system/app/ThemeManager.apk /sdcard/bak
adb -d shell mv /system/app/lindamanager.apk /sdcard/bak

# Core app (I don't use GTalk. Delete if you do).
adb -d shell mv /system/app/Talk.apk /sdcard/bak

# Core app (I don't use the News Reader. Delete if you do).
adb -d shell mv /system/app/GenieWidget.apk /sdcard/bak

# Core app (I don't use the Email app. Delete if you do).
adb -d shell mv /system/app/Email.apk /sdcard/bak

# To be replaced afterwards (READ NOTE IN NEXT SEGMENT)
adb -d shell mv /system/app/DeskClock.apk /sdcard/bak
adb -d shell mv /system/app/Gallery3D.apk /sdcard/bak

# Remove launchers, so we add our own later (READ NOTE IN NEXT SEGMENT)
adb -d shell mv /system/app/Launcher2.apk /sdcard/bak
adb -d shell mv /system/app/ZeamLauncher.apk /sdcard/bak

# =====================================================================
# Remove this segment if you don't want/have any bootanimation.zip
# =====================================================================
echo "Changing boot animation..."
adb -d shell rm -f /system/media/bootanimation.zip
adb -d push boot/bootanimation.zip /system/media/bootanimation.zip

# =====================================================================
# Remove this segment if you don't want/have any replacement apps.
#
# BE SURE TO HAVE A REPLACEMENT APP HERE IN CASE YOU REMOVE CORE APPS,
# like the Clock, News Reader (GenieWidget), Email, Launcher and Gallery3D (which are
# removed above if you didn't look carefully enough - and as for Gallery, I replace it with a
# faster, maybe-not-so-eyecandy-er 2D one).
# =====================================================================
echo "Adding replacement apps..."
adb -d push apks/AlarmClockPlus.apk /system/app/AlarmClockPlus.apk
adb -d push apks/Gallery.apk /system/app/Gallery.apk
adb -d push apks/LauncherPro.apk /system/app/LauncherPro.apk

# =====================================================================
# Don't delete this, it's safe to keep it. Your next boot will be a bit
# slower because it's regenerating the odex files.
# =====================================================================
echo "Cleaning dalvik-cache..."
adb -d shell rm -f /data/dalvik-cache/*
adb -d shell rm -f /sd-ext/dalvik-cache/*
adb -d shell busybox sync

echo "."
echo "Done! Enjoy your new LITE ROM :)"
echo "Script by DARKGuy"
echo "http://www.drakkengard.com/blog/"
echo "."

90scripts

#!/system/bin/sh
sList=`ls /data/local/scripts/*.sh`
for myScript in $sList
do
sh $myScript
done

Now, EDIT ACCORDINGLY BEFORE RUNNING the myrLITE script.

You should end up with something like this:

Now, if you’re on Linux, run this first:

chmod +x myrLITE.sh

Then run the script:

./myrLITE.sh

If you’re on Windows, just name it myrLITE.bat and run it from a command prompt.

Now just plain enjoy your new LITE’d ROM :D.

Credits and references:

* GingerYoshi by Yoshi Team ( here ).

* SD Tweakz by Ungaze ( here and here ).

* Some theory on removing some APKs and autokiller script by tom0769 ( here ).

* Barebones CM Wiki page by CyanogenMod ( here ).

Comments & suggestions welcome! :D

If you like my work and want to motivate me to keep working on this (and more stuff for the community) make a donation! any amount is greatly appreciated :)

=========

CHANGELOG

=========

1.2 (09/06/11)

* Removed the annoying beginner's tips widget

1.1 (06/06/11)

* Added busybox updating

* Added Email.apk and GenieWidget.apk to the core app APK removing section.

* Fixed 90scripts.sh

1.0 (05/25/11)

* Initial release