New issue
Advanced search Search tips
Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment
link

Issue 887942: Proguard -keep audit

Reported by agrieve@chromium.org, Sep 21 Project Member

Issue description

A few notes on rules that I think should be tweaked:

-keep class * implements org.chromium.base.test.params.ParameterProvider
* Should not be there for non-test apks.
* Should have {}s

-keep class org.chromium.content.app.SandboxedProcessService
* Should add {}s and explicitly list <init> to keep.

-optimizations !class/merging/horizontal
* Remove once we move to r8.

There are also some rules from android_arch_lifecycle_runtime_java that seem overly broad and perhaps unnecessary:

  1655 ################################################################################
  1656 -keepattributes *Annotation*
  1657 
  1658 -keepclassmembers enum android.arch.lifecycle.Lifecycle$Event {
  1659     <fields>;
  1660 }
  1661 
  1662 -keep class * implements android.arch.lifecycle.LifecycleObserver {
  1663 }
  1664 
  1665 -keep class * implements android.arch.lifecycle.GenericLifecycleObserver {
  1666     <init>(...);
  1667 }
  1668 
  1669 -keepclassmembers class ** {
  1670     @android.arch.lifecycle.OnLifecycleEvent *;
  1671 }


We should try to disable them by adding an "ignore_proguard = true" here:
https://cs.chromium.org/chromium/src/build/config/android/rules.gni?rcl=dec72e86b3c1d8dd4de2bb033fc551cc25b63ce8&l=3510
 

Comment 1 by agrieve@chromium.org, Oct 16

I filed a bug about the lifecycle rules:
http://issuetracker.google.com/issues/116303751

Looks like no progress towards a resolution though, so we should exclude them on our side.

Comment 2 by bugdroid1@chromium.org, Dec 7

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

commit a48fa4727e3291b992bd9e7f30e69f6112392493
Author: Sam Maier <smaier@chromium.org>
Date: Fri Dec 07 00:58:21 2018

Android: cleaning up some Proguard flags

Making these keep rules more explicit.

Bug: 887942
Change-Id: I70038c8c58025892a7003fad5bb3ff83384f13f5
Reviewed-on: https://chromium-review.googlesource.com/c/1366262
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614508}
[modify] https://crrev.com/a48fa4727e3291b992bd9e7f30e69f6112392493/chrome/android/java/proguard.flags

Comment 3 by agrieve@chromium.org, Jan 14

Labels: QuickFix

Comment 4 by smaier@google.com, Jan 21

Cc: smaier@chromium.org
 Issue 700236  has been merged into this issue.

Comment 5 by smaier@google.com, Jan 21

 Issue 826781  has been merged into this issue.

Sign in to add a comment