From 35046984db2c41ef740cb50e1e60a3dfdcd23056 Mon Sep 17 00:00:00 2001 From: Andrew Jack Date: Wed, 15 Mar 2017 17:32:01 -0700 Subject: [PATCH] Add TextLayoutBuilder proguard rule Summary: To enable users to use run proguard in their Android applications. Fixes: #11891 [TextLayoutBuilder](https://github.com/facebookincubator/TextLayoutBuilder) is built as a Jar rather than an AAR so the proguard rules cannot be provided with the binary. This PR adds the rules that are included in TextLayoutBuilder https://github.com/facebookincubator/TextLayoutBuilder/blob/master/proguard-android.txt - Created an `react-native init ProguardTest` project with proguard turned on for v0.41.0 - Make sure tests pass on both Travis and Circle CI. Closes https://github.com/facebook/react-native/pull/12511 Differential Revision: D4718029 Pulled By: mkonicek fbshipit-source-id: 9e3f11c8b9b54eb8e52aa6f44cacd00857a882a5 --- local-cli/templates/HelloWorld/android/app/proguard-rules.pro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/local-cli/templates/HelloWorld/android/app/proguard-rules.pro b/local-cli/templates/HelloWorld/android/app/proguard-rules.pro index 48361a901..6e8516c8d 100644 --- a/local-cli/templates/HelloWorld/android/app/proguard-rules.pro +++ b/local-cli/templates/HelloWorld/android/app/proguard-rules.pro @@ -50,6 +50,10 @@ -dontwarn com.facebook.react.** +# TextLayoutBuilder uses a non-public Android constructor within StaticLayout. +# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. +-dontwarn android.text.StaticLayout + # okhttp -keepattributes Signature