1
votes

I began to use Dotfuscator Community (fresh download) with Visual Studio 2019 integration as part of my Xamarin.Forms build process.

I did the steps listed under: preemptive

When I build, I get the correct build messages from Dotfuscator.

My problem is, that

  1. while Dotfuscator obfuscates the resulting assembly of the shared project, which I can verify by opening the .dll file with ILSpy in the Release's folder, the "same" dll inside the resulting APK is not obfuscated which I can verify by unzipping the APK and opening the shared projects .dll assembly with ILSpy.
  2. Another problem of mine is, that the -otherwise very good and detailed- Xamarin.Forms obfuscation process description on preemptive.com does not detail the APK archivation process especially in the regards of where(*) the APK with the obfuscated assemblies will be placed and how to make sure that the "Archive" command in Visual Studio actually uses the right APK file.
  3. I dont see any smart obfuscator reports which were mentioned in the guide (the Renaming.xml is still in the folder)

(*) APK folders: There are two folders Visual Studio places APKs from the same build config:

  1. This seems to be the main location which is opened directly from the "Archives" menu. C:\Users\Me\AppData\Local\Xamarin\Mono for Android\Archives\2019-08-27\Ch9.Android 8-27-19 6.00 PM.apkarchive
  2. This is the folder for the build config designated for obfuscation: c:\PROG\Ch9\Ch9\Ch9.Android\bin\DotfuscatedGPlayRelease\
  3. Edit1: I have just confirmed that the two APKs in the above locations are identical by content (Totalcommander comapre)
  4. Edit2: I have just rechecked/confirmed that the .dll file (assembly) inside the two identical APK-s (described above) is not identical with the stand alone obfuscaed .dll file inside c:\PROG\Ch9\Ch9\Ch9.Android\bin\DotfuscatedGPlayRelease\ folder

_EDIT 2019.08.28____________________

I have tried to run the Dotfuscator prepared build config on Visual Studio 2017 (15.9.14, yes that's an older one) and can confirm, that the APK package prepared by the "Archive" command contains the dotfuscated assemblies. So at this point it seems that the archive process of VS19 circumvents the dotfuscated assemblies while VS17 works correctly in this regard

1
Hi, I work for PreEmptive, the company that makes Dotfuscator. This may be due to a recent Xamarin update - can you verify the version of Visual Studio you are using (e.g.. 16.1, 16.2, etc.)? - Nathan Arthur
Hi, it sounds like you are/were running into an issue with 16.2, and yes, using an earlier version should work around it. I'll post an update here when we have published a fix for Dotfuscator Community. - Nathan Arthur
A co-worker of mine added an answer to your other post - does that answer your question here about the runtime defects? - Nathan Arthur
Hello, we have updated the Xamarin Targets file (and DLL) that the Community docs tell you to download, to address this issue. Please download them again to make it work with Visual Studio 16.2. - Nathan Arthur
I have copied and included the the new target and dll files in the project. I built my app in VS 2019 (16.2.4) and can confirm that the relevant contents of the produced APK archive file are obfuscated. Thank you very much! Now I close the question - J4ni

1 Answers

1
votes

The faulty behavior has been corrected, see comment section.