How to Use reFlutter for Extracting Dart Code from APKs ๐ ๏ธ
ReFlutter is a handy tool that allows you to reverse engineer Flutter apps and extract Dart code, monitor network trafic from APKs. Hereโs a step-by-step guide on how to use reFlutter:
1. Installation ๐ฅ๏ธ
First, you need to install reFlutter. Open your terminal and run the following command:
pip3 install reflutter==0.7.8
This will install the reFlutter tool on your system.
2. Android Setup via Termux ๐ฒ
For Android users using Termux, follow these steps:
-
Open a New Terminal:
- In Termux, open a new terminal session.
-
Get Your IP Address:
- Type
ifconfig
and hit enter. - Copy the IP address of the currently active connection.
- Type
-
Run reFlutter:
- In a fresh terminal, type:
reflutter <path_to_your_apk>
- Press enter.
- In a fresh terminal, type:
-
Choose Option 2:
- reFlutter will prompt you with two options. Select option
2
and hit enter.
- reFlutter will prompt you with two options. Select option
-
Enter IP Address:
- Paste the IP address you copied earlier and press enter.
-
APK Generation:
- reFlutter will generate an APK named
release.RE.apk
.
- reFlutter will generate an APK named
3. Signing the APK ๐
To sign the APK:
- Use MT Manager (an Android file manager with powerful editing features) to sign the APK.
- Or, You can also use
uber-apk-signer
to sign the APK.
4. Install and Run the APK ๐
Once the APK is signed:
- Install it on your Android device.
- Run the app.
5. Finding the Dump File ๐
Root Users:
- Go to
/data/data/<package_name_of_app>/
. - You’ll find the
dump.dart
file here.
Non-Root Users:
-
Using PC:
- Open a terminal and run:
adb -d shell "cat /data/data/<package_name_of_app>/dump.dart" > dump.dart
- Open a terminal and run:
-
Using Android (MT Manager):
- Use the inject document provider function in MT Manager to access the
dump.dart
file.
- Use the inject document provider function in MT Manager to access the
Conclusion ๐ฏ
With these steps, you can successfully use reFlutter to extract Dart code from Flutter apps. Whether youโre a root user or not, this guide has got you covered!
Happy reversing! ๐ง๐ป