Attaching frida tutorial
This tutorial explains how to attach a Frida script to Brawl Stars. Frida is a dynamic instrumentation toolkit that lets you inject scripts into running processes.
NOTE: MT Manager does not decompile dex files use something like apktool.
Steps:
-
Copy the Frida script:
- Place your Frida script into the
/lib/arch/
directory within the APK. Replace arch with the appropriate architecture (eg. armabi-v7 or armabi-v8) - Name the script
libXXX.script.so
, whereXXX
can be any name (e.g.,libdebug.script.so
).
- Place your Frida script into the
-
Create a configuration file:
-
In the same directory as frida script, create a configuration file named
libXXX.config.so
(e.g.,libdebug.config.so
). -
This file should contain the following JSON content, which tells Frida how to interact with the script:
{"interaction": {"type":"script","path":"libXXX.script.so","on_change":"reload"}}
-
-
Add frida gadget:
- Download Frida gadget
- Place it inside of libXXX.so.
-
Modify the application’s Smali code:
Offline
-
Open the
smali/com/supercell/titan/GameApp.smali
file. -
Locate the line containing
"g"
. -
Move below the invoke of whatever offline script you have with anticheat kill.
-
Insert the following Smali code to load your Frida script:
const-string lib, "XXX"invoke-static {lib}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)VReplace
"XXX"
with the name you used in step 1 (e.g.,"debug"
).
BSD
-
Open the
smali/com/supercell/titan/TitanApplication.smali
file. -
Locate the line containing
"BSD"
. -
Move below the invoke.
-
Insert the following Smali code to load your Frida script:
const-string lib, "XXX"invoke-static {lib}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
-