'Decompile APK built with Xamarin

Good day all. I need get C# source code from an apk, I tried a few days ways, but they give me java code.

I built a little game in c# xamarin. I stopped working on it for a while, and now I want continue building it, but I've lost the source code. I have an apk file but cannot get the source code. If there is any way get the source code? Please help me.



Solution 1:[1]

first, extract apk using 7zip or winrar. you can also use APKTool

then go to the assemblies folder and open {appname}.dll with dnSpy or dotPeek. if you're not using Microsoft Windows, there's a cross-platform tool called AvaloniaILSpy.

if you don't see the dll file (only .so files) you need to unpack it with this tool.

I opened with dnSpy

Image

Solution 2:[2]

First use apktools to unpack apk

then use "https://github.com/tjg1/mono_unbundle" to unpack "libmonodroid_bundle_app.so"

then you will get <your_app_name>.dll

open it by dnSpy

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 simonkimi