locked
Xamarin Forms Dotfuscator confusion. RRS feed

  • Question

  • User240075 posted

    In the Xamarin Forms Prepare for Release guide mentioned, we should use Dotfuscator to protect code.

    However, I have been trying this and testing in different settings for about two days now. Result is horrifying.

    DI across platform with DependencyService, Dotfuscator doesn't support. So, all cross platform services can't be Dotfuscatored. Custom Renderer, which is also cross platform, Dotfuscator doesn't support. So, all Custom Renderers can't be Dotfuscatored. MVVM, Dotfuscator doesn't support. So, views, pages, view models, page models, can't be Dotfuscatored. Unity DI, Dotfuscator doesn't support. So, all services which depend on DI can't be Dotfuscatored. Entities, obviously can't Dotfuscator this, all DB table names, column names are mapped with entities.

    So, what's left? Static helpers and single classes if you have any. If this is true, seems like not much point to consider Dotfuscator at all.

    If anyone has experience with Dotfuscator, please share, please let me know if I'm doing anything wrong. Any suggestions are welcome.

    Thanks in advance.

    Sunday, November 20, 2016 6:16 PM

All replies

  • User57869 posted

    I tried ConfuserEx and Crypto Obfuscator. Dotfuscator had no price on their website so they disqualified themselves for me.

    I also had big troubles to get the obfuscator working. Especially with a renaming obfuscation. You may try deactivating that and use only the other obfuscation options. The best way is to deactivate most options and only leave one small thing. If that works, then you can try to activate one after the other. This takes quite long, but it's the only way to really say which option is the problem.

    I use TinyIOC instead of Xamarins DependencyService. That was no problem with the obfuscator.

    I ended up using ConfuserEx and deactivating the renaming for some of my custom renderers. They used nested classes as custom adapters which were just ignored when I renamed them. No idea why.

    Monday, November 21, 2016 12:06 PM
  • User240075 posted

    Thanks for the reply @MichaelRumpler

    After two days fiddling around with Dotfuscator, like you said activate settings and classes one after the other, I managed to get DI service classes working with it. That's it, the others classes still crashes after Dotfuscator.

    Technically, if any obfuscator can run before build and rename classes and properties, it should work. Because there is no magic strings in binding and setting up page layout.

    However, after I tried Dot Peek, it seems even you don't use magic strings for binding, once it gets build, it's still a "string" in DLL. I think that's why all renaming obfuscator fail to deal with Views/Pages and Models.

    I think I'll give ConfuserEx a try next time, this is a way too exhausting task. :(

    Monday, November 21, 2016 1:20 PM