Skip DM path validation if it's handled by ART Service.
Currently, Package Manager shell handler validates DM paths against
corresponding APK paths, so that the user can only install "xxx.dm"
through the "pm install" ("adb install-multiple") shell command if there
is "xxx.apk" that corresponds to it. This validation is done through a
legacy method `DexMetadataHelper.validateDexPaths`, which prevents us
from removing the legacy code. The CLs in this topic moves this logic to
ART Service, enabling us to do the cleanup later.
This change results in slight behavior changes described below, but
nothing fundamental.
Installation through shell ("adb install-multiple"):
Before:
- Installation with unmatched dm files succeeds.
- Unmatched dm files are installed and never used by ART.
- "pm install" prints a warning and returns zero.
- "adb install-multiple" does a string comparison between the
"pm install" output and "Success". Because the output is a warning +
"Success", "adb install-multiple" prints "adb: failed to finalize
session" and returns non-zero.
After:
- Installation with unmatched dm files succeeds.
- Unmatched dm files are **deleted** during installation.
- "pm install" prints a warning and returns **non-zero**.
- "adb install-multiple" does a string comparison between the
"pm install" output and "Success". Because the output is a "Completed
with warning(s)", "adb install-multiple" prints "adb: failed to
finalize session" and returns non-zero, same as before.
Installation through Java API (e.g., app stores):
Before:
- Installation with unmatched dm files succeeds.
- Unmatched dm files are installed and never used by ART.
- No validation takes place (because the validation is only in the shell
handler).
After:
- Installation with unmatched dm files succeeds.
- Unmatched dm files are **deleted** during installation.
- Package Manager gives a warning through the result Intent, but there
is currently no API for the user to get this warning.
Bug: 258223472
Test: adb install
Flag: com.android.art.flags.art_managed_install_files_validation_api
Change-Id: I16a24bfe47e551b97da93c44948aa9f5e1d5a480
Loading
Please register or sign in to comment