Remove support for stripping dex.
Stripping is incompatible with ART module updatability. Bug: 65154345 Bug: 138851227 Test: build and observe no change in output (stripping is not used by default). Change-Id: I4bbc01d9979605b7dd2f73ee99a74c1e817c3e8c
This commit is contained in:
@@ -1149,13 +1149,7 @@ func TestAndroidAppImport_Presigned(t *testing.T) {
|
||||
variant.MaybeOutput("dexpreopt/oat/arm64/package.odex").Rule == nil {
|
||||
t.Errorf("can't find dexpreopt outputs")
|
||||
}
|
||||
// Make sure stripping wasn't done.
|
||||
stripRule := variant.Output("dexpreopt/foo.apk")
|
||||
if !strings.HasPrefix(stripRule.RuleParams.Command, "cp -f") {
|
||||
t.Errorf("unexpected, non-skipping strip command: %q", stripRule.RuleParams.Command)
|
||||
}
|
||||
|
||||
// Make sure signing was skipped and aligning was done instead.
|
||||
// Make sure signing was skipped and aligning was done.
|
||||
if variant.MaybeOutput("signed/foo.apk").Rule != nil {
|
||||
t.Errorf("signing rule shouldn't be included.")
|
||||
}
|
||||
|
@@ -40,13 +40,9 @@ type dexpreopter struct {
|
||||
|
||||
type DexpreoptProperties struct {
|
||||
Dex_preopt struct {
|
||||
// If false, prevent dexpreopting and stripping the dex file from the final jar. Defaults to
|
||||
// true.
|
||||
// If false, prevent dexpreopting. Defaults to true.
|
||||
Enabled *bool
|
||||
|
||||
// If true, never strip the dex files from the final jar when dexpreopting. Defaults to false.
|
||||
No_stripping *bool
|
||||
|
||||
// If true, generate an app image (.art file) for this module.
|
||||
App_image *bool
|
||||
|
||||
@@ -136,8 +132,6 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo
|
||||
|
||||
dexLocation := android.InstallPathToOnDevicePath(ctx, d.installPath)
|
||||
|
||||
strippedDexJarFile := android.PathForModuleOut(ctx, "dexpreopt", dexJarFile.Base())
|
||||
|
||||
var profileClassListing android.OptionalPath
|
||||
var profileBootListing android.OptionalPath
|
||||
profileIsTextListing := false
|
||||
@@ -191,10 +185,6 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo
|
||||
ForceCreateAppImage: BoolDefault(d.dexpreoptProperties.Dex_preopt.App_image, false),
|
||||
|
||||
PresignedPrebuilt: d.isPresignedPrebuilt,
|
||||
|
||||
NoStripping: Bool(d.dexpreoptProperties.Dex_preopt.No_stripping),
|
||||
StripInputPath: dexJarFile,
|
||||
StripOutputPath: strippedDexJarFile.OutputPath,
|
||||
}
|
||||
|
||||
dexpreoptRule, err := dexpreopt.GenerateDexpreoptRule(ctx, global, dexpreoptConfig)
|
||||
@@ -207,13 +197,5 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo
|
||||
|
||||
d.builtInstalled = dexpreoptRule.Installs().String()
|
||||
|
||||
stripRule, err := dexpreopt.GenerateStripRule(global, dexpreoptConfig)
|
||||
if err != nil {
|
||||
ctx.ModuleErrorf("error generating dexpreopt strip rule: %s", err.Error())
|
||||
return dexJarFile
|
||||
}
|
||||
|
||||
stripRule.Build(pctx, ctx, "dexpreopt_strip", "dexpreopt strip")
|
||||
|
||||
return strippedDexJarFile
|
||||
return dexJarFile
|
||||
}
|
||||
|
Reference in New Issue
Block a user