Starting an emulator
- Install Android studio.
- open virtual device manager in more actions.
- Install a new device with OS not latest and not oldest.
- Use RootAVD to install Magisk.
- It will root the device too.
- Install Burp certificate.
- Add Alwaystrustusercert.zip in magisk module.
- add proxy in emulator network.
- Now try to intercept the request using burp.
- If not, install frida. frida version and frida server version should be same.
- put frida-server in /data/local/tmp and run.
- you can hook frida scripts using frida-tools (pip install frida-tools)
Reference: https://youtu.be/QzsNn3GhYYk?si=8oJoicIq21IRq-hz
To install and run a rooted AVD in android studio
https://infosecwriteups.com/get-yourself-a-rooted-android-virtual-device-avd-fb443d590dfa
To root a AVD
https://proandroiddev.com/root-an-android-emulator-avd-9f912328ca08
Using Magisc
If you rooted your device with Magisc (maybe an emulator), and you can’t follow the previous steps to install the Burp cert because the filesystem is read-only and you cannot remount it writable, there is another way.