How to use .Net Reactor obfuscated dll Xamarin Android APK

I am new to Xamarin Android. I created the application using Visual Studio 2015 Community Edition. I set up the solution for the release.

For obfuscation, I used .Net Reactor.

This is how I tried to obfuscate

1: As soon as I create the application, I will go to the Bin \ Release folder

2: Obfuscate the app.dll

3: Replace the original dll with obfuscation dll in Bin \ Release, Obj \ Release and Obj \ Release \ assemblylies

4: go to Tools-> Android-> Publish

However, when I tried to publish obfuscation dll, the original dll will be replaced.

So what am I doing wrong? I need to manually pack the apk file. If so, how can I do this?

+4
2

1) .apk, .zip.

2) Mono.Android.dll "" YourProjectName\bin\Release.

3) .NET Reactor, ( Anti ILDASM, , . , .). YourXamarinFolder\YourProjectName\bin\Release.

4) obfuscate_android.bat, :

 "C:\Program Files (x86)\Eziriz\.NET Reactor\dotNET_Reactor.exe" -project "NET_Reactor_Project_Name.nrproj"
  copy "YourProjectName_Secure\YourProjectName.dll" "YourProjectName.dll"
  DEL "YourProjectName_Secure\*.dll" "YourProjectName_Secure\*.pdb" /q

YourProjectName\bin\Release.

5) Xamarin YourProjectName.csproj :

<PropertyGroup Condition = " '$ (Configuration) | $ (Platform)' == 'Release | AnyCPU'">
<! -- Insert here the link to obfuscate_android.bat -->
<PostBuildEvent>obfuscate_android.bat </ PostBuildEvent>
 </ PropertyGroup>

6)

7) .

+1

Xamarin Android Xamarin Studio, .NET Reactor, MSBuild. csproj:

  <Target Name="AfterCompile">
    <Exec Command="&quot;C:\Program Files (x86)\Eziriz\.NET Reactor\dotNET_Reactor.exe&quot; -file &quot;$(ProjectDir)$(IntermediateOutputPath)$(TargetFileName)&quot; -targetfile &quot;$(ProjectDir)$(IntermediateOutputPath)$(TargetFileName)&quot; -suppressildasm 1 -obfuscation 1 -stringencryption 1 -antitamp 1 -control_flow_obfuscation 1 -flow_level 9 -resourceencryption 1 -mono 1 -exception_handling 1" Condition="'$(ConfigurationName)' == 'Release'" />
  </Target>
</Project>

, Xamarin Visual Studio 2015, . " " MSB4018: "LinkAssemblies" ".

** LinkAssemblies, PostBuild true "PostBuildEvent", Ajit .

DLL apk. , .apk( .zip .rar) DLL . .

bin/Release obj/Release, DLL . - DLL apk DLL.

, PostBuildEvent apk?

:

PostBuild true:

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    ...
    <PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
  </PropertyGroup>

"PostBuildEvent" "AfterCompile"

  <Target Name="PostBuildEvent">
    <Exec Command="&quot;C:\Program Files (x86)\Eziriz\.NET Reactor\dotNET_Reactor.exe&quot; -file &quot;$(ProjectDir)$(IntermediateOutputPath)$(TargetFileName)&quot; -targetfile &quot;$(ProjectDir)$(IntermediateOutputPath)$(TargetFileName)&quot; -suppressildasm 1 -obfuscation 1 -stringencryption 1 -antitamp 1 -control_flow_obfuscation 1 -flow_level 9 -resourceencryption 1 -mono 1 -exception_handling 1" Condition="'$(ConfigurationName)' == 'Release'" />
  </Target>
</Project>

** Android VS 2015, , ( , ..). "LinkAssemblies" , , , /.

GitHub, , , . :

https://github.com/nbcruz/TestObfuscate/blob/master/TestObfuscate.zip

obj/Debug, 78 , zip 25 GitHub.

.NET Reactor bin\Release \. DLL, bin\Release\TestObfuscate_Secure. obfuscate.bat bin\Release \, DLL bin\Release\TestObfuscate_Secure bin\Release \. - LinkAssemblies.

+1

All Articles