Closed whoami-shubham closed 2 years ago
Hi,
Just wanted to let you know this warning when make an archive in xcode:
warning: Obfuscation SKIPPED [Not a bundle command]
Seems it's not working on iOS.
Regards
@andresarezo Thanks for checking this. Could you please tell me what was the options that you passed.
Hi,
I figure out that if I change in xcode -> build Pahses and change ram-bundle to bundle under "Bundle React Native code.."
The warning still showing but the main.jsbundle it's obfuscated!!!
Im passing this config:
const jsoMetroPlugin = require('obfuscator-io-metro-plugin')( { compact: false, sourceMap: true, controlFlowFlattening: true, controlFlowFlatteningThreshold: 1, numbersToExpressions: true, simplify: true, shuffleStringArray: true, splitStrings: true, stringArrayThreshold: 1, }, { runInDev: true, logObfuscatedFiles: true / generated files will be located at ./.jso /, } );
And it's working on iOS.
Sounds good for you?
Yes. Thanks I will add this in readme file.
@whoami-shubham I would love to verify if this works for iOS. How did you decompile .ipa file to extract the .ios.bundle file, please?
@andresarezo May you please elaborate a bit more on your findings? Under build-phases of a react-Native iOS project, I can't see "Bundle React Native code".
And where do you paste this code?
const jsoMetroPlugin = require('obfuscator-io-metro-plugin')(
{
compact: false,
sourceMap: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 1,
numbersToExpressions: true,
simplify: true,
shuffleStringArray: true,
splitStrings: true,
stringArrayThreshold: 1,
},
{
runInDev: true,
logObfuscatedFiles: true /* generated files will be located at ./.jso */,
}
);
Thanks
Its still not fixed @whoami-shubham
it is generating .jso folder with obfuscated code in it but after creating .ipa file its not showing obfuscated code in main.jsbundle file. Do I need to make some changes in Build phases Bundle React native code & images?
I am passing this config: const jsoMetroPlugin = require("obfuscator-io-metro-plugin")( { compact: true, controlFlowFlattening: false, deadCodeInjection: false, debugProtection: false, debugProtectionInterval: 0, disableConsoleOutput: false, identifierNamesGenerator: 'hexadecimal', log: false, numbersToExpressions: false, renameGlobals: false, selfDefending: false, simplify: true, splitStrings: false, stringArray: true, stringArrayCallsTransform: false, stringArrayCallsTransformThreshold: 0.5, stringArrayEncoding: [], stringArrayIndexShift: true, stringArrayRotate: true, stringArrayShuffle: true, stringArrayWrappersCount: 1, stringArrayWrappersChainedCalls: true, stringArrayWrappersParametersMaxCount: 2, stringArrayWrappersType: 'variable', stringArrayThreshold: 0.75, unicodeEscapeSequence: false }, { runInDev: true / optional /, logObfuscatedFiles: true / optional generated files will be located at ./.jso /, } );
module.exports = { transformer: { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, inlineRequires: false, }, }), }, ...jsoMetroPlugin, };
It works for android apps. Just wanted to confirm whether it works for iOS apps. steps to test.
.ipa
file (or any other file which is equivalent ofapk
file in android).ipa
file to extract the.ios.bundle
file.ios.bundle
file content is obfuscated or not, if content is obfuscated it works.