Forum Xamarin.Forms

Images are not loaded after obfuscation

BobanMBobanM USMember
edited February 2017 in Xamarin.Forms

The Android app i made using Xamarin Forms works well, until i obfuscate it with Crypto Obfuscator.
The images in this code
BackgroundImage = "background.png"
and
Image image = new Image { Source = "button.png" };
are not loaded after obfuscation.
Any suggestions?

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    The images were probably renamed as part of the obfuscation tool. That is its job after all.
    You'll have to go through the documentation of the tool and see what it says about tagging/attributing resources to not be obfuscated. Every tool is a little different. Maybe you specify the folder to not alter... maybe you specify not changing assets... Maybe you apply an attribute.

  • BobanMBobanM USMember
    edited February 2017

    @ClintStLaurent Thank you for your answer. Apparently removing "Remove Constant Field Values" was the key for this to work.
    Be sure to Clean and Rebuild after changing this in Crypto Obfuscator.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @BobanM
    Thanks for sharing that with the community. No doubt the next person in the same situation will really appreciate you pointing out the right setting. I know I'm not the first person whose spent hours looking for which magic checkbox was the right one. {laugh}

Sign In or Register to comment.