New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 625704 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocked on:
issue 618470



Sign in to add a comment

Turn on proguard optimizations for com.google.android.apps.chrome, org.chromium

Project Member Reported by smaier@chromium.org, Jul 4 2016

Issue description

We want to turn on Proguard optimizations for the rule -keepnames class com.google.android.apps.chrome.**, org.chromium.**.

This doc outlines some options:

https://docs.google.com/a/google.com/document/d/1e5mK5TYeExE0vEnfoyDe5GwYaDw4ZF-vqtIYRmu6cpQ/edit?usp=sharing
 
https://docs.google.com/a/chromium.org/document/d/1d5sdySupDAbxN6aw3F7Ry-NjdS8uaHKGecHnaoM8sFc/edit?usp=sharing

New document, public access. This is the one which will be updated, not the one in the original post.
Cc: torne@chromium.org boliu@chromium.org
Status: Assigned (was: Untriaged)
+torne/boliu who would be interested in implications for webview.
Err, I realize this particular change affects chrome but there's still monochrome and we'd want to understand whether to apply something similar for them

Comment 4 by boliu@chromium.org, Jul 6 2016

Cc: -boliu@chromium.org hush@chromium.org
I don't actually know much detail. torne said he ran into too many things being stripped from webview (since webview has entry points from android different from regular apps I guess?). hush looked at this a bit too

Comment 5 by torne@chromium.org, Jul 8 2016

As long as this will only affect Chrome and not Monochrome or WebView it's fine to go ahead, but we've had lots of problems doing anything different with proguard in webview in the past, and have a *very* different config to chrome at present as a result (including many things that seem like bugs in proguard). We should probably look into this more at some point :/
Blockedon: 618470
Project Member

Comment 7 by bugdroid1@chromium.org, Jul 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1a09539d6fb37c06bc73ce348f6f7ea85ddacfa4

commit 1a09539d6fb37c06bc73ce348f6f7ea85ddacfa4
Author: smaier <smaier@chromium.org>
Date: Fri Jul 08 20:14:00 2016

Added deobfuscation script for ProGuarded stacktraces

BUG= 625704 

Review-Url: https://codereview.chromium.org/2126353002
Cr-Commit-Position: refs/heads/master@{#404476}

[add] https://crrev.com/1a09539d6fb37c06bc73ce348f6f7ea85ddacfa4/build/android/stacktrace/java_deobfuscate.py

Project Member

Comment 8 by bugdroid1@chromium.org, Jul 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/05c799ee764fef9d63b4e45c4fba22145f96fed3

commit 05c799ee764fef9d63b4e45c4fba22145f96fed3
Author: smaier <smaier@chromium.org>
Date: Thu Jul 14 17:09:36 2016

Creating new gn arg: enable_all_proguard_optimizations.

If we wish to turn on optimizations for our main code base, we need to
first make sure that these optimizations don't break our instrumentation
tests when inlining functions. To do this, we make a gn arg which will guard
our instrumentation tests and only allow them to run without this
flag. This flag will then be the thing that turns on these Proguard
optimizations.

BUG= 625704 

Review-Url: https://codereview.chromium.org/2123753005
Cr-Commit-Position: refs/heads/master@{#405509}

[modify] https://crrev.com/05c799ee764fef9d63b4e45c4fba22145f96fed3/BUILD.gn
[modify] https://crrev.com/05c799ee764fef9d63b4e45c4fba22145f96fed3/build/config/android/config.gni
[modify] https://crrev.com/05c799ee764fef9d63b4e45c4fba22145f96fed3/build/config/android/rules.gni
[modify] https://crrev.com/05c799ee764fef9d63b4e45c4fba22145f96fed3/chrome/android/BUILD.gn
[modify] https://crrev.com/05c799ee764fef9d63b4e45c4fba22145f96fed3/chrome/android/chrome_public_apk_tmpl.gni
[add] https://crrev.com/05c799ee764fef9d63b4e45c4fba22145f96fed3/testing/android/proguard_for_test.flags

Project Member

Comment 9 by bugdroid1@chromium.org, Jul 15 2016

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/f99130f1439da4deac6552190244d7f37698a99a

commit f99130f1439da4deac6552190244d7f37698a99a
Author: Sam Maier <smaier@google.com>
Date: Wed Jul 13 14:28:00 2016

Project Member

Comment 11 by bugdroid1@chromium.org, Jul 29 2016

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/d12c257ee5f278775fd0d30b9316def6aef09ded

commit d12c257ee5f278775fd0d30b9316def6aef09ded
Author: Sam Maier <smaier@google.com>
Date: Fri Jul 29 13:31:07 2016

Project Member

Comment 12 by bugdroid1@chromium.org, Aug 5 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d50624e2e5a9d9fe13596d83e73385c9c44069e9

commit d50624e2e5a9d9fe13596d83e73385c9c44069e9
Author: smaier <smaier@chromium.org>
Date: Fri Aug 05 14:21:10 2016

Merging under test java into instrumentation test java.

This enables us to run all ProGuard uninhibited by tests, since Proguard will
now consider both the tests and the tested code while performing its
optimizations. This is opposed to running ProGuard on the tested java,
keeping stuff around for the tests, which would then use the tested code as
a library.

This turns on optimizations and removes test code from the shipped apk, saving
us ~550kb in .dex size, and ~70kb memory per process.

BUG=620323, 625704 , 626710 

Review-Url: https://codereview.chromium.org/2182303002
Cr-Commit-Position: refs/heads/master@{#410056}

[modify] https://crrev.com/d50624e2e5a9d9fe13596d83e73385c9c44069e9/BUILD.gn
[modify] https://crrev.com/d50624e2e5a9d9fe13596d83e73385c9c44069e9/base/android/base_proguard_config.flags
[modify] https://crrev.com/d50624e2e5a9d9fe13596d83e73385c9c44069e9/build/android/gyp/util/proguard_util.py
[modify] https://crrev.com/d50624e2e5a9d9fe13596d83e73385c9c44069e9/build/android/gyp/write_build_config.py
[modify] https://crrev.com/d50624e2e5a9d9fe13596d83e73385c9c44069e9/build/config/android/config.gni
[modify] https://crrev.com/d50624e2e5a9d9fe13596d83e73385c9c44069e9/build/config/android/internal_rules.gni
[modify] https://crrev.com/d50624e2e5a9d9fe13596d83e73385c9c44069e9/build/config/android/rules.gni
[modify] https://crrev.com/d50624e2e5a9d9fe13596d83e73385c9c44069e9/chrome/android/BUILD.gn
[modify] https://crrev.com/d50624e2e5a9d9fe13596d83e73385c9c44069e9/chrome/android/chrome_public_apk_tmpl.gni
[modify] https://crrev.com/d50624e2e5a9d9fe13596d83e73385c9c44069e9/chrome/android/webapk/libs/runtime_library/javatests/src/org/chromium/webapk/lib/runtime_library/WebApkServiceImplTest.java
[modify] https://crrev.com/d50624e2e5a9d9fe13596d83e73385c9c44069e9/testing/android/proguard_for_test.flags

Project Member

Comment 13 by bugdroid1@chromium.org, Aug 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a3be7ec966cebaa0e2598d86acc95a51845d726e

commit a3be7ec966cebaa0e2598d86acc95a51845d726e
Author: smaier <smaier@chromium.org>
Date: Mon Aug 15 15:17:49 2016

Preparing for ProGuard obfuscation

Allowing obfuscation to be a simple uncomment/comment change for anyone.

BUG= 625704 

Review-Url: https://codereview.chromium.org/2243613002
Cr-Commit-Position: refs/heads/master@{#411966}

[modify] https://crrev.com/a3be7ec966cebaa0e2598d86acc95a51845d726e/chrome/android/java/proguard.flags

Status: Fixed (was: Assigned)
This bug has been sitting open a while, it has been in master for a while.

Sign in to add a comment