- Python 44.4%
- Java 41.4%
- Shell 12%
- Makefile 2.2%
| java_parser | Fix for GB code update | |
| lib | Initial commit | |
| .gitignore | Update for new GB code | |
| bootstrap.sh | Fix for GB code update | |
| Makefile | Initial commit | |
| parse.py | Update Python code to handle txt and btsnoop files | |
| parse_rfcomm.py | Update | |
| README.md | Update | |
| requirements.txt | Update | |
| rfcomm.py | Add RFCOMM support | |
Java parser
This uses the packet parsing code we implemented in Gadgerbridge to parse bluetooth pcaps.
Last tested on commit https://codeberg.org/Martin.JM/Gadgetbridge/src/branch/huawei_connect_fix.
There are a couple of steps to using this:
- Install the requirements for python
pip install -r requirements.txt(I recommend using a virtual environment) - Get the files from GB
- Pipe the output from
parse.py(with the right arguments) to the Java application:
or./parse.py [bluetooth.pcapng] [mac:address] | make run
if the band uses RFCOMM./parse_rfcomm.py [bluetooth.pcapng] [mac:address] | make run
Also nice: pipe that to a file for easier reading (for example append | tee [file] on Linux).
Note on file format
The file format of the bluetooth.pcapng has to be supported by Scapy.
Most notably, the btsnoop format is not supported.
If encountered, it can easily be converted using Wireshark.
Get files from GB
The easiest way of getting the files would be using a copy.sh script like the following:
#!/bin/sh
GB=/directory/of/Gadgetbridge
rm -rf \
java_parser/huawei \
java_parser/util
cp -r $GB/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei java_parser/huawei
mkdir -p java_parser/util
cp $GB/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/CheckSums.java java_parser/util
cp $GB/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/CryptoUtils.java java_parser/util
cp $GB/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/StringUtils.java java_parser/util
Make sure to change the GB variable to the actual directory where Gadgetbridge is stored.
Then when changing a file in the packet parsing, you can just tun the following two commands to get the updated version:
./copy.sh
make bootstrap
Also run these commands after cloning the repo.