History log of /frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9958145a97586375966bc133c900ead0e1550f2a 02-Jan-2017 Yohann Roussel <yroussel@google.com> Check crc and time of secondary dex files

Protect extracted dex files from modifications by checking their crc and
modification time. In case of change, proceed to a new extraction.

Those checks are replacing the check of the zip integrity by
opening it with a ZipFile.

Test: SupportMultidexHostTest (from tradefed)
Bug: 32159214
Change-Id: I09aa01550782f5f550bee6fc91709455e82c1057
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
fe10f9fd25a4d7bb287d36b3730aa0d605115053 02-Jan-2017 Yohann Roussel <yroussel@google.com> Check extracted dex only once per usage

The check is unnecessary in MultiDex.install because it was already done
by MultiDexExtractor.load. The retry on bad extraction is also included
in MultiDexExtractor.load so it was redundant too.

Test: SupportMultidexHostTest (from tradefed)
Change-Id: I877a99db0e0c562ac47a7c5c87d7f3e1d70884e6
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
f5832474ebd6ec48f0f37bc1fd9e2576068e4ef2 02-Jan-2017 Yohann Roussel <yroussel@google.com> Mark extracted dex files as read only

This is a poor protection from some attack against application that
would be made to overwrite their extracted secondary dex files.

The protection is poor because marking the dex files read only will
protect only some applications depending on their implementation.

Test: MultiDexLegacyVersionedTestApp
Bug: 32159214
Change-Id: I88c6fc72284f4e0b832dc4d840c9c636a1234638
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
4b56ee2bb0401ccf35bdecaaf86b2212e98db919 12-Jan-2017 Jon Noack <noackjr@google.com> Prefix temp files to ensure they are cleaned up

Temp files are removed unconditionally in a finally block following extraction.
However, if the process is killed during extraction this finally block will not
run. Because temp files started with extractedFilePrefix, they wouldn't be
cleaned up in prepareDexDir(). This change ensures that prepareDexDir() will
remove any existing temp files before extraction begins.

Bug: 27769642
Bug: 33718827
Test: Passes Google Play services tests
Change-Id: I803ba2c7234801551d36cbbe2941eeaa986d31f8
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
048fbf7ccf53782a265c277df38c273d43e5450e 09-Mar-2016 Andrew Johnson <aqj@google.com> Prevent concurrent extractions

This prevernt multiple processes of the same application from
simultaneously caching the same secondary dex files.

Bug: 27263431
Change-Id: If78ce2d2c5a37a3299b2bb3fa598a3ddd6acb7dd
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
606af94785cb96d418d87fe5a90bb2e09ccfa97f 12-May-2015 Yohann Roussel <yroussel@google.com> Use Context.getFilesDir as a backup dex location

On some devices it seems impossible to read or write the application
data directory. There, creating code_cache at the proper location is
impossible. In this case fallback to the 'files' directory. This may
lead to not cleaning the useless extracted secondary dex files if one
such devices is ever updated to L.

Bug: https://code.google.com/p/android/issues/detail?id=79388
Change-Id: I4b6725572f10fd511992dc8a5043d2f135abd3a5
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
8c2abf7f471b061b737e700af711e9d5d6883b40 28-Nov-2014 Yohann Roussel <yroussel@google.com> Workaround mkdirs concurency problems

Use only mkdir since our usage is a simple case.

Bug: https://code.google.com/p/android/issues/detail?id=79388
Change-Id: Iab7504f3c38c660f93ab1249895be454af5ff84d
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
e99daea7a3aec5ffac13b4283685e8d2a5994ad9 17-Sep-2014 Yohann Roussel <yroussel@google.com> Express a clearer status about supported versions.

By explaining the full story in README.txt.
By inlining API 11 constants so we can really compile the library against API 4.

Change-Id: I423e807114c15805e97860ff5db22ef9ff1e24c0
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
590a07e63868f0a1da311ff22b4a9f35eb48a865 21-Jul-2014 Yohann Roussel <yroussel@google.com> Use a simulated code-cache for storing extracted files.

This should allow an automatic cleaning when updating to L without having to
check at each launch.

Bug: 10447095

Change-Id: I3c0ecc1430ced4592f630ec4c6d8a1a2219e8141
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
d79604bd38c101b54e41745f85ddc2e04d978af2 08-Jul-2014 Yohann Roussel <yroussel@google.com> Clear old secondary dex dir when multidex becomes supported.

There may be a need for clearing those unused extracted files after an OTA
bringing Art L on the device.

Bug: 10447095

Change-Id: I80b9c0afa2bd8dfa0cf04e96fb04ba2527da0fe5
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
602c6ca8cae4718ba8ff9f65e53305d002479359 28-Mar-2014 Yohann Roussel <yroussel@google.com> Change update detection to reduce load time.

Reduces load time if extraction was already made. It appeared that
new ZipFile was really slow because it's preparing much things as
soon as it's instanciated.

The new criteria consist of the last modified time of the apk plus
the crc of the apk's central directory, last modified time should
be enough for nearly all modifications and the crc is here to try
to handle an OTA mixing with dates.

The transition from old criteria to new should be good: since there
will be no stored values they would be detected as a new installation.

Change-Id: Id390b77b03d794b8b7feb91eb0daae1126c6d691
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
782d200657395c38250df7a57b935bf522bc9acc 28-Jan-2014 Yohann Roussel <yroussel@google.com> Fix crc comparison in multidex installation.

The bug was caused by a comparison of Long instances instead of long
values and was leading to the library always detecting that the
secondary dex files needed a fresh exctraction.

bug 12776578

Change-Id: Ia7056a130cf6e99094e4f456b086e141c1255725
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
994fa84b3af07700fd5dcd477c02a6bd824dde45 17-Jan-2014 Maurice Chu <mochu@google.com> Remove the check for source apk file size

The file deletion when finding that the source apk file size
was different than what was stored in SharedPreferences causes a race
condition when multiple processes are executing this code, where one
process could erase the secondary zip file while a different process had
already started to create the zip file. This check is unnecessary and
has been removed.

Also, changed the parameter for getting the SharedPreferences to
Context.MODE_MULTI_PROCESS, which forces a re-read of the key/value
pairs from the file.

This should also fix the original bug b/12550057.

Bug: 12594955
Bug: 12550057
Change-Id: I53f4bca0d03a5737d802509274520a78effcf228
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
7e267a38525afac2a571da186e770a2b86a01846 16-Jan-2014 Maurice Chu <mochu@google.com> Check whether to extract secondary dex files based on apk size and CRC

This addresses an edge case where the secondary dex is not reloaded
when it should because of an OTA due to the modification time of the
PrebuiltGmsCore.apk in the system image is never different even though
PrebuiltGmsCore.apk may have changed in the OTA. This performs two
checks, the first is that the overall size of the apk is the same.
The second is to check that the number of dex files are the same, and
the CRC values of the dex file zip entries are the same.

Bug: 12550057
Change-Id: I526f6b88cfc7957840b0c35aaad0eab0cd776f7e
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
cc63eda4e6defe6b0dd5dd3c8fa608cf6ff26011 03-Dec-2013 Maurice Chu <mochu@google.com> Add additional check for valid Zip file before multidex install

Bug: 11895788
Change-Id: Id4f6e5b09be809eeb29367bebe78c03e49864cbf
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
88117c37e2c3f8601f295b74a3e804877afb78ee 28-Nov-2013 Yohann Roussel <yroussel@google.com> Add log to identify the source of the zip corruption.

This CL is to be reverted when debug is done.

Change-Id: I47f2464a4b32affe2d63f874a1df3f8f24e569d5
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
a159fd5dbd60171c9bb602f316ad8272419afe40 28-Nov-2013 Maurice Chu <mochu@google.com> Buffer the file output stream

Also, removed the file locking which had no effect.

Bug: 11895788
Change-Id: I8b520fff9496f289eba88690b3b583f9c43b932c
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
a0c1a85f60a44ef1c0592821270c20e988c64370 28-Nov-2013 Maurice Chu <mochu@google.com> Make file lock before renaming zip file

Change-Id: I548dd046f89d937f974cb5a925de70c7ecfad7a4
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
48cd040f1cf11d716f909f28ee237df6699a0f3b 28-Nov-2013 Maurice Chu <mochu@google.com> Remove computation of sha1 of zip file

This would spin up a lot of code to compute this and is
not something we want to do in every process that GMS Core
runs in. Return zip file length to have some data about the
file.

Change-Id: Ibb22c54a6d8ef33c690fd35f2b69c427449ef5d1
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
f6d1f23926672c8dd61da515f8d1bcb37ef4292d 27-Nov-2013 Maurice Chu <mochu@google.com> Verify secondary dex zip file is a zip file and retry

Also, print out the SHA1 digest of the zip file for all
attempts at extracting the zip file.

Bug: 11895788
Change-Id: I4170c2362aa8370fd13bc7bed62f2e6eb3223768
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
52eafa01b1e61e410cb4c5609eacee93c2a3e853 21-Nov-2013 Yohann Roussel <yroussel@google.com> Minor cleaning in the code and comment.

- Remove 2 unused method arguments.
- Fix a bad copy paste of a comment.
- Remove a useless if.

Change-Id: I1b88b91e38cbe3c024207113f1c4a7bdc052e514
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
1f8c349b6524aa39a10a570115ce0afb039bd06f 21-Nov-2013 Maurice Chu <mochu@google.com> Fix creation of zip file for multi-dex

Bug: 11791202
Change-Id: Ib8f97f11287a59db0ec119a1d55913aa8df3ce33
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
4be173048a01fb57f3c26b85fbff3c2bcf9a1267 13-Nov-2013 Yohann Roussel <yroussel@google.com> Merge "Control modTime of extracted files."
d9eda5550540306f2037e2db2aba2919fda90057 12-Nov-2013 Yohann Roussel <yroussel@google.com> Control modTime of extracted files.

And use it to clean more accuratly old extracted files.

Fix bug 11232823

Change-Id: I23678ae07a8df955276ece7b8c0cdddef907992b
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
edf0717d4203bd7e9c9435019e3c256d564b4583 12-Nov-2013 Yohann Roussel <yroussel@google.com> Keep time extracted entry to avoid multiple dexopt.

Fix bug 11415819

Change-Id: I1a1300f430f0db7b587e2f29c273884ef80f7fbe
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java
667f9a8a8155c41970a83be1414b57b5e37de336 16-Oct-2013 Maurice Chu <mochu@google.com> Initial move of code from frameworks/support/multidex to here

Also,
- Removed extraneous Eclipse-specific configuration files that are
unnecessary in the Android build tree
- Includes the patch to support API level 19 from
https://googleplex-android-review.git.corp.google.com/#/c/348129
- Checks for null and returns without patching the classloader when
getting the package manager or package name from the passed in Context
to MultiDex.install(...) since the Context object is probably a mock
context for testing.
- Moved the test runners to package com.android.test.runner, which seems
to be the standard place for all test runners.

Bug: 10674263
Change-Id: Idc894b360bd17db4acb50dd7daa2839ea8ea37e0
/frameworks/multidex/library/src/android/support/multidex/MultiDexExtractor.java