diff options
author | 2024-12-08 18:22:45 +0000 | |
---|---|---|
committer | 2024-12-08 18:30:28 +0000 | |
commit | af8a3f5eaf70b817e43ab8e0a4908a7a5025c85f (patch) | |
tree | 9e63a31897406478b9a67a37e54836d4b203a627 | |
parent | d2505873e521984f6d4732d4acd9f87fe338d159 (diff) |
Bugfix for LOCAL_CERTIFICATE of AutogeneratedRuntimeResourceOverlay
LOCAL_CERTIFICATE of these modules are currently set to `PRESIGNED`,
since soong generates the build rules to sign the apk.
However, this is an incorrect interpretation of `PRESIGNED`. This
keyword means that the apk was signed with a release key, and not dev
keys. Since Soong signs the autogenerated rros with dev keys, drop
`PRESIGNED` from `LOCAL_CERTIFICATE` and replace it with the dev key
string.
Test: verified that `LOCAL_CERTIFICATE` of
`Settings__aosp_cf_x86_64_phone__auto_generated_rro_vendor` in the
autogenerated Android.mk is no longer PRESIGNED.
Bug: 375277835
Change-Id: I024f88f9ee887323e93df8338af5f8b089025b93
-rw-r--r-- | java/androidmk.go | 2 | ||||
-rw-r--r-- | java/rro.go | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/java/androidmk.go b/java/androidmk.go index b6bab5332..039e847a7 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -408,7 +408,7 @@ func (a *AutogenRuntimeResourceOverlay) AndroidMkEntries() []android.AndroidMkEn Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk", ExtraEntries: []android.AndroidMkExtraEntriesFunc{ func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { - entries.SetString("LOCAL_CERTIFICATE", "PRESIGNED") // The apk will be signed by soong + entries.SetString("LOCAL_CERTIFICATE", a.certificate.AndroidMkString()) }, }, }} diff --git a/java/rro.go b/java/rro.go index d277e4ab7..ab4fafa7f 100644 --- a/java/rro.go +++ b/java/rro.go @@ -290,7 +290,8 @@ type AutogenRuntimeResourceOverlay struct { properties AutogenRuntimeResourceOverlayProperties - outputFile android.Path + certificate Certificate + outputFile android.Path } type AutogenRuntimeResourceOverlayProperties struct { @@ -380,7 +381,8 @@ func (a *AutogenRuntimeResourceOverlay) GenerateAndroidBuildActions(ctx android. return } // Sign the built package - _, certificates := processMainCert(a.ModuleBase, "", nil, ctx) + var certificates []Certificate + a.certificate, certificates = processMainCert(a.ModuleBase, "", nil, ctx) signed := android.PathForModuleOut(ctx, "signed", a.Name()+".apk") SignAppPackage(ctx, signed, a.exportPackage, certificates, nil, nil, "") a.outputFile = signed |