blob: f6f3783ab0d274103848d35cb052e055ab57e705 [file] [log] [blame]
################################################################################
# ../../android_webview/apk/java/proguard.flags
################################################################################
# Copyright 2016 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.
-keepclassmembers class org.chromium.android_webview.AwPdfExporter {
android.view.ViewGroup mContainerView;
}
# Keep the factory and its public members; it's the main entry point used by the
# framework.
-keep class com.android.webview.chromium.WebViewChromiumFactoryProvider {
public *;
}
-keep class * implements android.webkit.WebViewFactoryProvider$Statics {
*;
}
-keep class com.android.webview.chromium.ContentSettingsAdapter {
public *;
}
-keep class com.android.webview.chromium.WebViewChromiumFactoryProviderFor* {
public *;
}
-keep class com.android.webview.chromium.WebViewDatabaseAdapter {
public *;
}
# This is the main entry point for APIs. It is kept to make developing with
# unreleased Android easier.
-keep class com.android.webview.chromium.WebViewChromium {
public *;
}
# Functor classes with native methods implemented in Android.
-keep class com.android.webview.chromium.DrawFunctor
-keep class com.android.webview.chromium.DrawGLFunctor
-keep class com.android.webview.chromium.GraphicsUtils
# Linker dynamically casts to $TestRunner when running tests. We don't run these
# tests in WebView.
-dontnote org.chromium.base.library_loader.Linker$TestRunner
# Don't note about the API 21 compatibility code which references various
# hidden APIs via reflection.
-dontnote com.android.webview.chromium.WebViewDelegateFactory$Api21CompatibilityDelegate
# DefaultAndroidKeyStore uses reflection to access internal OpenSSL state.
-dontnote org.chromium.net.DefaultAndroidKeyStore
# MediaPlayerBridge uses reflection to access internal metadata.
-dontnote org.chromium.media.MediaPlayerBridge
# ProxyChangeListener$ProxyReceiver uses reflection to access internal
# android.net.ProxyProperties.
-dontnote org.chromium.net.ProxyChangeListener$ProxyReceiver
# Silence warnings about reflection used to check for onShow/HideCustomView.
# This class is not really kept since it's in a library jar.
-keep class android.webkit.WebChromeClient {
void onShowCustomView(...);
void onHideCustomView();
}
-keep class org.chromium.android_webview.AwBrowserProcess {
java.nio.channels.FileLock sExclusiveFileLock;
}
# Accessed via reflection but not present in all builds
-keep class com.android.webview.chromium.AwSafeBrowsingApiHandler {
AwSafeBrowsingApiHandler(...);
}
-dontnote com.android.webview.chromium.AwSafeBrowsingApiHandler
# We strip some unused resources when preprocessing the GMS client libs.
-dontwarn com.google.android.gms.R**
# Trichrome builds don't include a native library list in the main APK; it's
# picked up from the library APK at runtime.
-dontwarn org.chromium.base.library_loader.NativeLibraries
################################################################################
# ../../android_webview/support_library/boundary_interfaces/proguard.flags
################################################################################
# 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.
# We need to avoid obfuscating the support library boundary interface because
# this API is shared with the Android Support Library.
# Note that we only 'keep' the package org.chromium.support_lib_boundary itself,
# any sub-packages of that package can still be obfuscated.
-keep public class org.chromium.support_lib_boundary.* { public *; }
################################################################################
# ../../base/android/proguard/chromium_apk.flags
################################################################################
# Copyright 2016 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.
# Contains flags that we'd like all Chromium .apks to use.
# Not needed for Android and saves a bit of processing time.
-dontpreverify
# Keep line number information, useful for stack traces.
-keepattributes SourceFile,LineNumberTable
# Keep all CREATOR fields within Parcelable that are kept.
-keepclassmembers class * implements android.os.Parcelable {
public static *** CREATOR;
}
# Don't obfuscate Parcelables as they might be marshalled outside Chrome.
# If we annotated all Parcelables that get put into Bundles other than
# for saveInstanceState (e.g. PendingIntents), then we could actually keep the
# names of just those ones. For now, we'll just keep them all.
-keepnames class * implements android.os.Parcelable
# Keep all enum values and valueOf methods. See
# http://proguard.sourceforge.net/index.html#manual/examples.html
# for the reason for this. Also, see http://crbug.com/248037.
-keepclassmembers enum * {
public static **[] values();
}
# Keep classes implementing ParameterProvider -- these will be instantiated
# via reflection.
-keep class * implements org.chromium.base.test.params.ParameterProvider
# Allows Proguard freedom in removing these log related calls. We ask for debug
# and verbose logs to be stripped out in base.Log, so we are just ensuring we
# get rid of all other debug/verbose logs.
-assumenosideeffects class android.util.Log {
static *** d(...);
static *** v(...);
static *** isLoggable(...);
}
# The following chart was created on July 20, 2016, to decide on 3 optimization
# passes for Chrome.
# optimization passes | time | .dex size | dirty memory per process
# -----------------------------------------------------------------
# 1 | 0:48 | 5805676 | 488972
# 2 | 1:07 | 5777376 | 487092
# 3 | 1:24 | 5772192 | 486596
# 4 | 1:42 | 5771124 | 486484
# 5 | 1:56 | 5770504 | 486432
-optimizationpasses 3
# Horizontal class merging marginally increases dex size (as of Mar 2018).
-optimizations !class/merging/horizontal
# Allowing Proguard to change modifiers. This change shrinks the .dex size by
# ~1%, and reduces the method count by ~4%.
-allowaccessmodification
# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**
################################################################################
# ../../base/android/proguard/chromium_code.flags
################################################################################
# Copyright 2016 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.
# Contains flags that can be safely shared with Cronet, and thus would be
# appropriate for third-party apps to include.
# Keep all annotation related attributes that can affect runtime
-keepattributes RuntimeVisible*Annotations
-keepattributes AnnotationDefault
# Keep the annotations, because if we don't, the ProGuard rules that use them
# will not be respected. These classes then show up in our final dex, which we
# do not want - see crbug.com/628226.
-keep @interface org.chromium.base.annotations.AccessedByNative
-keep @interface org.chromium.base.annotations.CalledByNative
-keep @interface org.chromium.base.annotations.CalledByNativeUnchecked
-keep @interface org.chromium.base.annotations.DoNotInline
-keep @interface org.chromium.base.annotations.RemovableInRelease
-keep @interface org.chromium.base.annotations.UsedByReflection
# Keeps for class level annotations.
-keep @org.chromium.base.annotations.UsedByReflection class * {}
# Keeps for method level annotations.
-keepclasseswithmembers class * {
@org.chromium.base.annotations.AccessedByNative <fields>;
}
-keepclasseswithmembers,includedescriptorclasses class * {
@org.chromium.base.annotations.CalledByNative <methods>;
}
-keepclasseswithmembers,includedescriptorclasses class * {
@org.chromium.base.annotations.CalledByNativeUnchecked <methods>;
}
-keepclasseswithmembers class * {
@org.chromium.base.annotations.UsedByReflection <methods>;
}
-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 ** {
@org.chromium.base.annotations.RemovableInRelease <methods>;
}
# Never inline classes or methods with this annotation, but allow shrinking and
# obfuscation.
-keepnames,allowobfuscation @org.chromium.base.annotations.DoNotInline class * {
*;
}
-keepclassmembernames,allowobfuscation class * {
@org.chromium.base.annotations.DoNotInline <methods>;
}
# Keep all CREATOR fields within Parcelable that are kept.
-keepclassmembers class org.chromium.** implements android.os.Parcelable {
public static *** CREATOR;
}
# Don't obfuscate Parcelables as they might be marshalled outside Chrome.
# If we annotated all Parcelables that get put into Bundles other than
# for saveInstanceState (e.g. PendingIntents), then we could actually keep the
# names of just those ones. For now, we'll just keep them all.
-keepnames class org.chromium.** implements android.os.Parcelable
# Keep all enum values and valueOf methods. See
# http://proguard.sourceforge.net/index.html#manual/examples.html
# for the reason for this. Also, see http://crbug.com/248037.
-keepclassmembers enum org.chromium.** {
public static **[] values();
}
################################################################################
# ../../base/android/proguard/dcheck_is_off.flags
################################################################################
# Copyright 2019 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.
# Contains flags that are applied only when ENABLE_DCHECK=false.
# Ensure that LifetimeAssert implementation is not reachable in release.
-checkdiscard class org.chromium.base.LifetimeAssert$WrappedReference { *; }
################################################################################
# ../../base/android/proguard/enable_obfuscation.flags
################################################################################
# Copyright 2016 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.
# As of August 11, 2016, obfuscation was found to save 660kb on our .dex size
# and 53kb memory/process (through shrinking method/string counts).
-renamesourcefileattribute PG
-repackageclasses ''
################################################################################
# ../../build/android/buildhooks/proguard/build_hooks_android_impl.flags
################################################################################
# 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.
-keep class org.chromium.build.BuildHooksAndroidImpl
################################################################################
# ../../chrome/android/java/proguard.flags
################################################################################
# Copyright 2016 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.
# Fragments loaded by name via Fragment.instantiate(Context,String)
# Not all fragments in this package are PreferenceFragments. E.g. HomepageEditor
# is a normal Fragment.
-keep public class org.chromium.chrome.browser.** extends android.app.Fragment {
public <init>();
}
# These classes aren't themselves referenced, but __ProcessService[0,1,2...] are
# referenced, and we look up these services by appending a number onto the name
# of the base class. Thus, we need to keep the base class name around so that
# the child classes can be looked up.
-keep class org.chromium.content.app.SandboxedProcessService {
public <init>();
}
-keep class org.chromium.content.app.PrivilegedProcessService {
public <init>();
}
# SearchView is used in website_preferences_menu.xml and is constructed by
# Android using reflection.
-keep class android.support.v7.widget.SearchView {
public <init>(...);
}
# This class member is referenced in BottomSheetBottomNav as a temporary
# measure until the support library contains a solution for disabling shifting
# mode. TODO(twellington): remove once support library has a fix and is rolled.
-keepclassmembers class android.support.design.internal.BottomNavigationMenuView {
boolean mShiftingMode;
}
# Trichrome builds don't include a native library list in the main APK; it's
# picked up from the library APK at runtime.
-dontwarn org.chromium.base.library_loader.NativeLibraries
################################################################################
# ../../components/background_task_scheduler/android/proguard.flags
################################################################################
# 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.
# Classes are created via reflection, so may not be renamed.
-keepnames class * implements org.chromium.components.background_task_scheduler.BackgroundTask {
public <init>();
}
################################################################################
# ../../third_party/gvr-android-sdk/proguard-gvr-chromium.txt
################################################################################
-dontwarn com.google.common.logging.nano.Vr$**
-dontwarn com.google.vr.**
################################################################################
# ../../third_party/gvr-android-sdk/src/proguard-gvr.txt
################################################################################
# Don't obfuscate any NDK/SDK code. This makes the debugging of stack traces
# in release builds easier.
-keepnames class com.google.vr.ndk.** { *; }
-keepnames class com.google.vr.sdk.** { *; }
# These are part of the Java <-> native interfaces for GVR.
-keepclasseswithmembernames,includedescriptorclasses class com.google.vr.** {
native <methods>;
}
# The SDK configuration class member names are useful for debugging client logs.
-keepclasseswithmembernames,allowoptimization class com.google.common.logging.nano.Vr$VREvent$SdkConfigurationParams** {
*;
}
-keep class com.google.vr.cardboard.UsedByNative
-keep @com.google.vr.cardboard.UsedByNative class *
-keepclassmembers class * {
@com.google.vr.cardboard.UsedByNative *;
}
-keep class com.google.vr.cardboard.annotations.UsedByNative
-keep @com.google.vr.cardboard.annotations.UsedByNative class *
-keepclassmembers class * {
@com.google.vr.cardboard.annotations.UsedByNative *;
}
-keep class com.google.vr.cardboard.annotations.UsedByReflection
-keep @com.google.vr.cardboard.annotations.UsedByReflection class *
-keepclassmembers class * {
@com.google.vr.cardboard.annotations.UsedByReflection *;
}
-dontwarn com.google.protobuf.nano.NanoEnumValue
################################################################################
# gen/third_party/android_deps/android_arch_lifecycle_runtime_java/proguard.txt
################################################################################
-keepattributes *Annotation*
-keepclassmembers enum android.arch.lifecycle.Lifecycle$Event {
<fields>;
}
-keep class * implements android.arch.lifecycle.LifecycleObserver {
}
-keep class * implements android.arch.lifecycle.GenericLifecycleObserver {
<init>(...);
}
-keepclassmembers class ** {
@android.arch.lifecycle.OnLifecycleEvent *;
}
################################################################################
# gen/third_party/android_deps/com_android_support_animated_vector_drawable_java/proguard.txt
################################################################################
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# keep setters in VectorDrawables so that animations can still work.
-keepclassmembers class android.support.graphics.drawable.VectorDrawableCompat$* {
void set*(***);
*** get*();
}
################################################################################
# gen/third_party/android_deps/com_android_support_design_java/proguard.txt
################################################################################
# Copyright (C) 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# CoordinatorLayout resolves the behaviors of its child components with reflection.
-keep public class * extends android.support.design.widget.CoordinatorLayout$Behavior {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>();
}
# Make sure we keep annotations for CoordinatorLayout's DefaultBehavior
-keepattributes *Annotation*
################################################################################
# gen/third_party/android_deps/com_android_support_recyclerview_v7_java/proguard.txt
################################################################################
# Copyright (C) 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# When layoutManager xml attribute is used, RecyclerView inflates
#LayoutManagers' constructors using reflection.
-keep public class * extends android.support.v7.widget.RecyclerView$LayoutManager {
public <init>(...);
}
################################################################################
# gen/third_party/android_deps/com_android_support_support_core_ui_java/proguard.txt
################################################################################
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Make sure we keep annotations for ViewPager's DecorView
-keepattributes *Annotation*
################################################################################
# gen/third_party/android_deps/com_android_support_support_media_compat_java/proguard.txt
################################################################################
# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Prevent Parcelable objects from being removed or renamed.
-keep class android.support.v4.media.** implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
################################################################################
# gen/third_party/android_deps/com_android_support_transition_java/proguard.txt
################################################################################
# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# FragmentTransitionSupport is instantiated in support-fragment via reflection.
-keep public class android.support.transition.FragmentTransitionSupport {
}
# Keep a field in transition that is used to keep a reference to weakly-referenced object
-keepclassmembers class android.support.transition.ChangeBounds$* extends android.animation.AnimatorListenerAdapter {
android.support.transition.ChangeBounds$ViewBounds mViewBounds;
}
################################################################################
# gen/third_party/android_deps/com_google_android_gms_play_services_base_java/proguard.txt
################################################################################
# b/35135904 Ensure that proguard will not strip the mResultGuardian.
-keepclassmembers class com.google.android.gms.common.api.internal.BasePendingResult {
com.google.android.gms.common.api.internal.BasePendingResult$ReleasableResultGuardian mResultGuardian;
}
################################################################################
# gen/third_party/android_deps/com_google_android_gms_play_services_basement_java/proguard.txt
################################################################################
# Proguard flags for consumers of the Google Play services SDK
# https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project
# Keep SafeParcelable NULL value, needed for reflection by DowngradeableSafeParcel
-keepclassmembers public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final *** NULL;
}
# Needed for Parcelable/SafeParcelable classes & their creators to not get renamed, as they are
# found via reflection.
-keep class com.google.android.gms.common.internal.ReflectedParcelable
-keepnames class * implements com.google.android.gms.common.internal.ReflectedParcelable
-keepclassmembers class * implements android.os.Parcelable {
public static final *** CREATOR;
}
# Keep the classes/members we need for client functionality.
-keep @interface android.support.annotation.Keep
-keep @android.support.annotation.Keep class *
-keepclasseswithmembers class * {
@android.support.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <methods>;
}
# Keep the names of classes/members we need for client functionality.
-keep @interface com.google.android.gms.common.annotation.KeepName
-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}
# Keep Dynamite API entry points
-keep @interface com.google.android.gms.common.util.DynamiteApi
-keep @com.google.android.gms.common.util.DynamiteApi public class * {
public <fields>;
public <methods>;
}
# Needed when building against pre-Marshmallow SDK.
-dontwarn android.security.NetworkSecurityPolicy
# Needed when building against Marshmallow SDK.
-dontwarn android.app.Notification
# Protobuf has references not on the Android boot classpath
-dontwarn sun.misc.Unsafe
-dontwarn libcore.io.Memory
# Internal Google annotations for generating Proguard keep rules.
-dontwarn com.google.android.apps.common.proguard.UsedBy*
# Annotations referenced by the SDK but whose definitions are contained in
# non-required dependencies.
-dontwarn javax.annotation.**
-dontwarn org.checkerframework.**
################################################################################
# gen/third_party/android_deps/com_google_android_gms_play_services_cast_framework_java/proguard.txt
################################################################################
-keep public class * implements com.google.android.gms.cast.framework.OptionsProvider
################################################################################
# gen/third_party/android_deps/com_google_android_gms_play_services_clearcut_java/proguard.txt
################################################################################
# We keep all fields for every generated proto file as the runtime uses
# reflection over them that ProGuard cannot detect. Without this keep
# rule, fields may be removed that would cause runtime failures.
-keepclassmembers class * extends com.google.android.gms.internal.clearcut.zzcg {
<fields>;
}
################################################################################
# gen/third_party/android_deps/com_google_android_gms_play_services_fido_java/proguard.txt
################################################################################
# Methods enable and disable in this class are complained as unresolved
# references, but they are system APIs and are not used by Fido client apps.
-dontwarn android.nfc.NfcAdapter
################################################################################
# gen/third_party/android_deps/com_google_android_gms_play_services_gcm_java/proguard.txt
################################################################################
# Ensure that proguard will not strip the handleIntent method.
-keepclassmembers class com.google.android.gms.gcm.GcmListenerService {
public void handleIntent(android.content.Intent);
}
################################################################################
# gen/third_party/android_deps/com_google_ar_core_java/proguard.txt
################################################################################
# Keep ARCore public-facing classes
-keepparameternames
# These are part of the Java <-> native interfaces for ARCore.
-keepclasseswithmembernames,includedescriptorclasses class com.google.ar.** {
native <methods>;
}
-keep public class com.google.ar.core.** {*;}
# If you need to build a library on top of arcore_client, and use this library for your project
# Please un-comment this line below.
# -keepattributes *Annotation*
-keep class com.google.ar.core.annotations.UsedByNative
-keep @com.google.ar.core.annotations.UsedByNative class *
-keepclassmembers class * {
@com.google.ar.core.annotations.UsedByNative *;
}
-keep class com.google.ar.core.annotations.UsedByReflection
-keep @com.google.ar.core.annotations.UsedByReflection class *
-keepclassmembers class * {
@com.google.ar.core.annotations.UsedByReflection *;
}
# Keep Dynamite classes
# .aidl file will be proguarded, we should keep all Aidls.
-keep class com.google.vr.dynamite.client.IObjectWrapper { *; }
-keep class com.google.vr.dynamite.client.ILoadedInstanceCreator { *; }
-keep class com.google.vr.dynamite.client.INativeLibraryLoader { *; }
# Keep annotation files and the file got annotated.
-keep class com.google.vr.dynamite.client.UsedByNative
-keep @com.google.vr.dynamite.client.UsedByNative class *
-keepclassmembers class * {
@com.google.vr.dynamite.client.UsedByNative *;
}
-keep class com.google.vr.dynamite.client.UsedByReflection
-keep @com.google.vr.dynamite.client.UsedByReflection class *
-keepclassmembers class * {
@com.google.vr.dynamite.client.UsedByReflection *;
}