[TUTORIAL] Managed DLL Injector By Ruit

5 posts in this topic

This is my second tutorial, today i will show how to inject DLL for Unity games which use mono scripting backend.
Basic knowledge of the apkBasic knowledge of smaliBasic knowledge of C#What we will do?
Decompile apkCheck and add the external read ad write permission in AndroidManifest.xmlInsert our java class inside smali/com/Inject our load function in theMainActivity of apkInsert our libRecompile apkSign apkSo now the first step is to download RuitMono (download will be down below) and then get the apk on your desktop, i mostly use ->apkpure<- to get them.
I will test this on the game called ->subway surfers<-.
Once you get it, you'll need to decompile it, i suggest ->Apk Easy Tool<-
You will also need ->notepad++ <- to edit AndroidManifest.xml and smali files.

Let's Start.
Now in AndroidManifest.xml, first check if external read and write permission are already added so we don't duplicate them.
These permission are important to read and write the DLL and our Config.ini from the sdcard.


If its there already then skip this step, and if it's not then write it there with the other permissions, don't write it somewhere elseunless you know what you are doing.


<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Now we need to find the main activity of theapk, to do that simply look at activities inside AndroidManifest.xml and see which one has main action like this


Thats how you know the main activity of an apk.
Now scroll right to see the name of it.


Now we know the main activity name and we can locate it, This can be found in smali files.
Open Smali folder go to com/kiloo/unityutilities/UnityPluginActivity
Now click edit on UnityPluginActivity.smali
You will see some functions there, Search for onCreate


There we will inject our load function, make sure to write it right above return-void since it will work most of the time, you can place it under .prologue as well.


invoke-static {}, Lcom/JvRuit/Ldr;->RtMono()V

Now Insert JvRuit folder inside smali/com/ 


Now go into the folder lib/, you will see x86 and armeabi-v7a, in our folder insert

Hidden Content

    Give reaction or reply to this topic to see the hidden content.
the one inside armeabi-v7a to the game armeabi-v7a folder, same with x86 folder.
But if your device doesn't run x86 then you can skip the x86 folder or even delete it.


We are almost done, now we have finished from editing the apk, recompile it and sign it.
Now we need to configure our client.
Open Config.ini inside the RuitMono_Client folder


This is an example. Locate your dll path, Write your dll name, Write the namespace name, Write the Class name, Write the method name that will be executed once we inject the dll, and finally
The application ID should be the same as the game obb folder name or you can find it by this app ->PackageViewr<-
Package Viewr will show you the package name of the game, the application id is the same.
Here is another option to get the application id


Now once you finish from the Config.ini, Move RuitMono_Client folder to your /sdcard/,
It won't work if you place the folder somewhere else. it has to be inside sdcard dictionary only.
After that you can install the modded apk and play, the injection will work on the background, it might take a minute or two for injection to complete.
I have included example dll there you can test on it, you will also need to have some knowledge on unity engine to make menus or whatever but this is another topic, so now we are done, here is the download link. 

RuitMono ->   

Hidden Content

    Give reaction or reply to this topic to see the hidden content.
Unity GUI Helper Script for anyone who is interested ->    

Hidden Content

    Give reaction or reply to this topic to see the hidden content.


  • Like 8
  • Thanks 2
  • GREAT 5

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.