Merge "Add libs for BuildManifest.apk generation" into main

This commit is contained in:
Inseob Kim 2024-04-04 00:43:31 +00:00 committed by Gerrit Code Review
commit 4caca1d797

View file

@ -27,6 +27,9 @@ type fsverityProperties struct {
// etc/security/fsverity/BuildManifest.apk will also be generated which contains information
// about generated .fsv_meta files.
Inputs []string
// APK libraries to link against, for etc/security/fsverity/BuildManifest.apk
Libs []string `android:"path"`
}
func (f *filesystem) writeManifestGeneratorListFile(ctx android.ModuleContext, outputPath android.OutputPath, matchedSpecs []android.PackagingSpec, rebasedDir android.OutputPath) {
@ -117,20 +120,20 @@ func (f *filesystem) buildFsverityMetadataFiles(ctx android.ModuleContext, build
aapt2Path := ctx.Config().HostToolPath(ctx, "aapt2")
apkPath := rebasedDir.Join(ctx, "etc", "security", "fsverity", "BuildManifest.apk")
manifestTemplatePath := android.PathForSource(ctx, "system/security/fsverity/AndroidManifest.xml")
// package-export is currently generated by Makefile.
// TODO(b/330282551): fully migrate into Soong
frameworkResPath := android.PathForArbitraryOutput(ctx, "target/common/obj/APPS/framework-res_intermediates/package-export.apk")
libs := android.PathsForModuleSrc(ctx, f.properties.Fsverity.Libs)
cmd.Implicit(aapt2Path)
cmd.Implicit(manifestTemplatePath)
cmd.Implicit(frameworkResPath)
cmd.Implicits(libs)
sb.WriteString(aapt2Path.String())
sb.WriteString(" link -o ")
sb.WriteString(apkPath.String())
sb.WriteString(" -A ")
sb.WriteString(assetsPath.String())
sb.WriteString(" -I ")
sb.WriteString(frameworkResPath.String())
for _, lib := range libs {
sb.WriteString(" -I ")
sb.WriteString(lib.String())
}
minSdkVersion := ctx.Config().PlatformSdkCodename()
if minSdkVersion == "REL" {
minSdkVersion = ctx.Config().PlatformSdkVersion().String()