Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 256
Levani Titberia Avatar asked May 21 '17 13:05

Levani Titberia


Video Answer


2 Answers

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

like image 118
Erfan Azhdari Avatar answered Oct 06 '22 13:10

Erfan Azhdari


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

like image 35
simonkimi Avatar answered Oct 06 '22 13:10

simonkimi