diff options
author | Jesse Wilson <jessewilson@google.com> | 2011-11-18 14:51:14 -0500 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2013-04-30 14:50:12 -0700 |
commit | eb5fee6dd9c1a77af17cdf2991afe1e3db07e98a (patch) | |
tree | 3378d1ead745dad4fbbcd666fecef06d50576656 | |
parent | a34f79ba9d4983b96571bbde0a18d352d495f601 (diff) | |
download | libcore-eb5fee6dd9c1a77af17cdf2991afe1e3db07e98a.zip libcore-eb5fee6dd9c1a77af17cdf2991afe1e3db07e98a.tar.gz libcore-eb5fee6dd9c1a77af17cdf2991afe1e3db07e98a.tar.bz2 |
Fix DexMerger to emit dex files without extended op codes.
Certain tools in our tool chain don't like these.
Patched from master/dalvik change: Iaaff85c1b634f647d0105c36f403b2e03aaf0ca7
Change-Id: I7b5c6bf2b6a6ed96c9bb76817154344764e61c62
(cherry picked from commit 463cf8e67948d7d82a31c74588903b70fdd6b7b0)
-rw-r--r-- | dex/src/main/java/com/android/dex/TableOfContents.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dex/src/main/java/com/android/dex/TableOfContents.java b/dex/src/main/java/com/android/dex/TableOfContents.java index 54411ca..d1b87ac 100644 --- a/dex/src/main/java/com/android/dex/TableOfContents.java +++ b/dex/src/main/java/com/android/dex/TableOfContents.java @@ -75,7 +75,7 @@ public final class TableOfContents { byte[] magic = headerIn.readByteArray(8); int apiTarget = DexFormat.magicToApi(magic); - if (apiTarget < 0) { + if (apiTarget != DexFormat.API_NO_EXTENDED_OPCODES) { throw new DexException("Unexpected magic: " + Arrays.toString(magic)); } @@ -164,7 +164,7 @@ public final class TableOfContents { } public void writeHeader(Dex.Section out) throws IOException { - out.write(DexFormat.apiToMagic(DexFormat.API_CURRENT).getBytes("UTF-8")); + out.write(DexFormat.apiToMagic(DexFormat.API_NO_EXTENDED_OPCODES).getBytes("UTF-8")); out.writeInt(checksum); out.write(signature); out.writeInt(fileSize); |