I'm developing a Xamarin.Forms app using Visual Studio for Mac (Community Edition). I'm able to decompile the source code of the Android application using ILSpy
In order to obfuscate the source code, I used Obfuscar and followed the steps in https://docs.obfuscar.com/tutorials/xamarin.html
- Below is the Xamarin.Android project structure
- Below is the configuration in
obfuscar.xml
<Obfuscator>
<Var name="RenameProperties" value="true" />
<Var name="RenameEvents" value="true" />
<Var name="RenameFields" value="true" />
<Var name="KeepPublicApi" value="false" />
<Var name="HidePrivateApi" value="true" />
<Var name="HideStrings" value="true" />
<Var name="UseUnicodeNames" value="true" />
<Var name="OptimizeMethods" value="true" />
<Var name="InPath" value="./bin/Release" />
<Var name="OutPath" value="./bin/Release/Obfuscator_Output" />
<Module file="$(InPath)/Sample.dll" />
</Obfuscator>
- Below changes are done in the Android.csproj
When the project is built in the Release
mode, Archived, and Decompiled, the source code is still visible in plain text using ILSpy.
I need help in configuring Obfuscator correctly for the Xamarin.Forms project