Commit 1a055a9b authored by Eric Stevenson's avatar Eric Stevenson Committed by Commit Bot

Reland "Android: Allow proguard to strip unused native methods."

Reland of dc8f3c0a.

chrome_public_test_apk is now merged with chrome_public_apk_for_test
which should fix the proguard issue.

TBR: agrieve@chromium.org
Bug: 688465
Change-Id: Ie43eae7f945e5ae444f1cb0adc0703b334402f3c
Reviewed-on: https://chromium-review.googlesource.com/c/1333988Reviewed-by: default avatarEric Stevenson <estevenson@chromium.org>
Commit-Queue: Eric Stevenson <estevenson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608038}
parent 3d82637f
...@@ -38,9 +38,6 @@ ...@@ -38,9 +38,6 @@
-keepclasseswithmembers class * { -keepclasseswithmembers class * {
@org.chromium.base.annotations.UsedByReflection <fields>; @org.chromium.base.annotations.UsedByReflection <fields>;
} }
-keepclasseswithmembers,includedescriptorclasses class * {
native <methods>;
}
# Remove methods annotated with this if their return value is unused. # Remove methods annotated with this if their return value is unused.
-assumenosideeffects class ** { -assumenosideeffects class ** {
......
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# -keepclasseswithmembers rather than -keepclasseswithmembernames to avoid
# shrinking of unused native methods. Explicit JNI registration requires even
# unused classes to be present during RegisterNatives().
-keepclasseswithmembers,includedescriptorclasses class * {
native <methods>;
}
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# -keepclasseswithmembernames rather than -keepclasseswithmembers to allow
# shrinking of unused native methods.
-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
...@@ -2433,6 +2433,13 @@ if (enable_java_templates) { ...@@ -2433,6 +2433,13 @@ if (enable_java_templates) {
proguard_configs += [ "//build/android/multidex.flags" ] proguard_configs += [ "//build/android/multidex.flags" ]
} }
proguard_mapping_path = _proguard_mapping_path proguard_mapping_path = _proguard_mapping_path
if (_use_chromium_linker) {
proguard_configs +=
[ "//base/android/proguard/explicit_jni_registration.flags" ]
} else {
proguard_configs +=
[ "//base/android/proguard/implicit_jni_registration.flags" ]
}
} }
# Don't depend on the runtime_deps target in order to avoid having to # Don't depend on the runtime_deps target in order to avoid having to
......
...@@ -470,6 +470,7 @@ action("cronet_combine_proguard_flags") { ...@@ -470,6 +470,7 @@ action("cronet_combine_proguard_flags") {
script = "//components/cronet/tools/generate_proguard_file.py" script = "//components/cronet/tools/generate_proguard_file.py"
sources = [ sources = [
"//base/android/proguard/chromium_code.flags", "//base/android/proguard/chromium_code.flags",
"//base/android/proguard/explicit_jni_registration.flags",
"//components/cronet/android/cronet_impl_native_proguard.cfg", "//components/cronet/android/cronet_impl_native_proguard.cfg",
] ]
outputs = [ outputs = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment