From aa4dd9e9c3f661f1b3f4bb374f142e9d1e0f8ea4 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Thu, 18 Jul 2019 22:11:13 -0400 Subject: [PATCH] Fix AndroidUnicodeUtils getting removed by proguard --- .../com/facebook/hermes/unicode/AndroidUnicodeUtils.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/unicode/AndroidUnicodeUtils.java b/ReactAndroid/src/main/java/com/facebook/hermes/unicode/AndroidUnicodeUtils.java index 8207c466ffa86a..6c3534ede30df6 100644 --- a/ReactAndroid/src/main/java/com/facebook/hermes/unicode/AndroidUnicodeUtils.java +++ b/ReactAndroid/src/main/java/com/facebook/hermes/unicode/AndroidUnicodeUtils.java @@ -11,15 +11,20 @@ import java.text.Normalizer; import java.util.Locale; +import com.facebook.proguard.annotations.DoNotStrip; + // TODO: use com.facebook.common.locale.Locales.getApplicationLocale() as the current locale, // rather than the device locale. This is challenging because getApplicationLocale() is only // available via DI. +@DoNotStrip public class AndroidUnicodeUtils { + @DoNotStrip public static int localeCompare(String left, String right) { Collator collator = Collator.getInstance(); return collator.compare(left, right); } + @DoNotStrip public static String dateFormat(double unixtimeMs, boolean formatDate, boolean formatTime) { DateFormat format; if (formatDate && formatTime) { @@ -34,6 +39,7 @@ public static String dateFormat(double unixtimeMs, boolean formatDate, boolean f return format.format((long) unixtimeMs).toString(); } + @DoNotStrip public static String convertToCase(String input, int targetCase, boolean useCurrentLocale) { // These values must match CaseConversion in PlatformUnicode.h final int targetUppercase = 0; @@ -52,6 +58,7 @@ public static String convertToCase(String input, int targetCase, boolean useCurr } } + @DoNotStrip public static String normalize(String input, int form) { // Values must match NormalizationForm in PlatformUnicode.h. final int formC = 0;