npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bytehide/react-native-shield

v1.0.5

Published

React Native plugin for ByteHide Shield obfuscation.

Downloads

251

Readme

ByteHide React Native Shield Plugin

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.

Installation

Install the plugin as a development dependency in your project:

npm install --save-dev @bytehide/react-native-shield

Usage Options

1. Using a Standalone Script

You can create a standalone script to perform obfuscation manually.

  1. 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));
  2. Run the script manually when needed:

    node obfuscate.js

2. Adding to package.json Scripts

Include the obfuscation step as a script in your project's package.json:

  1. Modify package.json:

    "scripts": {
      "obfuscate": "node obfuscate.js"
    }
  2. Execute the obfuscation script:

    npm run obfuscate

3. Integration into Build Processes

For Android (build.gradle)

  1. Add a custom task to android/app/build.gradle:

    task obfuscateJs(type: Exec) {
        commandLine "node", "${project.rootDir}/obfuscate.js"
    }
    
    preBuild.dependsOn obfuscateJs

For iOS (Run Script in Xcode)

  1. Go to Build Phases > + Add Run Script Phase in Xcode.

  2. Add the following script:

    node "$SRCROOT/../obfuscate.js"

4. Adding a Custom CLI Command

You can integrate the obfuscation step as a custom React Native CLI command.

  1. 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));
          },
        },
      ],
    };
  2. Run the command:

    npx react-native obfuscate

5. Using the bin Command

You 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.