Skip to content

Latest commit

 

History

History
168 lines (137 loc) · 4.28 KB

File metadata and controls

168 lines (137 loc) · 4.28 KB

Install

Linux - (Ubuntu recommended, no patched kernel needed except for kamakiri)

Install python >=3.10, git and other deps

Download source

sudo apt install git build-essential curl libssl-dev python3-pip -y

Use here github username for user and github token for password

git clone https://github.com/bkerler/mtkclient --recursive

For Debian/Ubuntu (here assuming fresh install)

Install pyenv

curl https://pyenv.run | bash
  1. Follow the instructions and add
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

to ~/.profile and ~/.bashrc for example using nano ~/.profile, paste at the end, then ctrl-o, enter, ctrl-x

  1. Add this line eval "$(pyenv virtualenv-init -)" to the end of ~/.bashrc
sudo apt install libbz2-dev liblz4-dev liblzma-dev python3-tk tk-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev -y
sudo cp mtkclient/Setup/Linux/*.rules /etc/udev/rules.d/
sudo udevadm control -R && sudo udevadm trigger && cd ..
sudo usermod -aG dialout $USER && sudo usermod -aG plugdev $USER

Reboot the PC, then :

pyenv install 3.13
pyenv global 3.13

Setup additional requirements

sudo apt install google-android-platform-tools-installer
sudo apt install libfuse-dev
sudo apt install libxcb-cursor0

Setup requirements using pip

Open up a new terminal

cd mtkclient && pip3 install -r requirements.txt

Setup requirements using uv

Open up a new terminal

cd mtkclient && uv sync --frozen

For ArchLinux

(sudo) pacman -S  python python-pip python-pipenv git libusb fuse2

or

yay -S python python-pip git libusb fuse2

For Fedora

sudo dnf install python3 git libusb1 fuse-libs
sudo cp Setup/Linux/52-mtk.rules /etc/udev/rules.d/52-mtk.rules
sudo udevadm control --reload-rules && sudo udevadm trigger

Using venv

python3 -m venv ~/.venv
git clone https://github.com/bkerler/mtkclient
cd mtkclient
. ~/.venv/bin/activate
pip install -r requirements.txt
pip install .

Install rules

sudo usermod -a -G plugdev $USER
sudo usermod -a -G dialout $USER
sudo cp Setup/Linux/*.rules /etc/udev/rules.d
sudo udevadm control -R
sudo udevadm trigger

Make sure to reboot after adding the user to dialout/plugdev. If the device has a vendor interface 0xFF (like LG), make sure to add "blacklist qcaux" to the "/etc/modprobe.d/blacklist.conf".


macOS

Install brew, macFUSE, OpenSSL

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install macfuse openssl

You may need to reboot

Grab files

git clone https://github.com/bkerler/mtkclient
cd mtkclient

Create python 3.9 venv and install dependencies

python3.9 -m venv mtk_venv
source mtk_venv/bin/activate
pip3 install --pre --no-binary capstone capstone
pip3 install PySide6 libusb
pip3 install -r requirements.txt

Use kamakiri (optional, only needed for mt6260 or older)

  • For linux (kamakiri attack), you need to recompile your linux kernel using this kernel patch :
sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev libdw-dev
git clone https://git.kernel.org/pub/scm/devel/pahole/pahole.git
cd pahole && mkdir build && cd build && cmake .. && make && sudo make install
sudo mv /usr/local/libdwarves* /usr/local/lib/ && sudo ldconfig
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-`uname -r`.tar.xz
tar xvf linux-`uname -r`.tar.xz
cd linux-`uname -r`
patch -p1 < ../../mtkclient/Setup/kernelpatches/disable-usb-checks-5.10.patch
cp -v /boot/config-$(uname -r) .config
make menuconfig
make
sudo make modules_install
sudo make install
  • These aren't needed for current ubuntu (as make install will do, just for reference):
sudo update-initramfs -c -k `uname -r`
sudo update-grub

See Setup/kernels for ready-to-use kernel setups

  • Reboot
sudo reboot