boski boski - 5 months ago 102
Android Question

How to replace obfuscated .dll to my .apk in Visual Studio / Xamarin project

I am trying to obfuscate my Xamarin / Android project with tool Crypto Obfuscator For .Net v2015 in Visual Studio. When I obfuscate my .dll file what should I do to build my .APK with that crypted .dll?

The problem that exists now is that compiler is replacing older .dll in each build.

Answer

You need to add a build action which will, after build has completed, call your obfuscator through command line and replace the regular dll with the obfuscated one and then the flow will continue to packaging. This process is quite tricky but the key is to figure out the flow of dll's between the projects (in case you have more than one) until they reach the main project and there the flow between the bin and obj directories. Go through your build log to get a better understanding of this.

In your case because you use VS you can consult this entry, while I'd still recommend understanding the whole procedure to leave nothing to chance.