
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
react-native-obfuscating-transformer-clone
Advanced tools
Obfuscating transformer for react-native
Obfuscate selected source files when building for React Native.
yarn add react-native-obfuscating-transformer --dev
or
npm install react-native-obfuscating-transformer --save-dev
module.exports = {
+ transformer: {
+ babelTransformerPath: require.resolve("./transformer")
+ },
}
const obfuscatingTransformer = require("react-native-obfuscating-transformer")
module.exports = obfuscatingTransformer({
/* options */
})
module.exports = {
+ transformer: {
+ babelTransformerPath: require.resolve("./transformer")
+ },
}
const obfuscatingTransformer = require("react-native-obfuscating-transformer")
module.exports = obfuscatingTransformer({
/* options */
})
Options are:
upstreamTransformer: MetroTransformer
Defines what the first pass of code transformation is. If you don't use a custom transformer already, you don't need to set this option.
TypeScript example:
const obfuscatingTransformer = require('react-native-obfuscating-transformer')
+ const typescriptTransformer = require('react-native-typescript-transformer')
module.exports = obfuscatingTransformer({
+ upstreamTransformer: typescriptTransformer
})
require('metro/src/transformer')
filter: (filename: string, source: string) => boolean
Returns true for any files that should be obfuscated and false for any files which should not be obfuscated.
By default, it obfuscates all files in src/**/*
obfuscatorOptions: ObfuscatorOptions
Warning — Not all options are guaranteed to produce working code. In particular, stringArray
definitely breaks builds.
See the javascript-obfuscator docs for more info about what each option does.
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
}
trace: boolean
Iff true, prints a list of files being obfuscated
false
emitObfuscatedFiles: boolean
Iff true, emits the obfuscated versions of files alongside their originals, for comparison.
false
enableInDevelopment: boolean
Iff true, enables obfuscation in development mode.
false
MIT
FAQs
Obfuscating transformer for react-native
The npm package react-native-obfuscating-transformer-clone receives a total of 4 weekly downloads. As such, react-native-obfuscating-transformer-clone popularity was classified as not popular.
We found that react-native-obfuscating-transformer-clone demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.