forked from ikarus23/termux-pm3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
termux-pm3.sh
53 lines (49 loc) · 1.92 KB
/
termux-pm3.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
#
# Copyright 2019 Gerhard Klostermeier
# Usage: bash termux-pm3.sh <install | run | update> [ignore-warnings] [PLATFORM=PM3OTHER]
#
echo "[*] Install dependencies"
apt install -y git make clang --no-install-recommends git ca-certificates build-essential pkg-config \
libreadline-dev gcc-arm-none-eabi libnewlib-dev qtbase5-dev \
libbz2-dev liblz4-dev libbluetooth-dev libpython3-dev libssl-dev libgd-dev
# Get the proxmark3 RDV4 repository. Get the lz4 repository.
echo "[*] Get the Proxmark3 RDV4 repository and the lz4 repository"
git clone https://github.com/RfidResearchGroup/proxmark3.git
git clone https://github.comlz4/lz4
cd lz4
make
function compile {
if [ "$1" == "ignore-warnings" ]; then
# Allow warnings (needed on Android 5.x, 7.x, not needed on 8.x).
echo "[*] Removing the -Werror flag from Makefiles"
sed -i 's/-Werror //g' client/Makefile
sed -i 's/-Werror //g' Makefile.host
# Make the proxmark3 client.
echo "[*] Compiling the client"
make client $2
else
# Make the proxmark3 client.
echo "[*] Compiling the client"
make client $1
fi
}
cd proxmark3
git restore *
compile $2 $3
if [ "$1" == "run" ]; then
# Run Proxmark3 client (needs root for now).
echo "[*] Run the Proxmark3 RDV4 client as root on /dev/ttyACM0"
su -c 'cd proxmark3/client && ./proxmark3 -p /dev/ttyACM0'
if [ "$1" == "update" ]; then
echo "[*] Update the Proxmark3 RDV4 repository"
cd proxmark3
git restore *
git pull
compile $2 $3
else
echo "Usage: bash termux-pm3.sh <install | run | update> [ignore-warnings] [PLATFORM=PM3OTHER]"
echo "Running the Proxmark3 client requires root (to access /dev/ttyACM0)."
echo "Hint: There are plans in the Termux community to support USB-OTG and Bluetooth devices." \
"Maybe then it will be possible to do this without root."
fi