AOT or Obfuscate XF android app?

LMiles 6 Reputation points
2020-11-26T13:11:24.463+00:00

Hello,

I'm going through the throws of obfuscating my XF app.
The actual Android project does not really need obfuscating but the Shared project does.

If I set "AotAssemblies>true</AotAssemblies" in the android .csproj, does this AOT the shared assembly too?
Can/Should I add "AotAssemblies>true</AotAssemblies" to the Shared .csproj file.

Lastly, in lieu of obfuscation, is AOT enough to protect code?

Excuse my ignorance on this, I seldom dive into editing .csproj files...

Thanks

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JessieZhang-MSFT 7,706 Reputation points Microsoft Vendor
    2020-11-27T09:19:03.673+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    If I set "AotAssemblies>true</AotAssemblies" in the android .csproj, does this AOT the shared assembly too?

    If we change code or set some properties on Android platform, it will only work on the Android platform.

    There are some good threads about this, you can first read through them:

    https://stackoverflow.com/questions/37377106/enable-aot-in-xamarin-for-android-visual-studio

    https://stackoverflow.com/questions/51961132/xamarin-forms-android-aot-support

    Best Regards,

    Jessie Zhang

    ---

    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments