[Droid Incredible Android Development] zebdor44:
Hello all,

I have updated the script further to allow for arguments to be accepted as well as having the script placed in /system/bin. This works pretty much like Titanium Backup except that it's a script and uses a CLI. No pretty GUI ;). You can backup, restore, and fix app and data permissions from this script. 'fix_permissions' is embedded within this script and it will be install in the /system/bin folder if the startup script does not already find it. The script does not really work like an Apps2SD other than it backs up apps from /data/app and their appropriate data folders from /data/data.

This script can be very useful when switching between ROMs as your app and data can be reinstalled with the script's restore feature.

The script currently looks for APKs to backup from /data/app, /data/app-private, and /mnt/asec.

My first creation of this script was based upon a modified version of Firerat's Apps2SD script so naturally many thanks goes to him. Also the fix_permissions script comes from Koush and the Cyanogen Team.

No EXT partition required! Just download the file and run on an Android device.

STEPS:

1. Put the attached file on your SD card and run. It will install app_backup to /system/bin. From there you can type the following to start the program:

app_backup

Here's an example of backing up a couple apps with a data backup:

C:\Users\zlippard\Documents>adb shell
# app_backup
app_backup
Welcome to AppBackup 1.1

OPTIONS
--------------------------------
'b' to backup
'r' to restore
'f' to fix all app permissions
'd' to delete app_backup folder
'x' to reboot
'q' to quit: b
b
Creating app list to /dev/applist.txt...
Done!
[1] sd com.DefiantDev.RocketBunnies
[2] sd com.rovio.angrybirds
[3] sd com.rovio.angrybirdsseasons
[4] sd sts.pl
[5] app android.tether
[6] app com.alfray.timeriffic
[7] app com.androidemu.gbalite
[8] app com.aurorasoftworks.quadrant.ui.standard
[9] app com.batterypoweredgames.lightracer3dbasic
[10] app com.bfs.papertoss
[11] app com.chase.sig.android
[12] app com.chung.compasslevel
[13] app com.citrix.Receiver
[14] app com.facebook.katana
[15] app com.faziklogic.scripter
[16] app com.fede.launcher
[17] app com.forthegamer.android.scheduler
[18] app com.google.android.apps.chrometophone
[19] app com.google.android.apps.googlevoice
[20] app com.google.android.apps.maps
[21] app com.google.android.apps.unveil
[22] app com.google.android.carhome
[23] app com.google.android.gm
[24] app com.google.android.stardroid
[25] app com.google.android.street
[26] app com.google.android.voicesearch
[27] app com.google.android.youtube
[28] app com.google.zxing.client.android
[29] app com.gravitymobile.app.hornbill
[30] app com.icenta.sudoku.ui
[31] app com.intuit.instantreturn
[32] app com.intuit.instantreturn.filing.key
[33] app com.joelapenna.foursquared
[34] app com.koushikdutta.rommanager.license
[35] app com.metago.astro
[36] app com.mhuang.overclocking
[37] app com.mobitv.client.nfl2010
[38] app com.pandora.android
[39] app com.paypal.android.p2pmobile
[40] app com.shazam.android
[41] app com.sirma.mobile.bible.android
[42] app com.southwestairlines.mobile
[43] app com.sporadicsoftware.NetQFree
[44] app com.twitter.android
[45] app com.verizon.ams.companion
[46] app com.verizon.android.wifios
[47] app com.vzw.hss.myverizon
[48] app com.zebdor.android.poolCare
[49] app net.flixster.android
[50] app net.rbgrn.lightracer
[51] app org.connectbot
[52] app org.coolcode.emuroms
[53] app ru.orangesoftware.areminder

Enter app #'s to backup or 'a' for all and press [ENTER].
Or 0 to exit (ex: 1 5 15): 1 3 4
1 3 4
Copy data? ('y' or 'n') y
y
1 of 3] - Backing up com.DefiantDev.RocketBunnies...Done!
2 of 3] - Backing up com.rovio.angrybirdsseasons...Done!
3 of 3] - Backing up sts.pl...Done!
OPTIONS
--------------------------------
'b' to backup
'r' to restore
'f' to fix all app permissions
'd' to delete app_backup folder
'x' to reboot
'q' to quit: q
q

Goodbye!
#

When starting the script, you will be brought to the main menu screen where you can choose to either backup, restore, fix permissions, delete /sdcard/app_backup (this is the storage folder), reboot or quit. The rest is pretty self explanatory...

So far I have tested this script on the DROID and DROID Incredible. The DROID was running Bugless Beast 2.2 and the Inc I've tried ran CM6 and CM7.

UPDATES:

1.4

Added "busybox " before each command call within the app_backup script to make sure busybox commands are being called.

1.3

Fixed issue with backup apps not showing up. Thanks to welcomb for notifying me. :)

Fixed mounting issue for ro/rw in /system

1.2

Fixed backup feature for phones that use Apps2SD. Thanks to welcomb.

Fixed deletion feature of apps and data.

1.1

Arguments: use -b to auto-run a full backup. -r will auto-run a full restore of all apps in android_app_backup

Apps and data are now stored in /sdcard/android_app_backup.

app_backup script is now automatically installed to /system/bin/app_backup when running the new script. The new script is more of an installer.

Let me know of any bugs!

Much of the credit goes to Firerat for creating the initial apps2sdext script. This is what gave me the idea to continue on with an app backup script. Here's Firerat's latest version of apps2sdext in case you want to see it or don't have an incredible: http://forum.cyanogenmod.com/topic/...mount-issues-i-hope/page__p__24386#entry24386

As the usual goes, I'm not responsible for any mishaps that may occur while using this script or bricked phones, data loss, blah blah blah... So, USE AT YOUR OWN RISK.

The script is attached below. Have fun! Please post any findings, bugs, questions, comments, or updates you would like to see here. Feel free to make any modifications to this script.

NOTE TO SAMSUNG RELAY 4G USERS:

A friend of mine has this phone and was getting the following error when running the .sh script:

can't create temporary file /sqlite_stmt_journals/mksh.<random>

To remedy this, I remounted the root directory / as read-write,created the folder /sqlite_stmt_journals, ran the .sh script, and afterwards remounted to read-only.