I use this script mainly for debugging Tuya BLE protocol for developing redphx/python-tuya-ble.
- Enable global logging.
- Enable Bluetooth logging.
- Disable SSL pinning.
- Support most apps using Tuya SDK: Tuya Smart, Smart Life, Adaprox Home...
- A Rooted Android phone. I'm using a POCO F3.
- Or you can use an Android Emulator. I tested wit Genymotion and it worked (you might not be able to control BLE devices with it without using a hub).
-
Install the app you want to debug on your phone.
-
Install Frida CLI.
pip install frida-tools
-
Run
frida --v
to get CLI's version. Visit Frida's Release page and download the correct version forfrida-server
. (Ex:frida-server-[VERSION]-android-[ARCH].xz
) -
Install frida-server on your rooted Android phone. Make sure you have Android's
adb
installed.
-
Pair your PC/Mac/Linux with your phone using ADB.
-
Run Frida script
debug.js
:
frida --no-pause -U -f [APP_PACKAGE_NAME] -l debug.js
with [APP_PACKAGE_NAME]
is package name of the app you want to debug. For example: Tuya's package name is com.tuya.smart
.
-
Use Logcat Reader to view and export logs. Remember to filter logs with your app's PID for better results.
-
Try to interact with your device. If you see something like this in logcat then you did correctly (this is the results from testing BLE device).
- Tuya Smart 4.0.2
- Smart Life 4.0.2
- Adaprox Home 4.2.00