Add @DoNotStrip to stop obfuscation of Fabric related classes

Summary:
Proguard seems to keep Fabric methods a bit differently from Redex, with method signature lookup with `MountItem` and `StateWrapperImpl` failing in release RNTester builds because of mangled names. Adding these annotations should keep the classes, ensuring lookup from native is correct.

Changelog: [Internal] - Add DoNotStrip annotations to Fabric related classes

Reviewed By: ryancat

Differential Revision: D34726510

fbshipit-source-id: 0c1d8e1fabec75511942943b533ddd8b637a5e19
This commit is contained in:
Andrei Shikov
2022-03-11 09:16:01 -08:00
committed by Facebook GitHub Bot
parent a6c2846b37
commit 28291461a8
2 changed files with 3 additions and 0 deletions
@@ -24,6 +24,7 @@ import com.facebook.react.uimanager.StateWrapper;
* the Bindings.cpp, where the pointer to the C++ event emitter is set.
*/
@SuppressLint("MissingNativeLoadLibrary")
@DoNotStrip
public class StateWrapperImpl implements StateWrapper {
static {
FabricSoLoader.staticInit();
@@ -10,8 +10,10 @@ package com.facebook.react.fabric.mounting.mountitems;
import androidx.annotation.AnyThread;
import androidx.annotation.NonNull;
import androidx.annotation.UiThread;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.fabric.mounting.MountingManager;
@DoNotStrip
public interface MountItem {
/** Execute this {@link MountItem} into the operation queue received by parameter. */