Previous parser relied on text output of `aapt2/ dump xmltree` and `aapt2 dump resources` commands,
which is not meant for parsing.
This led to multiple parsing bugs: cutoff multiline strings, floating point parsing issues,
quoting issues, non-English locale issues etc.
Rewritten parser instead relies on protobuf aapt2 output, which allows to resolve most of these
issues.
A simple patch to aapt2 in frameworks/base is required to slightly expand its protobuf output.
Other notable changes:
- support for the "fraction" resource type
- parsing is now parallelized at APK level
This commit adds an extra step to generate-all:
- if --updateSpec flag is specified, FileTreeSpec of the generated vendor module is written out
to vendor-specs/$VENDOR/$DEVICE.yaml file ("reference FileTreeSpec").
- if --updateSpec is not specified, FileTreeSpec of the generated vendor module is compared against
the reference FileTreeSpec. If there are any differences, generated vendor module is deleted and an
exception is thrown.
Also, when --updateSpec flag is used, text files inside vendor module are written out to
vendor-skels/$VENDOR/$DEVICE directory.
Contents of vendor-skels/ are useful for keeping track of vendor module changes via git and for
showing diffs in case text files in the generated module don't match the reference ones.
These directives are usually very large and are less interesting than PRODUCT_<partition>_PROPERTIES,
PRODUCT_OVERRIDE_FINGERPRINT variables. Move them to the bottom to improve readability.
- pass device config with the standard -d flag instead of through argument
- default to using factory and OTA images for current build ID when --stockSrc is not specified
- add extract_android_ota_payload.py as the final step, with an option to skip it
- pass device config with the standard -d flag instead of through argument. This allows to specify
multiple devices without using DeviceList config file
- default to using factory image for current build ID when --stockSrc is not specified
- support unpacking factory images without root by using debugfs rdump (ext4) and
fsck.erofs --extract (erofs)
- support reusing unpacked factory images between adevtool runs to reduce latency
- unpack factory images for multiple devices in parallel. Extraction of files from partition images
is parallelized too
- extract partition images from factory image inner zip directly, without extracting it, since this
inner zip is uncompressed
- define a default download directory
- obtain image URL and checksum from the Git-tracked local build index instead of fetching it from
remote server
- default to downloading images for the current build ID
- download image to a temporary file first, mark it as complete only after checksum verification
Extracts the following image properties:
- device name
- build ID
- build desctiption
- image download link
- image file SHA-256
Images are grouped by '$DEVICE $BUILD_ID' key.
Beta factory/OTA image pages are supported too.
JSDOM dependency is added for simple and correct parsing of these pages.
- support specifying device{,-list} config with config file name instead of config path
- support loading mutliple device{,-list} configs at once. Previously, loading multiple device
configs was supported only by passing a device-list config
- parallelize config loading with promises
Instead of hardcoding the list of devices (which is now missing lynx), check whether
vendor_kernel_boot is present in the list of stock A/B partitions.
The partition check for conflicts fails when we have cross-partition
conflicts, as the same-partition module may also be a conflict.
To fix the issue, keep a separate map of all candidate modules with the
same name and check all of them for duplicate entries, even if some fail
the partition check.