[Android Software/Hacking General [Developers Only]] geeksunny:
Hello everyone! My name is geeksunny and I am fairly new to the community. Been a lurker for a quite a while now but I finally have something to share! :)

BarebonesAndroid

What it is

What I have here is a Bash script to automate backing up your /system/app directory and then steps through a list of packages offering to remove them from your device. It runs on your Linux PC and uses ADB to interface with your device.

I wrote this for myself to automate the process of trimming my system down after I flash a new ROM. I recently bought a Nook Color and have been flashing CyanogenMod 7 nightlys to it pretty frequently. I also use a Motorola Droid phone and this comes in handy for the same reason on that device as well.

Seeing as how this was written with CyanogenMod 7 in mind, I am not sure how well it will work with other ROMs. I think it would work as it uses generic uninstall commands. It is based off of the packages that come in CM7 so those packages are the only ones considered by this script.

Note: I'm pretty rusty with my Bash scripting and kinda threw this together in my spare time. It may not be the prettiest script in the world but it gets the job done!

Requirements

To use this script you must...

- Be running a Linux/Unix based OS. (I use Ubuntu for my SDK machine. I don't have a Mac and do not know for sure if this will run on OSX.)

- Have ADB set up correctly and talking with your device.

- Have read/write access to your device's /system folder. (Be rooted.)

How to use it

Unzip and run ./BarebonesAndroid.sh in your terminal.

if ./BarebonesAndroid.sh is not executable, run this command:

chmod 775 BarebonesAndroid.sh

- It will first ask you to confirm that the device is connected and recognized by ADB.

- It will then ask if you want to back up your /system/app directory before removing any packages. If yes, you can specify a directory for the script to back them up to. It will default to ./apkBackup

- After this it will begin ask you one-by-one if you want to remove a given package. Enter Y or N for each package.

- When the script is finish it will reboot your device.

Future plans

I originally wrote this for myself but thought this could be useful to others out there. Right now the requirements aren't all that accessable to the average user (Linux OS with ADB set up). If there is a demand for it, I may write a Windows batch script version, or maybe convert it into a cross-platform command-line application. Let me know what you think of this idea!

I do have a book on Android development and my eventual goal is to turn this in to a native app!

Regarding the script...

- Add support for multiple devices. Right now it asks that you only have one device connected at a time. This is because I haven't had experience with multiple devices hooked up at once. I plan to fix that in the future.

- Add more error checking and failproofing.

- Streamline the experience. Make things a little more graceful than going through a set list one-by-one.

- Sort the apps. Perhaps add categories.

- Check installed packages and only offer to remove them if they are installed.

Thats it! Thanks for looking!