Add signing lineage for runtime_resource_overlay
Add ability to specify a signing lineage file for runtime_resource_overlay. Test: app_test.go Bug: 153366049 Change-Id: I68286bc0caa9daad6ef74db39f7750924f1d93dd
This commit is contained in:
@@ -1632,6 +1632,9 @@ type RuntimeResourceOverlayProperties struct {
|
|||||||
// module name in the form ":module".
|
// module name in the form ":module".
|
||||||
Certificate *string
|
Certificate *string
|
||||||
|
|
||||||
|
// Name of the signing certificate lineage file.
|
||||||
|
Lineage *string
|
||||||
|
|
||||||
// optional theme name. If specified, the overlay package will be applied
|
// optional theme name. If specified, the overlay package will be applied
|
||||||
// only when the ro.boot.vendor.overlay.theme system property is set to the same value.
|
// only when the ro.boot.vendor.overlay.theme system property is set to the same value.
|
||||||
Theme *string
|
Theme *string
|
||||||
@@ -1697,7 +1700,11 @@ func (r *RuntimeResourceOverlay) GenerateAndroidBuildActions(ctx android.ModuleC
|
|||||||
_, certificates := collectAppDeps(ctx, r, false, false)
|
_, certificates := collectAppDeps(ctx, r, false, false)
|
||||||
certificates = processMainCert(r.ModuleBase, String(r.properties.Certificate), certificates, ctx)
|
certificates = processMainCert(r.ModuleBase, String(r.properties.Certificate), certificates, ctx)
|
||||||
signed := android.PathForModuleOut(ctx, "signed", r.Name()+".apk")
|
signed := android.PathForModuleOut(ctx, "signed", r.Name()+".apk")
|
||||||
SignAppPackage(ctx, signed, r.aapt.exportPackage, certificates, nil, nil)
|
var lineageFile android.Path
|
||||||
|
if lineage := String(r.properties.Lineage); lineage != "" {
|
||||||
|
lineageFile = android.PathForModuleSrc(ctx, lineage)
|
||||||
|
}
|
||||||
|
SignAppPackage(ctx, signed, r.aapt.exportPackage, certificates, nil, lineageFile)
|
||||||
r.certificate = certificates[0]
|
r.certificate = certificates[0]
|
||||||
|
|
||||||
r.outputFile = signed
|
r.outputFile = signed
|
||||||
|
@@ -2745,6 +2745,7 @@ func TestRuntimeResourceOverlay(t *testing.T) {
|
|||||||
runtime_resource_overlay {
|
runtime_resource_overlay {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
certificate: "platform",
|
certificate: "platform",
|
||||||
|
lineage: "lineage.bin",
|
||||||
product_specific: true,
|
product_specific: true,
|
||||||
static_libs: ["bar"],
|
static_libs: ["bar"],
|
||||||
resource_libs: ["baz"],
|
resource_libs: ["baz"],
|
||||||
@@ -2799,6 +2800,11 @@ func TestRuntimeResourceOverlay(t *testing.T) {
|
|||||||
|
|
||||||
// Check cert signing flag.
|
// Check cert signing flag.
|
||||||
signedApk := m.Output("signed/foo.apk")
|
signedApk := m.Output("signed/foo.apk")
|
||||||
|
lineageFlag := signedApk.Args["flags"]
|
||||||
|
expectedLineageFlag := "--lineage lineage.bin"
|
||||||
|
if expectedLineageFlag != lineageFlag {
|
||||||
|
t.Errorf("Incorrect signing lineage flags, expected: %q, got: %q", expectedLineageFlag, lineageFlag)
|
||||||
|
}
|
||||||
signingFlag := signedApk.Args["certificates"]
|
signingFlag := signedApk.Args["certificates"]
|
||||||
expected := "build/make/target/product/security/platform.x509.pem build/make/target/product/security/platform.pk8"
|
expected := "build/make/target/product/security/platform.x509.pem build/make/target/product/security/platform.pk8"
|
||||||
if expected != signingFlag {
|
if expected != signingFlag {
|
||||||
|
Reference in New Issue
Block a user