whoami-shubham / obfuscator-io-metro-plugin

A metro plugin to use the javascript-obfuscator library with react-native to obfuscate the bundle after the build.
https://www.npmjs.com/package/obfuscator-io-metro-plugin
MIT License
63 stars 17 forks source link

Obfuscation SKIPPED (Not working em release) #23

Open alexarruda opened 11 months ago

alexarruda commented 11 months ago

The library works normally when the build runs in debug mode, but when run in release mode it does not apply obfuscation.

Displaying "warning: Obfuscation SKIPPED [Not a bundle command]"

React Native 0.72.5 Expo ~49.0.13

viktor-skarlatov commented 11 months ago

Exact same problem. Can't make it work. React Native 0.72.6 Expo ~49.0.15

TheSolly commented 10 months ago

Are there any updates on this issue?

IjzerenHein commented 1 month ago

I think this is because you are using Expo, which uses a different command for bundling. How are you building your release build?

alexarruda commented 3 weeks ago

@ljzerenHein Via Android Studio. First clean with "./gradlew clean" and then Menu Build > Generfated Signed App Bundle / APK.

at the moment: RN 0.74.5 Expo 51.0.28

aliraza943 commented 2 weeks ago

I am also facing the same issue. This is my Metro Config at the moment: RN 0.72.7 Expo 49.0.0

`const { getDefaultConfig } = require('expo/metro-config'); const { mergeConfig } = require('@react-native/metro-config'); const jsoMetroPlugin = require("obfuscator-io-metro-plugin")( { // for these option look javascript-obfuscator library options from above url compact: false, sourceMap: false, // source Map generated after obfuscation is not useful right now so use default value i.e. false controlFlowFlattening: true, controlFlowFlatteningThreshold: 1, numbersToExpressions: true, simplify: true, stringArrayShuffle: true, splitStrings: true, stringArrayThreshold: 1, }, { runInDev: false / optional /, logObfuscatedFiles: true / optional generated files will be located at ./.jso /, } );

const defaultConfig = getDefaultConfig(__dirname); const { assetExts, sourceExts } = defaultConfig.resolver;

let assetExtsExtended = assetExts.filter((ext) => ext !== "svg"); assetExtsExtended.push('glb'); assetExtsExtended.push('png'); assetExtsExtended.push('jpg');

/**

module.exports = mergeConfig(defaultConfig, config); `

Please suggest If you have any solution