| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import java.io.File; | 5 import java.io.File; |
| 6 import java.io.FileOutputStream; | 6 import java.io.FileOutputStream; |
| 7 import java.io.IOException; | 7 import java.io.IOException; |
| 8 import java.io.InputStream; | 8 import java.io.InputStream; |
| 9 import java.io.OutputStream; | 9 import java.io.OutputStream; |
| 10 import java.util.ArrayList; | 10 import java.util.ArrayList; |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 JarEntry outEntry = null; | 316 JarEntry outEntry = null; |
| 317 boolean isCrazy = isCrazyLibraryFilename(name); | 317 boolean isCrazy = isCrazyLibraryFilename(name); |
| 318 if (isCrazy) { | 318 if (isCrazy) { |
| 319 // "crazy" libraries are alway output uncompressed (STORED). | 319 // "crazy" libraries are alway output uncompressed (STORED). |
| 320 outEntry = makeStoredEntry(name, inEntry, in); | 320 outEntry = makeStoredEntry(name, inEntry, in); |
| 321 numCrazy++; | 321 numCrazy++; |
| 322 if (numCrazy > 1) { | 322 if (numCrazy > 1) { |
| 323 throw new UnsupportedOperationException( | 323 throw new UnsupportedOperationException( |
| 324 "Found more than one library\n" | 324 "Found more than one library\n" |
| 325 + "Multiple libraries are not supported for APKs tha
t use " | 325 + "Multiple libraries are not supported for APKs tha
t use " |
| 326 + "'load_library_from_zip_file'.\n" | 326 + "'load_library_from_zip'.\n" |
| 327 + "See crbug/388223.\n" | 327 + "See crbug/388223.\n" |
| 328 + "Note, check that your build is clean.\n" | 328 + "Note, check that your build is clean.\n" |
| 329 + "An unclean build can incorrectly incorporate old
" | 329 + "An unclean build can incorrectly incorporate old
" |
| 330 + "libraries in the APK."); | 330 + "libraries in the APK."); |
| 331 } | 331 } |
| 332 } else if (inEntry.getMethod() == JarEntry.STORED) { | 332 } else if (inEntry.getMethod() == JarEntry.STORED) { |
| 333 // Preserve the STORED method of the input entry. | 333 // Preserve the STORED method of the input entry. |
| 334 outEntry = new JarEntry(inEntry); | 334 outEntry = new JarEntry(inEntry); |
| 335 outEntry.setExtra(null); | 335 outEntry.setExtra(null); |
| 336 } else { | 336 } else { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 outputJar.setLevel(9); | 439 outputJar.setLevel(9); |
| 440 | 440 |
| 441 rezip(inputJar, outputJar, outCount, addAlignment, rename); | 441 rezip(inputJar, outputJar, outCount, addAlignment, rename); |
| 442 outputJar.close(); | 442 outputJar.close(); |
| 443 } finally { | 443 } finally { |
| 444 if (inputJar != null) inputJar.close(); | 444 if (inputJar != null) inputJar.close(); |
| 445 if (outputFile != null) outputFile.close(); | 445 if (outputFile != null) outputFile.close(); |
| 446 } | 446 } |
| 447 } | 447 } |
| 448 } | 448 } |
| OLD | NEW |