Help! Enable android unity game runs on background

KmzLy

Platinian
Original poster
Jul 17, 2019
14
12
3
?
Hi, I played a game called Evil Hunter Tycoon. It's seem the game been build using Unity and I don't know exactly which version. As a background of this, I'm android native developer since 2016 as far I can remember and I never mod a game. About this game, I used standard normie approach using apktools. Successfully decompile the apk, and just looking around the codes. I don't know exactly where to start. I don't know Unity using standard android application life-cycle like the picture below. If Unity use this life-cycle, perhaps I can mod the apps into thinking that the game is "running" while its on background. I don't know where to start, what should I do?
1629221372245.png
 

Yaskashije

PMT Elite Modder
Staff member
Modding-Team
Sep 9, 2018
4,407
843,288
1,213
Minkowski Space
You already have there some keywords you could use to try to achieve your purpose.
Here is a tutorial in case you need to know the basics of how il2cpp games are modded.

As for the tip, you want to change the cycle behaviour, what could be done to do so?
You will requiere some arm assembly knowledge unless there's some easier way I can't think of.
 

KmzLy

Platinian
Original poster
Jul 17, 2019
14
12
3
?
Thanks for reply, I did search on available threads. Right now, I'm using il2cppdumper but the output seem to have some errors. il2cppdumper asked to input the index dump address, I input 0 and the output is shown below.

Code:
Initializing metadata...
Metadata Version: 24.2
Initializing il2cpp file...
Detected this may be a dump file.
Input il2cpp dump address or input 0 to force continue:
0
Applying relocations...
Il2Cpp Version: 24.2
Searching...
Change il2cpp version to: 24.4
CodeRegistration : 35f8f60
MetadataRegistration : 35f9188

Dumping...

ERROR: Some errors in dumping
ERROR: Some errors in dumping
ERROR: Some errors in dumping

<and errors many more>

Done!

Generate struct...

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Il2CppDumper.Il2CppExecutor.GetTypeDefName(Il2CppTypeDefinition typeDef, Boolean addNamespace, Boolean genericParameter) in /home/host/Programs/github/Il2CppDumper/Il2CppDumper/Utils/Il2CppExecutor.cs:line 149
   at Il2CppDumper.StructGenerator.CreateStructNameDic(Il2CppTypeDefinition typeDef) in /home/host/Programs/github/Il2CppDumper/Il2CppDumper/Outputs/StructGenerator.cs:line 880
   at Il2CppDumper.StructGenerator.WriteScript(String outputDir) in /home/host/Programs/github/Il2CppDumper/Il2CppDumper/Outputs/StructGenerator.cs:line 51
   at Il2CppDumper.Program.Dump(Metadata metadata, Il2Cpp il2Cpp, String outputDir) in /home/host/Programs/github/Il2CppDumper/Il2CppDumper/Program.cs:line 248
   at Il2CppDumper.Program.Main(String[] args) in /home/host/Programs/github/Il2CppDumper/Il2CppDumper/Program.cs:line 102
Press any key to exit...
The output file is generated well, but doesn't have many functions. This kinda weird.

As for the tip, you want to change the cycle behaviour, what could be done to do so?
You will requiere some arm assembly knowledge unless there's some easier way I can't think of.
No, perhaps I can move the codes to another cycle. In Android java, life-cycle function from the pic above is just inherit function. Maybe, it's the same for the case, I don't know.
 

RedXen

Awesome Active Platinian
Jul 8, 2021
106
1,849
193
Norway
Oh no. Any way around?
First of all, you want to make sure that you're using the latest version of il2cpp dumper because the older versions can cause this error. (The game isn't always protected). Secondly, if the game is made in Unity then it's easy to achieve this. Here's the link to what you need: Unity - Scripting API: Application.runInBackground It can be used in the context of: (Application.runInBackground = true;) hope that helps. :D
 
  • Like
Reactions: KmzLy