Try Using
Obfuscate JavaScript code
https://github.com/javascript-obfuscator/react-native-obfuscating-transformer
This would be the most important part of the obfuscation as our actual code is written in JavaScript. The react-native-obfuscating-transformer npm package can be used here:
Add the package to your project
NPM install react-native-obfuscating-transformer
Add/update the CLI configuration in rn-cli.config.js at the root of your project, where android and ios folders reside.
module.exports = {
getTransformModulePath() {
return require.resolve("./transformer")
},
}
follow along with the details steps on the Git hub page
https://github.com/javascript-obfuscator/react-native-obfuscating-transformer
Some of the options are below
interface ObfuscatorOptions {
compact?: boolean
controlFlowFlattening?: boolean
controlFlowFlatteningThreshold?: 0.75
deadCodeInjection?: boolean
deadCodeInjectionThreshold?: 0.4
debugProtection?: boolean
debugProtectionInterval?: boolean
disableConsoleOutput?: boolean
domainLock?: string[]
identifierNamesGenerator?: "hexadecimal" | "mangled"
log?: boolean
renameGlobals?: boolean
reservedNames?: string[]
rotateStringArray?: true
seed?: 0
selfDefending?: boolean
sourceMap?: boolean
sourceMapBaseUrl?: string
sourceMapFileName?: string
sourceMapMode?: "separate" | "inline"
stringArray?: boolean
stringArrayEncoding?: boolean
stringArrayThreshold?: 0.75
target?: "browser" | "extension" | "node"
unicodeEscapeSequence?: boolean
}