summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceParser.cpp
diff options
context:
space:
mode:
author Hao Ke <haok@google.com> 2021-10-12 20:00:00 +0000
committer Hao Ke <haok@google.com> 2021-10-23 01:41:42 +0000
commit4875dd14eb2d98e5c490f985977cfae5567dec17 (patch)
tree391c10320e3fffd86436fd6b9ee29fcc6f368d88 /tools/aapt2/ResourceParser.cpp
parentd6f306117ae252763093b5ecdf013e47364503a3 (diff)
Adding typed Parcel read APIs 2
Added typed read APIs of `readArray`, `readArrayList`, `readParcelableArray` and `readSparseArray`. To avoid unexpected types of objects being unparcelled, ideally clients would use the readTypedXXX() methods that take the parcelable creator. However, this won’t be an option for use cases involving deserializing children objects inherited from non-final parcelable or serializable objects. Currently out of ~4k parcelable classes, only ~1.5k are marked as “final” in the platform. Hence it would be necessary to introduce new replacements that take an extra Class<T> parameter and before deserializing we check that the class written on the wire is the same or a descendant from the one provided as argument. Doing so could enhance the security of Parcel deserialization, More details can be found at go/safer-parcel. Test: atest -d android.os.cts.ParcelTest Bug: 195622897 Change-Id: Iaba24c35a0c0acc77ae2d22ac77c5a90efd93329
Diffstat (limited to 'tools/aapt2/ResourceParser.cpp')
0 files changed, 0 insertions, 0 deletions