

The R8 step should always be used in Release mode in conjunction with Linker set as SDK and User Assemblies to produce the smallest aab's (or apks if you must). As you have experienced, you will still need to use proguard.cfg in your app to replace code that R8 might erroneously strip out. The R8 documentation supplied by Google is just as relevant, except that Xamarin set obfuscation off. However, that doesn't mean you shouldn't use them, because they do still reduce the size of the java code in your Xamarin.Android project. Using R8 (and Proguard previously) doesn't obfuscate when used with Xamarin. I know there must be someone out there who understands the issues! Thank you!! I would really appreciated some advice with this. Is this the case? If so, then I am probably wasting my time pursuing r8 and I should probably return to Dotfuscator and put some effort into getting that working.

I did find an article which stated that r8 only obfuscated java code, not C#. r8 had certainly not done what I had expected.

However, looking at the compiled code with ILSpy, all my classes, methods, etc. It crashed at first, but after changing the configuration to exclude one of the AppCompat libraries, my app built and ran fine. (It was previously working.) I then tried r8. Here is where I am at the moment: I followed the installation instructions on the PreEmptive website and built my app with Dotfuscator, but it crashed during loading. A lot seems to be happening in this area right now. Various articles seem to contradict one another, but the reason for that might be that some of them are outdated. I cannot get a clear view on whether I should be pursuing r8 or Dotfuscator - or neither. Rather than waste a lot more time on getting something to work which won't ultimately do what I need, I wonder if someone could point me in the right direction. I have tried both alternatives, but without success so far.
#Remux vs obfucate how to
Looking into how to do this under Xamarin Android, I came across dotfuscator, which seemed to be the tool more closely integrated with Visual Studio. Google recommend r8 for code obfuscation prior to releasing an app on the Play Store.
#Remux vs obfucate android
I am currently building an app (yes, my first) under Xamarin Android (Visual Studio 2019). After far more hours googling than I care to admit, I hope that someone can give me a clear steer on whether I should be using r8, dotfuscator CE or neither for code obfuscation!
