As we localize the wipe data menu under the recovery mode, some
additional strings need the new translation. The strings include
1. The menu header that prompts a data wipe
2. Try again description
3. Factory reset description
4. The menu header to confirm a data wipe
5. Cancel description
We will resue the "Factory reset description" in the confirmation menu;
and the image_generator tool will be moved to this directory in later
cls.
Bug: 74397117
Test: mma
Change-Id: I706b8677dba506b62e890f6b200e3eb3b11ce483
We used to dump the public key files into some text format; and parse
them under recovery. But now we have switched to read the certificates
directly from the zip files; and there's no caller of this dumpkey host
tool any more.
Bug: 116655889
Test: mma
Change-Id: I115592e2a894b3375495c81cb249d1bed1a5d973
The commandline parser adds some flexibility to the argument parsing. It
also makes the help message more descriptive.
Bug: 74397117
Test: generate a image, checks the help message
Change-Id: Ib238658a9a6fa8806f1b0dde419c8fb970e7cb37
This function is used to parse the result of dumpKeys. It's no longer
needed as we are now parsing the public keys from the zipfile.
Bug: 116655889
Test: unit tests pass
Change-Id: I817906e451664058c644f4329ff499bbe4587ebb
For RSA keys, check if it has a 2048 bits modulus, and its public
exponent is 3 or 65537. For EC keys, check if the field size is 256
bits for its curve.
Bug: 116655889
Test: unit tests pass
Change-Id: I5c00f4d2b61c98c434f0b49db232155d5d0770ec
This CL adds a dtor to GRSurfaceDrm that handles the resource
deallocation. It also manages MinuiBackendDrm::GRSurfaceDrms with smart
pointers.
Test: Build and boot into recovery on blueline. `Run graphics test`.
Change-Id: Iff7bbdddbc0b5ab16483d00870794fca9f832bd5
This fixes the build error as the initializer list no longer work
without the proper constructor for c++ class.
Bug: 74397117
Test: unit tests pass
Change-Id: If3ff508a1a01ad5326413dab8e05bacae8a946c8
These functions take the given GRSurface instances as inputs, which
shouldn't be altered.
Test: mmma -j bootable/recovery
Test: Run recovery_unit_test.
Test: `Run graphics test` on marlin.
Change-Id: I51bf408e85faae2b497d4f148ab1dec22dd16c93
This CL adds GRSurface::Create() and dtor for managing the allocated
memory in GRSurface class. It also adds GRSurface::data() that hides the
underlying implementation, with both of const and non-const overloads.
This allows `const GRSurface&` to be more useful - previously it only
ensured a const member variable of `data`, instead of a read-only buffer
it points to.
It also marks the parameters in gr_texticon() and gr_blit() as const, as
they're incoming source that shouldn't be altered. It corrects the type
of gr_draw, which is the sink to be painted on (an earlier attempt was
made in [1], but didn't get the full picture correctly).
[1] https://android-review.googlesource.com/c/platform/bootable/recovery/+/704757/
Test: mmma -j bootable/recovery
Test: recovery_unit_test on marlin
Test: Run graphics test on marlin (fbdev).
Test: Run graphics test on blueline (drm).
Change-Id: I7904df084cd6c08fa04a9da97d01b4b1a6e3a20c
Add a function in screenUI to display the pre-generated graphs for
rescue party. If these graphs are not valid, falls back to display
the old text strings.
Right now we haven't generated the localized graphs yet, so the UI
always shows the TextMenu.
Bug: 116655889
Test: check rescue party under recovery
Change-Id: I0558cb536b659cdc25c8b7946d3a39820935b003
This is in line with the build system change which copies the recovery ota
install keys to a zipfile. And now recovery will parses and loads the public
keys from /res/otacerts.zip. The legacy load_keys functions will be
removed in later cls.
Bug: 116655889
Test: sideload an ota package
Change-Id: I95e91736ca9964df06d74aa292d672e2f9e442e8
Add a function to parse the zip archive and load the certificate from
all the zip entries with the suffix "x509.pem".
Bug: 116655889
Test: unittests pass
Change-Id: I93bf7aef7462c0623e89fc2d466d7af2d3a758bc
The instrumentation_for property takes the name a module, not the
name of a class.
Test: m checkbuild
Change-Id: I4671ed7b42696eb023052655c0ce7997d2b754f8
As we plan to show localized rescue party dialogs under recovery mode
with pre-generated images, it becomes necessary to show the menu headers
and items with images.
This cl converts the menu class to a interface and derived TextMenu &
GraphicMenu classes. And the GraphicMenu uses GRSurfaces* as the menu header
and a list of GRSurfaces* as menu items.
Moreover, factor out the Draw* functions in the ScreenUI into a separate
DrawInterface. Therefore, the Menu class can access these draw functions and
use them to implement the DrawHeaders & DrawItems neatly.
Bug: 74397117
Test: unittests pass, boot into recovery and check menu
Change-Id: I95cee30f3e5eb666eb6fbcdfc873a7260fc177c1
This program uses java.awt.Graphics2D to generate the background text
files used under recovery mode. And thus we don't need to do the manual
work by running emulators with different dpi.
The program takes the following parameters:
1. imageWidth: The number of pixels per line; and the text strings will be
wrapped accordingly.
2. textName: The description of the text string, e.g. "recovery_erasing",
"recovery_installing_security"
3. fontDirectory: The directory that contains all the support .ttf | .ttc
files, e.g. $OUT/system/fonts/
4. resourceDirectory: The resource directory that contains all the translated
strings in xml format, e.g. bootable/recovery/tools/recovery_l10n/res/
5. outputFilename: Path to the generated image.
Bug: 74397117
Test: checks the generated png files
Change-Id: Ia5506a0a4f5da1ebfd7090345eb246f44b265075
We used to convert a pem certificate file to some intermediate plain
text format; and parse that format under recovery mode. This is
uncessary since the x509.pem can be directly parsed with openssl
functions.
Add the function to load the public key from one x509.pem file and
corresponding unit tests. And we will add more cls to extract the pem
files from otacert.zip later.
Bug: 116655889
Test: verify package with 5 supported certficate versions
Change-Id: Ibc6c696c534567f005db75143cc4ef8d4bdea6a0
If there is a "/system" in the fstab, then can not be a
system as root image.
Test: compile
Bug: 109821005
Change-Id: I2c852dcbdcf6de437d39039937799feeef949516