Skip to content

Commit

Permalink
Add @DoNotStrip to stop obfuscation of Fabric related classes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Andrei Shikov authored and facebook-github-bot committed Mar 11, 2022
1 parent a6c2846 commit 2829146
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* the Bindings.cpp, where the pointer to the C++ event emitter is set.
*/
@SuppressLint("MissingNativeLoadLibrary")
@DoNotStrip
public class StateWrapperImpl implements StateWrapper {
static {
FabricSoLoader.staticInit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
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. */
Expand Down

0 comments on commit 2829146

Please sign in to comment.