summaryrefslogtreecommitdiffstats
path: root/cmds/bmgr
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2009-06-18 18:35:32 -0700
committerChristopher Tate <ctate@google.com>2009-06-18 18:38:02 -0700
commitabce4e8714bed26a2b37b20ad3f02cf619d71c9a (patch)
tree274cf438fcda8dca4b13a056bc73fea61ba4dd77 /cmds/bmgr
parent2810f681991d1beb5ceb3515159f9fad3cc341d5 (diff)
downloadframeworks_base-abce4e8714bed26a2b37b20ad3f02cf619d71c9a.zip
frameworks_base-abce4e8714bed26a2b37b20ad3f02cf619d71c9a.tar.gz
frameworks_base-abce4e8714bed26a2b37b20ad3f02cf619d71c9a.tar.bz2
Use signatures on restore
On restore now, the backup manager gets the signature blocks corresponding to the restore set from the transport. It then validates those signatures against the on-device app signatures, and refuses to restore data to an app whose on-device sig block does not match the backup image's. Also actually implement 'bmgr transport N' so that we can select the local transport easily during runtime.
Diffstat (limited to 'cmds/bmgr')
-rw-r--r--cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
index 3af80fa..841e3df 100644
--- a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
+++ b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
@@ -80,6 +80,14 @@ public final class Bmgr {
doRestore();
return;
}
+
+ if ("transport".equals(op)) {
+ doTransport();
+ return;
+ }
+
+ System.err.println("Unknown command");
+ showUsage();
}
private void doRun() {
@@ -113,6 +121,19 @@ public final class Bmgr {
}
}
+ private void doTransport() {
+ try {
+ int which = Integer.parseInt(nextArg());
+ int old = mBmgr.selectBackupTransport(which);
+ System.out.println("Selected transport " + which + " (formerly " + old + ")");
+ } catch (NumberFormatException e) {
+ showUsage();
+ } catch (RemoteException e) {
+ System.err.println(e.toString());
+ System.err.println(BMGR_NOT_RUNNING_ERR);
+ }
+ }
+
private void doList() {
String arg = nextArg(); // sets, transports, packages set#
if ("transports".equals(arg)) {