From 3dbda18e808f79bb94d57b645f686a9f737cdc76 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Mon, 20 May 2024 22:23:10 +0000 Subject: Use r8/d8 optimized profile for dexpreopt Currently, dexpreopt supports profile guided optimization. This does not work well with r8/d8 optimization, since the checked-in profile will not match the dex signatures after r8/d8 has optimized the dex code. This CL introduces a new property `dex_preopt.enable_profile_rewrting`. If set, the checked-in profile will passed as `input` to r8 via `--art-profile `. The from the previous command will be used as the profile for dexpreopt. Test: m nothing --no-skip-soong-tests Test: m CredentialManager with https://ag.corp.google.com/27448930 and obfuscation turned on Test: nm -U symbol.odex # contains obfuscated methods Bug: 335418838 Change-Id: I53beed9ed76f013262f1c503de0f2b74997c2a7f --- java/java.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 9fe7a2ff8..9fa6175ef 100644 --- a/java/java.go +++ b/java/java.go @@ -2339,7 +2339,7 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) { classesJar: al.stubsJar, jarName: ctx.ModuleName() + ".jar", } - dexOutputFile := al.dexer.compileDex(ctx, dexParams) + dexOutputFile, _ := al.dexer.compileDex(ctx, dexParams) uncompressed := true al.initHiddenAPI(ctx, makeDexJarPathFromPath(dexOutputFile), al.stubsJar, &uncompressed) dexOutputFile = al.hiddenAPIEncodeDex(ctx, dexOutputFile) @@ -2723,7 +2723,7 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { jarName: jarName, } - dexOutputFile = j.dexer.compileDex(ctx, dexParams) + dexOutputFile, _ = j.dexer.compileDex(ctx, dexParams) if ctx.Failed() { return } -- cgit v1.2.3-59-g8ed1b