javascript-obfuscator / react-native-obfuscating-transformer

Obfuscation for React Native bundles
MIT License
195 stars 99 forks source link

How to use react-native-obfuscating-transformer with multiple transformers/resolvers #23

Open ghost opened 4 years ago

ghost commented 4 years ago

I'm trying to add multiple resolvers and transformers using metro for my react native project, how do I combine them and obfuscate the code.

I am using metro-babel-transformer and react-native-svg-transformer

var upstreamTransformer = require("metro-babel-transformer");
var svgTransformer = require("react-native-svg-transformer");

module.exports.transform = function({ src, filename, options }) {
if (filename.endsWith(".svg")) {
    return svgTransformer.transform({ src, filename, options });
  }  else {
    return upstreamTransformer.transform({ src, filename, options });
  }
};

My transformer.js look like this

juanjsebgarcia commented 4 years ago

Check out this comment by @AustinZuniga https://github.com/javascript-obfuscator/react-native-obfuscating-transformer/issues/2#issuecomment-595575844

geraintwhite commented 3 years ago

Did anyone make this work with react-native-svg-transformer?

benduongquangmobile commented 2 years ago

Same issue

xhirazi commented 2 years ago

@grit96 @benduongquangmobile

follow this to resolve

Ttecs commented 2 years ago

I had the same problem.instead of using react-native-obfuscating-transformer I used obfuscator-io-metro-plugin

https://stackoverflow.com/questions/72695239/configure-react-native-obfuscating-transformer-and-react-native-svg-transformer/72698465#72698465