From 6cb9f85504333148ddabf2afd6957b98b8e88360 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 8 Apr 2025 08:13:39 -0700 Subject: [PATCH] Remove unused @KeepGettersAndSetters annotation Summary: This annotation is unused. It was referenced in the past with Buck1 OSS but now we can safely remove it. Changelog: [Internal] [Changed] - Differential Revision: D72645219 --- .../ReactAndroid/proguard-rules.pro | 6 ----- .../annotations/KeepGettersAndSetters.kt | 24 ------------------- .../annotations/proguard_annotations.pro | 21 ---------------- 3 files changed, 51 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/proguard/annotations/KeepGettersAndSetters.kt delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/proguard/annotations/proguard_annotations.pro diff --git a/packages/react-native/ReactAndroid/proguard-rules.pro b/packages/react-native/ReactAndroid/proguard-rules.pro index 70c7e22bd8f1..8073872f0f0b 100644 --- a/packages/react-native/ReactAndroid/proguard-rules.pro +++ b/packages/react-native/ReactAndroid/proguard-rules.pro @@ -23,7 +23,6 @@ # Keep our interfaces so they can be used by other ProGuard rules. # See http://sourceforge.net/p/proguard/bugs/466/ -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip --keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters # Do not strip any method/class that is annotated with @DoNotStrip -keep @com.facebook.proguard.annotations.DoNotStrip class * @@ -41,11 +40,6 @@ *; } --keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { - void set*(***); - *** get*(); -} - -keep class * implements com.facebook.react.bridge.JavaScriptModule { *; } -keep class * implements com.facebook.react.bridge.NativeModule { *; } -keepclassmembers,includedescriptorclasses class * { native ; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/proguard/annotations/KeepGettersAndSetters.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/proguard/annotations/KeepGettersAndSetters.kt deleted file mode 100644 index 5e29591bcaec..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/proguard/annotations/KeepGettersAndSetters.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.proguard.annotations - -import kotlin.annotation.AnnotationRetention -import kotlin.annotation.AnnotationTarget - -/** - * Add this annotation to a class, to keep all "void set*(***)" and get* methods. - * - * This is useful for classes that are controlled by animator-like classes that control various - * properties with reflection. - * - * **NOTE:** This is *not* needed for Views because their getters and setters are automatically kept - * by the default Android SDK ProGuard config. - */ -@Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.BINARY) -public annotation class KeepGettersAndSetters diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/proguard/annotations/proguard_annotations.pro b/packages/react-native/ReactAndroid/src/main/java/com/facebook/proguard/annotations/proguard_annotations.pro deleted file mode 100644 index a4a7187e4d0e..000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/proguard/annotations/proguard_annotations.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -# Keep our interfaces so they can be used by other ProGuard rules. -# See http://sourceforge.net/p/proguard/bugs/466/ --keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip --keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStripAny --keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters - -# Do not strip any method/class that is annotated with @DoNotStrip --keep @com.facebook.proguard.annotations.DoNotStrip class * --keepclassmembers class * { - @com.facebook.proguard.annotations.DoNotStrip *; -} - --keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { - void set*(***); - *** get*(); -}