Skip to content

@DoNotStripAny annotation is missing in the Proguard Setup for React Native Android #33008

@cortinico

Description

@cortinico

Description

I'm opening this public issue if someone from the community wants to pick this up.

We do have several classes that are using the @DoNotStripAny annotation:

$ rg DoNotStripAny

ReactAndroid/src/main/java/com/facebook/react/uimanager/ComponentNameResolver.java
10:import com.facebook.proguard.annotations.DoNotStripAny;
12:@DoNotStripAny

ReactAndroid/src/main/java/com/facebook/react/uimanager/ComponentNameResolverManager.java
12:import com.facebook.proguard.annotations.DoNotStripAny;
16:@DoNotStripAny

ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java
37:import com.facebook.proguard.annotations.DoNotStripAny;
97:@DoNotStripAny

ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java
10:import com.facebook.proguard.annotations.DoNotStripAny;
19:@DoNotStripAny

This annotation is actually not included in the Proguard file that we ship alongside ReactAndroid: https://github.com/facebook/react-native/blob/main/ReactAndroid/proguard-rules.pro

It's configuration it's only available in this file which is consumed by Buck:
https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/proguard/annotations/proguard_annotations.pro

We should adapt the former proguard file to include the Proguard config for @DoNotStripAny.
Ideally also doing a run with Proguard and verify that the classes are also not stripped would be great.

Happy to review a PR addressing this, which should be also easy to jump on.

Version

0.67.1

Output of npx react-native info

N/A

Steps to reproduce

N/A

Snack, code example, screenshot, or link to a repository

N/A

Metadata

Metadata

Assignees

Labels

Good first issueInterested in collaborating? Take a stab at fixing one of these issues.Help Wanted :octocat:Issues ideal for external contributors.Resolution: LockedThis issue was locked by the bot.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions