How to protect source code in react-native app before passing the project to the client

I think that offline bundle make the job:

For ios

react-native bundle --dev false --entry-file index.js --bundle-output ios/main.jsbundle --platform ios

For android

react-native bundle --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --platform android --assets-dest android/app/src/main/res/

With --dev false it is obfuscated (--minify true) by default

Give your clients the android and ios folders for them to compile the native code themselves


For JavaScript code, the best option is probably obfuscation, and JScrambler probably works well. I do not know any other good solution than obfuscation for this particular issue.

I work on a team that just released a new JavaScript obfuscation product JSDefender, and it has specific support for React Native that maybe you could try as an alternative to JScrambler.