Commit graph

6897 commits

Author SHA1 Message Date
Tianjie Xu
fd27983b62 Merge "Switch to use commandline parser" 2018-10-29 22:23:31 +00:00
Tianjie Xu
41cb6a65ac Merge "Clean up the zipfile creation in InstallTest" 2018-10-29 21:54:25 +00:00
Tianjie Xu
9f843e7751 Add description for the new translation
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
2018-10-29 14:43:44 -07:00
Tianjie Xu
f2fb49a3c4 Clean up the zipfile creation in InstallTest
Consolidate them into a static function.

Test: unit tests pass
Change-Id: If05b62215940b221fc499d779eedc5079f68a060
2018-10-29 12:04:13 -07:00
Tianjie Xu
aeec0b2076 Delete the dumpkey host tool
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
2018-10-29 11:14:09 -07:00
Tianjie Xu
edfeb97f9f Switch to use commandline parser
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
2018-10-29 11:01:36 -07:00
Tianjie Xu
64ceace44f Merge "Remove the load_keys function" 2018-10-25 17:25:49 +00:00
Tianjie Xu
6793f61795 Merge "Add sanity check when loading public keys for OTA package" 2018-10-25 04:03:23 +00:00
Tianjie Xu
cbe93e6506 Remove the load_keys function
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
2018-10-24 23:26:59 +00:00
Treehugger Robot
c17c819693 Merge "minui: Cleanup GRSurfaceDrm and MinuiBackendDrm." 2018-10-24 23:26:59 +00:00
Tianjie Xu
b5110de1b3 Add sanity check when loading public keys for OTA package
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
2018-10-24 16:25:09 -07:00
Bill Yi
0db98fa501 Merge pie-platform-release to aosp-master - DO NOT MERGE
Change-Id: Iabf1575f1a51c31cd567f9a9374cea70f0263952
2018-10-24 14:45:09 -07:00
Tao Bao
d096d7e5a9 minui: Cleanup GRSurfaceDrm and MinuiBackendDrm.
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
2018-10-24 09:38:34 -07:00
Treehugger Robot
47b650b588 Merge "ui: Add constness to Draw- functions." 2018-10-24 00:28:21 +00:00
Tianjie Xu
ee9c65a38e Merge "Add a function to construct the GRSurface in test" 2018-10-23 19:22:12 +00:00
Tianjie Xu
1e10cc4297 Add a function to construct the GRSurface in test
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
2018-10-23 12:10:46 -07:00
Tianjie Xu
06ccd00ef5 Merge "Add function to show localized rescue party menu" 2018-10-23 18:16:23 +00:00
Tao Bao
65815b6d3a ui: Add constness to Draw- functions.
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
2018-10-23 10:56:54 -07:00
Tao Bao
66a576b79c Merge "minui: Move GRSurface into a class." 2018-10-23 17:06:35 +00:00
Tianjie Xu
bfc7d43c00 Merge "Recovery now expects public keys in zipfile" 2018-10-23 02:40:55 +00:00
Tao Bao
92bdb5a389 minui: Move GRSurface into a class.
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
2018-10-22 18:18:02 -07:00
Tianjie Xu
b99e6069c1 Add function to show localized rescue party menu
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
2018-10-22 15:27:33 -07:00
Tianjie Xu
e1d02fb9ff Recovery now expects public keys in zipfile
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
2018-10-22 13:02:02 -07:00
Treehugger Robot
24ead5672b Merge "Fix instrumentation_for to refer to name of module" 2018-10-19 07:47:13 +00:00
Tianjie Xu
81ef25aada Merge "Load X509 keys from ziparchive"
am: a39b2baf12

Change-Id: I59164b7da1db44e3d7e79e095334f16552d873a0
2018-10-18 17:55:38 -07:00
Tianjie Xu
a39b2baf12 Merge "Load X509 keys from ziparchive" 2018-10-19 00:01:01 +00:00
Tianjie Xu
0dd9685311 Load X509 keys from ziparchive
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
2018-10-18 11:42:01 -07:00
Colin Cross
88dcca91dd Fix instrumentation_for to refer to name of module
The instrumentation_for property takes the name a module, not the
name of a class.

Test: m checkbuild
Change-Id: I4671ed7b42696eb023052655c0ce7997d2b754f8
2018-10-17 15:14:31 -07:00
Tao Bao
c9649eba5c Merge "uncrypt: fix ioctl direction for F2FS_IOC_GET_PIN_FILE"
am: b5564f37be

Change-Id: Iaceefb7360147954b4dd3a2eef1a0c8095236c8b
2018-10-15 18:28:38 -07:00
Tao Bao
b5564f37be Merge "uncrypt: fix ioctl direction for F2FS_IOC_GET_PIN_FILE" 2018-10-16 01:03:43 +00:00
Tianjie Xu
14177116ca Merge "Implement the graphic menus"
am: 06b1a89d72

Change-Id: Ia4dfbaa5847dd717801080927fdd39e8596b812e
2018-10-13 18:56:15 -07:00
Tianjie Xu
06b1a89d72 Merge "Implement the graphic menus" 2018-10-14 01:47:49 +00:00
Tianjie Xu
a74581a635 Merge "Use a host java program to generate the background text"
am: e4e929ce53

Change-Id: Ia2487ed1871da48781820ce5fa6a1ceced06b4e9
2018-10-12 22:30:07 -07:00
Tianjie Xu
e4e929ce53 Merge "Use a host java program to generate the background text" 2018-10-13 05:17:58 +00:00
Tianjie Xu
66dbf63080 Implement the graphic menus
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
2018-10-12 17:18:50 -07:00
Tianjie Xu
721f6792b4 Use a host java program to generate the background text
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
2018-10-12 15:46:32 -07:00
Tianjie Xu
3e4e6b3d68 Merge "Add function to load the key from x509.pem file"
am: ff89e0004f

Change-Id: I65c130a44de44406fc53e7480c186859ba6ce048
2018-10-12 13:40:17 -07:00
Tianjie Xu
ff89e0004f Merge "Add function to load the key from x509.pem file" 2018-10-12 20:24:48 +00:00
Tianjie Xu
8256698023 Add function to load the key from x509.pem file
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
2018-10-12 11:12:08 -07:00
Mark Salyzyn
9320e18f5d Merge "recovery: deprecate check for ro.build.system_root_image"
am: a67e9424c3

Change-Id: If63275e0112889b25668ad29b0429b4b3c27dfb2
2018-10-11 12:22:18 -07:00
Treehugger Robot
a67e9424c3 Merge "recovery: deprecate check for ro.build.system_root_image" 2018-10-11 19:04:29 +00:00
Mark Salyzyn
fdea242a91 recovery: deprecate check for ro.build.system_root_image
If there is a "/system" in the fstab, then can not be a
system as root image.

Test: compile
Bug: 109821005
Change-Id: I2c852dcbdcf6de437d39039937799feeef949516
2018-10-11 09:04:56 -07:00
Tom Cherry
70f3689a70 Merge "Use only signed/unsigned numbers with ParseInt/ParseUint respectively"
am: 1a4d234daa

Change-Id: I35a0d3de7dfafe382fbe203c3e7d74c1ea09ef26
2018-10-07 10:43:47 -07:00
Tom Cherry
1a4d234daa Merge "Use only signed/unsigned numbers with ParseInt/ParseUint respectively" 2018-10-07 17:31:34 +00:00
android-build-team Robot
8b508c984d Merge "Snap for 5053079 from ad81bd64c2 to pi-qpr2-release" into pi-qpr2-release 2018-10-06 03:22:49 +00:00
android-build-team Robot
5ccda7bcfb Snap for 5053079 from ad81bd64c2 to pi-qpr2-release
Change-Id: I0d3a832e597b1e4c35a7208bf23142ecbdc4c7cf
2018-10-06 03:07:53 +00:00
android-build-team Robot
7649f4c988 Snap for 5053079 from ad81bd64c2 to pi-qpr2-release
Change-Id: Iebf5692d87e2688649237b430908ac3f5e7f4e84
2018-10-06 03:04:47 +00:00
Tianjie Xu
ad81bd64c2 Merge changes from topic "am-88276146-0d74-467c-8b81-8d471d84ce66-nyc-mr2-dev" into oc-dev am: 7f1b33e94c am: fc311bb706
am: 31e8b44c9e

Change-Id: Ic5ced424323e58fe3f76651062f31ec158ae6805
2018-10-05 15:19:10 -07:00
Tianjie Xu
3c46516f9e Merge changes from topic "am-88276146-0d74-467c-8b81-8d471d84ce66" into oc-dev am: 2c28ae3933 am: d142b28c2b
am: a5860449c1

Change-Id: Ic2735740442410b5246eef6de3481b933f725416
2018-10-05 15:18:52 -07:00
Tianjie Xu
71b2447163 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412 skipped: 9216bccd16 skipped: 98acdb9fce skipped: bc42a6b0eb am: 35332d7c62 am: 6b13f89f15
am: 274945cb5b  -s ours

Change-Id: Ic5569d0abf7674ca5bee1b3df01170e69b6a0c1d
2018-10-05 15:18:31 -07:00