I need to obfuscate my code as part of company policy. I'm using MSBuild to automate the process with this:
<Exec Command="$(MsBuildPath) /p:Configuration=Release /t:Rebuild;SignAndroidPackage "$(CodeRootPath)\Mfx.UI.Droid\Mfx.UI.Droid.csproj" > "$(OutputPath)\3_BuildApkLog.txt"" />
being the relevant line that builds the solution and creates the apk. I have my obfuscation in a post build event:
COPY $(TargetDir)*.* $(TargetDir)..\..\..\..\Obfuscation\workbench
"C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" "$(TargetDir)..\..\..\..\Obfuscation\Capture.babel"
which copies the output of the build folder to a different folder and calls my babel project, which outputs the obfuscated DLLs to the original build folder. After my batch file completes, the DLLs in bin\Release\ are all obfuscated, but when I decompile my APK, the DLLs within are not obfuscated.
Is there a way to obfuscate the DLLs after the APK is generated or is there a better time to do the obfuscation?