This section is very much a work in progress.
There are a few steps you need to follow to get this all to work...
- Create an emulator using a non-Google Play Store version
- Download a Dreo app APK from any of the various Google Play Store downloaders
The Dreo app uses certificate pinning. You can use Frida to get around that. Full instructions are here: https://httptoolkit.com/blog/frida-certificate-pinning. The following are the steps I followed: . Download and extract the Frida Android Server from here: https://github.com/frida/frida/releases.
-
Windows can extract the
.xz
archive format. -
Copy the binary and start Frida on your device as follows:
# Copy the server to the device adb push ./frida-server-$version-android-$arch /data/local/tmp/frida-server # ^Change this to match the name of the binary you just extracted # Enable root access to the device adb root # Make the server binary executable adb shell "chmod 755 /data/local/tmp/frida-server" # Start the server on your device adb shell "/data/local/tmp/frida-server &"
-
Install Frida on your PC using Python
pip install frida-tools
-
You can test this by running
frida-ps -U
. This will connect to the server via USB (-U) and list the details over every running process on the target device. If this shows you a list of processes, you're set
-
Use Fiddler Classic (http://www.fiddlertool.com) to get a network trace to see what the Dreo app is doing. I won't document here how to setup Fiddler as a proxy or do SSL decryption; Fiddler documentation is pretty good.
-
Create a Fiddler rule where this line is added to
OnBeforeRequest
oSession.oRequest["ua"] = "dreo/2.5.12 (sdk_gphone64_arm64;android 13;Scale/2.625)";
-
Get the Fiddler root CA from the Fiddler Options and use certutil.exe to get the PEM version. You'll need it later.
certutil -encode c:\in.cer c:\out.pem
-
Clone the following repo which contains a bunch of handy scripts: https://github.com/httptoolkit/frida-interception-and-unpinning
-
Navigate to that cloned repo
-
Modify
config.js
appropriately. Note you'll need the base 64 cert from Fiddler. My file looks something like this...// Put your CA certificate data here in PEM format: const CERT_PEM = `-----BEGIN CERTIFICATE----- MIIDozCCAougAwIabcxyzabcxyzabcxyzabcxayzaa abcxyzabcxyzabcxyzabcxyzabcxyzabcxyzabcxyz abcxyzabcxyzabcxyzabcxyzabcxyzabcxyzabcxyz abcxyzabcxyzabcxyzabcxyzabcxyzabcxyzxpOyo= -----END CERTIFICATE-----`; // Put your intercepting proxy's address here: const PROXY_HOST = '192.168.xx.yy'; const PROXY_PORT = 8888;
-
Start Frida on your PC. This will cause the app on the emulator to restart with correct settings.
frida -U -l ./config.js -l ./native-connect-hook.js -l ./android/android-proxy-override.js -l ./android/android-system-certificate-injection.js -l ./android/android-certificate-unpinning.js -l ./android/android-certificate-unpinning-fallback.js -f com.hesung.dreo