summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-08-19 09:11:31 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-19 09:11:31 -0700
commit821afa9aec8d3a4ffd2e72ce797d8097eaf13973 (patch)
tree5077b84763a04e978d20f74f72c9a9c0fc1609f9 /tools
parent6bcffcd2dc410db780c152c70a01b22da6ca58be (diff)
parent54d41379357d1d800d0a7bd7c5dc56111710482a (diff)
downloadframeworks_base-821afa9aec8d3a4ffd2e72ce797d8097eaf13973.zip
frameworks_base-821afa9aec8d3a4ffd2e72ce797d8097eaf13973.tar.gz
frameworks_base-821afa9aec8d3a4ffd2e72ce797d8097eaf13973.tar.bz2
am 54d41379: Merge "Add OBB flags to support overlays" into gingerbread
Merge commit '54d41379357d1d800d0a7bd7c5dc56111710482a' into gingerbread-plus-aosp * commit '54d41379357d1d800d0a7bd7c5dc56111710482a': Add OBB flags to support overlays
Diffstat (limited to 'tools')
-rw-r--r--tools/obbtool/Main.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/tools/obbtool/Main.cpp b/tools/obbtool/Main.cpp
index 2a9bf04..49e077f 100644
--- a/tools/obbtool/Main.cpp
+++ b/tools/obbtool/Main.cpp
@@ -29,7 +29,7 @@ static const char* gProgVersion = "1.0";
static int wantUsage = 0;
static int wantVersion = 0;
-#define ADD_OPTS "n:v:f:c:"
+#define ADD_OPTS "n:v:o"
static const struct option longopts[] = {
{"help", no_argument, &wantUsage, 1},
{"version", no_argument, &wantVersion, 1},
@@ -37,8 +37,7 @@ static const struct option longopts[] = {
/* Args for "add" */
{"name", required_argument, NULL, 'n'},
{"version", required_argument, NULL, 'v'},
- {"filesystem", required_argument, NULL, 'f'},
- {"crypto", required_argument, NULL, 'c'},
+ {"overlay", optional_argument, NULL, 'o'},
{NULL, 0, NULL, '\0'}
};
@@ -46,8 +45,7 @@ static const struct option longopts[] = {
struct package_info_t {
char* packageName;
int packageVersion;
- char* filesystem;
- char* crypto;
+ bool overlay;
};
/*
@@ -77,6 +75,7 @@ void doAdd(const char* filename, struct package_info_t* info) {
obb->setPackageName(String8(info->packageName));
obb->setVersion(info->packageVersion);
+ obb->setOverlay(info->overlay);
if (!obb->writeTo(filename)) {
fprintf(stderr, "ERROR: %s: couldn't write OBB signature: %s\n",
@@ -112,6 +111,8 @@ void doInfo(const char* filename) {
printf("OBB info for '%s':\n", filename);
printf("Package name: %s\n", obb->getPackageName().string());
printf(" Version: %d\n", obb->getVersion());
+ printf(" Flags: 0x%08x\n", obb->getFlags());
+ printf(" Overlay: %s\n", obb->isOverlay() ? "true" : "false");
}
/*
@@ -143,7 +144,7 @@ int main(int argc, char* const argv[])
case 'n':
package_info.packageName = optarg;
break;
- case 'v':
+ case 'v': {
char *end;
package_info.packageVersion = strtol(optarg, &end, 10);
if (*optarg == '\0' || *end != '\0') {
@@ -152,11 +153,9 @@ int main(int argc, char* const argv[])
goto bail;
}
break;
- case 'f':
- package_info.filesystem = optarg;
- break;
- case 'c':
- package_info.crypto = optarg;
+ }
+ case 'o':
+ package_info.overlay = true;
break;
case '?':
wantUsage = 1;