Commit 373b4928 authored by Moe Ahmadi's avatar Moe Ahmadi Committed by Commit Bot

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

This reverts commit dc8f3c0a.

Reason for revert: Casing failures
https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/android-rel/2442

Original change's description:
> Android: Allow proguard to strip unused native methods.
> 
> This CL changes Monochrome APKs to allow proguard to strip out Java
> native methods that aren't used.
> 
> For APKs that use explicit JNI registration, this isn't possible since
> RegisterNatives ends up trying to load classes that are unused and
> removed by proguard.
> 
> Bug: 688465
> Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;master.tryserver.chromium.android:android_cronet_tester
> Change-Id: I6816bd68ce47e59bfc9f75dace1b34ab3c200222
> Reviewed-on: https://chromium-review.googlesource.com/1244605
> Reviewed-by: Paul Jensen <pauljensen@chromium.org>
> Reviewed-by: agrieve <agrieve@chromium.org>
> Commit-Queue: Eric Stevenson <estevenson@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#594743}

TBR=pauljensen@chromium.org,agrieve@chromium.org,estevenson@chromium.org

Change-Id: Ic8e1f808a63c9c0fd119ee36efa1cc2b1e9a0616
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 688465
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;master.tryserver.chromium.android:android_cronet_tester
Reviewed-on: https://chromium-review.googlesource.com/1249825Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594774}
parent d670d8b8
......@@ -38,6 +38,9 @@
-keepclasseswithmembers class * {
@org.chromium.base.annotations.UsedByReflection <fields>;
}
-keepclasseswithmembers,includedescriptorclasses class * {
native <methods>;
}
# Remove methods annotated with this if their return value is unused.
-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>;
}
......@@ -2400,13 +2400,6 @@ if (enable_java_templates) {
if (_enable_multidex) {
proguard_configs += [ "//build/android/multidex.flags" ]
}
if (_use_chromium_linker) {
proguard_configs +=
[ "//base/android/proguard/explicit_jni_registration.flags" ]
} else {
proguard_configs +=
[ "//base/android/proguard/implicit_jni_registration.flags" ]
}
proguard_output_jar_path = _proguard_output_jar_path
}
......
......@@ -471,7 +471,6 @@ action("cronet_combine_proguard_flags") {
script = "//components/cronet/tools/generate_proguard_file.py"
sources = [
"//base/android/proguard/chromium_code.flags",
"//base/android/proguard/explicit_jni_registration.flags",
"//components/cronet/android/cronet_impl_native_proguard.cfg",
]
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