diff options
author | Ulya Trafimovich <skvadrik@google.com> | 2021-02-11 16:58:25 +0000 |
---|---|---|
committer | Ulya Trafimovich <skvadrik@google.com> | 2021-02-11 17:09:19 +0000 |
commit | 8edad8f7a32197331b5aaddd2ceacad287943b3f (patch) | |
tree | c87d2eae47f3636777cb5b797f7a8d53a7b0b2dc /common | |
parent | b976c07d8542d6b45ef93171d539b09266385def (diff) | |
download | build-8edad8f7a32197331b5aaddd2ceacad287943b3f.tar.gz |
Preserve <uses-library> order in dexpreopt.config files.
Library order is important because it is used to construct class loader
context, which is then written into OAT/ODEX files and chacked against
class loader context constructed by PackageManager on the device. If the
orders are different, dexpreopted code is rejected.
This CL fixes a few problems that caused reordering:
- 'filter' function arguments are swapped so that patterns list comes
first, and the library list second
- JSON representation of class loader context is changed to avoid
unmarshaling it to Go maps, which may reorder keys
- library list is no longer sorted (it's unclear why it was sorted)
Bug: 132357300
Test: lunch cf_x86_64_phone-userdebug && m && launch_cvd \
adb wait-for-device && adb root && adb logcat \
| grep -E 'ClassLoaderContext [a-z ]+ mismatch'
# empty grep output, no errors
Change-Id: Ie76996d497e60da0948f1879d6db589ff3e968a2
Diffstat (limited to 'common')
-rw-r--r-- | common/json.mk | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/common/json.mk b/common/json.mk index ba8ffa73ec..e376aab487 100644 --- a/common/json.mk +++ b/common/json.mk @@ -24,7 +24,10 @@ add_json_list =$= $(call add_json_val,$(1),$(call json_list,$(patsubst %,%,$(2)) add_json_csv =$= $(call add_json_val,$(1),$(call csv_to_json_list,$(strip $(2)))) add_json_bool =$= $(call add_json_val,$(1),$(if $(strip $(2)),true,false)) add_json_map =$= $(eval _json_contents := $$(_json_contents)$$(_json_indent)"$$(strip $$(1))": {$$(newline))$(json_increase_indent) +add_json_map_anon =$= $(eval _json_contents := $$(_json_contents)$$(_json_indent){$$(newline))$(json_increase_indent) end_json_map =$= $(json_decrease_indent)$(eval _json_contents := $$(_json_contents)$$(if $$(filter %$$(comma),$$(lastword $$(_json_contents))),__SV_END)$$(_json_indent)},$$(newline)) +add_json_array =$= $(eval _json_contents := $$(_json_contents)$$(_json_indent)"$$(strip $$(1))": [$$(newline))$(json_increase_indent) +end_json_array =$= $(json_decrease_indent)$(eval _json_contents := $$(_json_contents)$$(if $$(filter %$$(comma),$$(lastword $$(_json_contents))),__SV_END)$$(_json_indent)],$$(newline)) # Clears _json_contents to start a new json file json_start =$= $(eval _json_contents := {$$(newline))$(eval _json_indent := $$(4space)) |