Add signing certificate lineage support to soong
(This is a cherry pick.) Test: app_test Bug: 153366049 Merged-In: I65a92d6c40057dcc01950991fb7be485de1c9080 Change-Id: I65a92d6c40057dcc01950991fb7be485de1c9080
This commit is contained in:
15
java/app.go
15
java/app.go
@@ -129,6 +129,9 @@ type overridableAppProperties struct {
|
||||
// or an android_app_certificate module name in the form ":module".
|
||||
Certificate *string
|
||||
|
||||
// Name of the signing certificate lineage file.
|
||||
Lineage *string
|
||||
|
||||
// the package name of this app. The package name in the manifest file is used if one was not given.
|
||||
Package_name *string
|
||||
|
||||
@@ -596,13 +599,17 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
|
||||
// Build a final signed app package.
|
||||
packageFile := android.PathForModuleOut(ctx, a.installApkName+".apk")
|
||||
CreateAndSignAppPackage(ctx, packageFile, a.exportPackage, jniJarFile, dexJarFile, certificates, apkDeps)
|
||||
var lineageFile android.Path
|
||||
if lineage := String(a.overridableAppProperties.Lineage); lineage != "" {
|
||||
lineageFile = android.PathForModuleSrc(ctx, lineage)
|
||||
}
|
||||
CreateAndSignAppPackage(ctx, packageFile, a.exportPackage, jniJarFile, dexJarFile, certificates, apkDeps, lineageFile)
|
||||
a.outputFile = packageFile
|
||||
|
||||
for _, split := range a.aapt.splits {
|
||||
// Sign the split APKs
|
||||
packageFile := android.PathForModuleOut(ctx, a.installApkName+"_"+split.suffix+".apk")
|
||||
CreateAndSignAppPackage(ctx, packageFile, split.path, nil, nil, certificates, apkDeps)
|
||||
CreateAndSignAppPackage(ctx, packageFile, split.path, nil, nil, certificates, apkDeps, lineageFile)
|
||||
a.extraOutputFiles = append(a.extraOutputFiles, packageFile)
|
||||
}
|
||||
|
||||
@@ -1299,7 +1306,7 @@ func (a *AndroidAppImport) generateAndroidBuildActions(ctx android.ModuleContext
|
||||
}
|
||||
a.certificate = certificates[0]
|
||||
signed := android.PathForModuleOut(ctx, "signed", apkFilename)
|
||||
SignAppPackage(ctx, signed, dexOutput, certificates)
|
||||
SignAppPackage(ctx, signed, dexOutput, certificates, nil)
|
||||
a.outputFile = signed
|
||||
} else {
|
||||
alignedApk := android.PathForModuleOut(ctx, "zip-aligned", apkFilename)
|
||||
@@ -1558,7 +1565,7 @@ func (r *RuntimeResourceOverlay) GenerateAndroidBuildActions(ctx android.ModuleC
|
||||
_, certificates := collectAppDeps(ctx, false, false)
|
||||
certificates = processMainCert(r.ModuleBase, String(r.properties.Certificate), certificates, ctx)
|
||||
signed := android.PathForModuleOut(ctx, "signed", r.Name()+".apk")
|
||||
SignAppPackage(ctx, signed, r.aapt.exportPackage, certificates)
|
||||
SignAppPackage(ctx, signed, r.aapt.exportPackage, certificates, nil)
|
||||
r.certificate = certificates[0]
|
||||
|
||||
r.outputFile = signed
|
||||
|
Reference in New Issue
Block a user