APK Analysis Frida
What is Frida?
Frida is a toolkit that enables dynamic interaction with running programs.
Installing Frida
1 | pip install frida-tools |
Then test the installation:
1 | frida --version |
Next, match your device’s architecture (use adb shell getprop ro.product.cpu.abi)
1 | adb shell getprop ro.product.cpu.abi |
Using Frida for APK Analysis
- Connect your Android device via USB and ensure USB debugging is enabled.
- Start the Frida server on your Android device:
1
2
3adb shell
su
frida-server & - List running processes to find your target app:
1
frida-ps -U
- Attach to the target app using its process ID or name:
1
frida -U -n <app_name>
- Inject scripts to manipulate or analyze the app:
1
frida -U -l your_script.js -n <app_name>
- Use Frida’s REPL to interactively explore the app:
1
2frida -U -n <app_name> -f <app_name> --no
-pause - Write custom scripts to hook functions, modify behavior, or extract data:
1
2
3
4
5
6
7Java.perform(function() {
var MainActivity = Java.use('com.example.app.MainActivity');
MainActivity.someMethod.implementation = function() {
console.log('someMethod called');
return this.someMethod();
};
});
- Title: APK Analysis Frida
- Author: Lee Wei Xuan
- Created at : 2025-06-04 17:47:05
- Updated at : 2025-07-25 19:34:27
- Link: https://weixuan0110.github.io/2025/06/04/APK-Analysis-Frida/
- License: This work is licensed under CC BY-NC-SA 4.0.