diff options
| author | 2018-01-17 14:52:55 -0800 | |
|---|---|---|
| committer | 2018-01-17 14:53:27 -0800 | |
| commit | 5c362202a6c82fff6b7052a53e6fe13e8fc9ad08 (patch) | |
| tree | 2b28942d8ca483f203ed4227806e03c72f13062c | |
| parent | f147a3f896e0726e3a4d47e7092e0cc6930c559e (diff) | |
Add a way to specify compact dex level for dexlayout
The option is '-x', which supports "fast" and "none" compact dex
generation. The default is "none".
Test: dexlayout -w out_dir -x fast classes.dex
Bug: 63756964
Change-Id: I77125d5148974d24a0808f80e2400f77f8b57a76
| -rw-r--r-- | dexlayout/dexlayout_main.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/dexlayout/dexlayout_main.cc b/dexlayout/dexlayout_main.cc index 5bb7196531..83fb99a734 100644 --- a/dexlayout/dexlayout_main.cc +++ b/dexlayout/dexlayout_main.cc @@ -62,6 +62,7 @@ static void Usage(void) { fprintf(stderr, " -t : display file section sizes\n"); fprintf(stderr, " -v : verify output file is canonical to input (IR level comparison)\n"); fprintf(stderr, " -w : output dex directory \n"); + fprintf(stderr, " -x : compact dex generation level, either 'none' or 'fast'\n"); } /* @@ -79,7 +80,7 @@ int DexlayoutDriver(int argc, char** argv) { // Parse all arguments. while (1) { - const int ic = getopt(argc, argv, "abcdefghil:mo:p:stvw:"); + const int ic = getopt(argc, argv, "abcdefghil:mo:p:stvw:x:"); if (ic < 0) { break; // done } @@ -141,6 +142,15 @@ int DexlayoutDriver(int argc, char** argv) { case 'w': // output dex files directory options.output_dex_directory_ = optarg; break; + case 'x': // compact dex level + if (strcmp(optarg, "none") == 0) { + options.compact_dex_level_ = CompactDexLevel::kCompactDexLevelNone; + } else if (strcmp(optarg, "fast") == 0) { + options.compact_dex_level_ = CompactDexLevel::kCompactDexLevelFast; + } else { + want_usage = true; + } + break; default: want_usage = true; break; |