react-native-obfuscating-transformer icon indicating copy to clipboard operation
react-native-obfuscating-transformer copied to clipboard

App gets close immediately after release, but without this package works well

Open ghost opened this issue 5 years ago • 5 comments

ghost avatar Feb 18 '20 19:02 ghost

Hi,

we had to exclude index.js from transforming by adding it to transformer.js:

const filter = filename => {
	return filename.startsWith("app") // all our sources that should be transformed are in folder app
		&& !filename.startsWith("app/components/index") // skip this file due to NoSuchKeyException
		;
};

Furthermore we've had to add these rules for proguard: https://github.com/facebook/react-native/blob/master/ReactAndroid/proguard-rules.pro

Hope this helps.

Best regards, Marco

mppperez avatar Feb 20 '20 12:02 mppperez

Thank you, could you please let me know that what is difference between progaur and this package ?

ghost avatar Feb 20 '20 12:02 ghost

Proguard is Androids mechanism to obfuscate Java-Files. It looks that it isn't used anymore since Android Gradle Plugin 3.4.0 but it's config files are still used (backwards compatible):

https://developer.android.com/studio/build/shrink-code

mppperez avatar Feb 20 '20 13:02 mppperez

Another tip: use the config parameter "enableInDevelopment" (transformer.js) during development so that such errors are revealed before releasing your app. You can disable it after successful testing afterwards to speed things up again in development mode.

mppperez avatar Feb 20 '20 13:02 mppperez

this package will not affect on performance ?

ghost avatar Apr 16 '20 20:04 ghost