Enable prebuilt apk checks
Now that existing violations set the skip flag. Bug: 185811447 Test: Presubmits Change-Id: Ia513b71be1cd878f36fdb28c94ef3cdc3f2a6bc6
This commit is contained in:
@@ -335,12 +335,11 @@ func (a *AndroidAppImport) generateAndroidBuildActions(ctx android.ModuleContext
|
|||||||
|
|
||||||
if proptools.Bool(a.properties.Preprocessed) {
|
if proptools.Bool(a.properties.Preprocessed) {
|
||||||
output := srcApk
|
output := srcApk
|
||||||
// TODO(b/185811447) Uncomment this after all existing failing apks set skip_preprocessed_apk_checks: true
|
if !proptools.Bool(a.properties.Skip_preprocessed_apk_checks) {
|
||||||
//if !proptools.Bool(a.properties.Skip_preprocessed_apk_checks) {
|
writableOutput := android.PathForModuleOut(ctx, "validated-prebuilt", apkFilename)
|
||||||
// writableOutput := android.PathForModuleOut(ctx, "validated-prebuilt", apkFilename)
|
a.validatePreprocessedApk(ctx, srcApk, writableOutput)
|
||||||
// a.validatePreprocessedApk(ctx, srcApk, writableOutput)
|
output = writableOutput
|
||||||
// output = writableOutput
|
}
|
||||||
//}
|
|
||||||
a.outputFile = output
|
a.outputFile = output
|
||||||
a.certificate = PresignedCertificate
|
a.certificate = PresignedCertificate
|
||||||
} else if !Bool(a.properties.Presigned) {
|
} else if !Bool(a.properties.Presigned) {
|
||||||
|
@@ -657,29 +657,28 @@ func TestAndroidTestImport_Preprocessed(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(b/185811447) Uncomment this after all existing failing apks set skip_preprocessed_apk_checks: true
|
func TestAndroidAppImport_Preprocessed(t *testing.T) {
|
||||||
//func TestAndroidAppImport_Preprocessed(t *testing.T) {
|
ctx, _ := testJava(t, `
|
||||||
// ctx, _ := testJava(t, `
|
android_app_import {
|
||||||
// android_app_import {
|
name: "foo",
|
||||||
// name: "foo",
|
apk: "prebuilts/apk/app.apk",
|
||||||
// apk: "prebuilts/apk/app.apk",
|
presigned: true,
|
||||||
// presigned: true,
|
preprocessed: true,
|
||||||
// preprocessed: true,
|
}
|
||||||
// }
|
`)
|
||||||
// `)
|
|
||||||
//
|
apkName := "foo.apk"
|
||||||
// apkName := "foo.apk"
|
variant := ctx.ModuleForTests("foo", "android_common")
|
||||||
// variant := ctx.ModuleForTests("foo", "android_common")
|
outputBuildParams := variant.Output("validated-prebuilt/" + apkName).BuildParams
|
||||||
// outputBuildParams := variant.Output("validated-prebuilt/" + apkName).BuildParams
|
if outputBuildParams.Rule.String() != android.Cp.String() {
|
||||||
// if outputBuildParams.Rule.String() != android.Cp.String() {
|
t.Errorf("Unexpected prebuilt android_app_import rule: " + outputBuildParams.Rule.String())
|
||||||
// t.Errorf("Unexpected prebuilt android_app_import rule: " + outputBuildParams.Rule.String())
|
}
|
||||||
// }
|
|
||||||
//
|
// Make sure compression and aligning were validated.
|
||||||
// // Make sure compression and aligning were validated.
|
if len(outputBuildParams.Validations) != 2 {
|
||||||
// if len(outputBuildParams.Validations) != 2 {
|
t.Errorf("Expected compression/alignment validation rules, found %d validations", len(outputBuildParams.Validations))
|
||||||
// t.Errorf("Expected compression/alignment validation rules, found %d validations", len(outputBuildParams.Validations))
|
}
|
||||||
// }
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
func TestAndroidTestImport_UncompressDex(t *testing.T) {
|
func TestAndroidTestImport_UncompressDex(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
|
Reference in New Issue
Block a user