+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '-e' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ if (argv[0][0] != 0) {
+ bundle.addNoCompressExtension(argv[0]);
+ } else {
+ bundle.setCompressionMethod(ZipEntry::kCompressStored);
+ }
+ break;
+ case '-':
+ if (strcmp(cp, "-min-sdk-version") == 0) {
+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '--min-sdk-version' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ bundle.setMinSdkVersion(argv[0]);
+ } else if (strcmp(cp, "-target-sdk-version") == 0) {
+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '--target-sdk-version' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ bundle.setTargetSdkVersion(argv[0]);
+ } else if (strcmp(cp, "-max-sdk-version") == 0) {
+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '--max-sdk-version' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ bundle.setMaxSdkVersion(argv[0]);
+ } else if (strcmp(cp, "-max-res-version") == 0) {
+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '--max-res-version' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ bundle.setMaxResVersion(argv[0]);
+ } else if (strcmp(cp, "-version-code") == 0) {
+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '--version-code' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ bundle.setVersionCode(argv[0]);
+ } else if (strcmp(cp, "-version-name") == 0) {
+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '--version-name' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ bundle.setVersionName(argv[0]);
+ } else if (strcmp(cp, "-values") == 0) {
+ bundle.setValues(true);
+ } else if (strcmp(cp, "-custom-package") == 0) {
+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '--custom-package' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ bundle.setCustomPackage(argv[0]);
+ } else if (strcmp(cp, "-utf16") == 0) {
+ bundle.setWantUTF16(true);
+ } else if (strcmp(cp, "-rename-manifest-package") == 0) {
+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '--rename-manifest-package' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ bundle.setManifestPackageNameOverride(argv[0]);
+ } else if (strcmp(cp, "-rename-instrumentation-target-package") == 0) {
+ argc--;
+ argv++;
+ if (!argc) {
+ fprintf(stderr, "ERROR: No argument supplied for '--rename-instrumentation-target-package' option\n");
+ wantUsage = true;
+ goto bail;
+ }
+ bundle.setInstrumentationPackageNameOverride(argv[0]);
+ } else if (strcmp(cp, "-auto-add-overlay") == 0) {
+ bundle.setAutoAddOverlay(true);
+ } else {
+ fprintf(stderr, "ERROR: Unknown option '-%s'\n", cp);
+ wantUsage = true;
+ goto bail;
+ }
+ cp += strlen(cp) - 1;