Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obfuscation SKIPPED (Not working em release) #23

Open
alexarruda opened this issue Nov 17, 2023 · 5 comments
Open

Obfuscation SKIPPED (Not working em release) #23

alexarruda opened this issue Nov 17, 2023 · 5 comments

Comments

@alexarruda
Copy link

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
Copy link

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

@TheSolly
Copy link

TheSolly commented Jan 3, 2024

Are there any updates on this issue?

@IjzerenHein
Copy link

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

@alexarruda
Copy link
Author

alexarruda commented Oct 15, 2024

@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
Copy link

aliraza943 commented Oct 25, 2024

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');

/**

  • Metro configuration
  • https://facebook.github.io/metro/docs/configuration
  • @type {import('metro-config').MetroConfig}
    */
    const config = {
    transformer: {
    getTransformOptions: async () => ({
    transform: {
    experimentalImportSupport: false,
    inlineRequires: false,
    },
    }),
    babelTransformerPath: require.resolve("react-native-svg-transformer")
    },
    resolver: {
    assetExts: assetExtsExtended,
    sourceExts: [...sourceExts, "svg", 'js', 'jsx', 'json', 'ts', 'tsx', 'cjs', 'mjs']
    },
    ...jsoMetroPlugin,
    };

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

Please suggest If you have any solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants