
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
@bytehide/react-native-shield
Advanced tools
This README provides step-by-step instructions for integrating and using the ByteHide React Native Shield Plugin for obfuscating your React Native project's source code.
Install the plugin as a development dependency in your project:
npm install @bytehide/react-native-shield --save-dev
You can create a standalone script to perform obfuscation manually.
Create a script file in the root of your project, e.g., obfuscate.js
, and add the following:
const shield = require('@bytehide/react-native-shield');
const srcPath = './src'; // Path to source files
const destPath = './dist'; // Path to destination
const projectToken = 'your_project_token'; // Project token
shield
.obfuscate(srcPath, destPath, projectToken)
.then(() => console.log('Obfuscation completed successfully!'))
.catch((err) => console.error('Error during obfuscation:', err));
Run the script manually when needed:
node obfuscate.js
package.json
ScriptsInclude the obfuscation step as a script in your project's package.json
:
Modify package.json
:
"scripts": {
"obfuscate": "node obfuscate.js"
}
Execute the obfuscation script:
npm run obfuscate
build.gradle
)Add a custom task to android/app/build.gradle
:
task obfuscateJs(type: Exec) {
commandLine "node", "${project.rootDir}/obfuscate.js"
}
preBuild.dependsOn obfuscateJs
Go to Build Phases > + Add Run Script Phase in Xcode.
Add the following script:
node "$SRCROOT/../obfuscate.js"
You can integrate the obfuscation step as a custom React Native CLI command.
Add the following to react-native.config.js
:
module.exports = {
commands: [
{
name: 'obfuscate',
func: () => {
const shield = require('@bytehide/react-native-shield');
const srcPath = './src';
const destPath = './dist';
const projectToken = 'your_project_token';
shield
.obfuscate(srcPath, destPath, projectToken)
.then(() => console.log('Obfuscation completed successfully!'))
.catch((err) => console.error('Error during obfuscation:', err));
},
},
],
};
Run the command:
npx react-native obfuscate
bin
CommandYou can use the bin
command to obfuscate your project.
npx @bytehide/react-native-shield obfuscate --src ./src --dest ./dist --token your_project_token
This command will obfuscate the source files in the ./src
directory and save the obfuscated files in the ./dist
directory.
MIT
Happy coding but keep it safe with @bytehide/react-native-shield
! 🛡️
FAQs
React Native plugin for ByteHide Shield obfuscation.
The npm package @bytehide/react-native-shield receives a total of 0 weekly downloads. As such, @bytehide/react-native-shield popularity was classified as not popular.
We found that @bytehide/react-native-shield demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.