Xamarin weakening

Is there anything that does obfuscation? I tried Crypto Obfuscator for Android, and when I decompiled using dex2jar, I do not see the difference between obfuscation and normal build. So far I have been looking at the following links:

http://forums.xamarin.com/discussion/14962/light-obfuscation

Mono for Android, code obfuscation

Thanks Jay

+4
source share
2 answers

You are referring to a forum post on xamarin.com ("Light Obfuscation"). There, now I added an explanation of how to mess with Xamarin Studio and Babel for .NET.

I will repeat it here:

Visual Studio, . Babel .NET Xamarin Studio ( Windows). Mac, , .

, , Android Xamarin Studio:

, Xamarin Studio MSBuild, Babel MSBuild.

( Babel) :

( 1)

.csproj . Xamarin Studio .

<Project>

    [... All existing stuff ...]

    <UsingTask TaskName="Babel" AssemblyName="Babel.Build, Version=6.4.0.0, Culture=neutral, PublicKeyToken=138d17b5bd621ab7" />
    <Target Name="AfterBuild" Condition=" '$(Configuration)' != 'Debug' ">
    <Babel InputFile="$(TargetPath)" OutputFile="$(TargetPath)" GenerateDebug="true" 
    [...]
    RulesFiles="babel.xml" 
    SuppressIldasm="false" ObfuscateTypes="true" ObfuscateProperties="true" ObfuscateEvents="true"      ObfuscateMethods="true" 
    ObfuscateFields="true" VirtualFunctions="true" FlattenNamespaces="false" 
    StringEncryption="true"
    />
    </Target>

</Project>

, , Debug ( Release), . xml, . (, ..)

: : , , enum "", "". , ( ), . . , "", "MainActivity".

( 2)

, :

BABEL : error : Could not resolve assembly: 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'

, Hello-World Android . . ( ) :

[Activity(
    Label = "The name of my game", 
    MainLauncher = true, 
    WindowSoftInputMode = SoftInput.AdjustPan,
    ConfigurationChanges = ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.Orientation | ConfigChanges.ScreenSize
)]

"" "MainLauncher" . "WindowSoftInputMode" "ConfigurationChanges" .

, [Activity (...)] .cs AndroidManifest.xml. , .

, Activity . , ILSpy , # "WindowSOftInputMode" "ConfigurationChanges". , , . , , "Label" "MainLauncher" (string bool), . Mono.Android.dll, , , . , Xamarin dll, AndroidManifest.xml .

+4

Dotfuscator CE ( Visual Studio) Dotfuscator PRO ( ) Xamarin: . Xamari : Xamarin

Dotfuscator, Xamarin MSBuild. Xamarin. Xamarin Dotfuscator "Mono Compatible" ​​ "", "controlflow.disabled_manglers" "ILSpyBreaker".

, Xamarin, , ( ). , , , , .

csproj Android iOS Dotfuscate AfterBuild, :

<UsingTask TaskName="PreEmptive.Tasks.Dotfuscate" AssemblyFile="$(MSBuildExtensionsPath)\PreEmptive\Dotfuscator\4\PreEmptive.Dotfuscator.Tasks.dll" />
////SNIP////
<Target Name="AfterBuild">
<PropertyGroup>
    <DotfuscatorProperties>
        <OutDir>$(OutDir)</OutDir>
        <OutputPath>$(OutputPath)</OutputPath>
    </DotfuscatorProperties>
</PropertyGroup>
<Dotfuscate ConfigPath="Obfuscate.Android.xml"    Properties="$(DotfuscatorProperties)"/>
</Target>

, Dotfuscator. , OutDir OutPath. , Dotfuscator, Dotfuscator, , .

Xamarin , . Android , PCL . - Dotfuscator :

"ObRelease" / "ObDebug" , . Condition Dotfuscate csproj (: Condition = "'$ ()' == 'ObRelease'" ). , "" Android " " " " " Android" "".

Dotfuscator Visual Studio Xamarin Studio.

-1

Source: https://habr.com/ru/post/1533723/


All Articles