How to Install
prerequisite
You need to have on your system these packages installed:
git
python3
python3-pip
liblzma5
apktool
adb
Asthook works with all versions of python 3.
For decompiler as Jadx you will probably need openjdk 8 or above.
installation
If you want to install from sources or have a clean development environment. I advise you to use a virtualenv and follow theses command:
git clone --recursive -j8 https://gitlab.com/MadSquirrels/mobile/asthook.git
cd asthook
pip3 install -r requirements.txt
pip3 install .
If you have an easy installation use install and unistall script:
git clone --recursive -j8 https://gitlab.com/MadSquirrels/mobile/asthook.git
cd asthook
./install.sh
Setup sdktools:
wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
mkdir <sdktoolspath>
cd <sdktoolspath>
unzip commandlinetools-linux-6200805_latest.zip
mkdir cmdline-tools
mv tools/ cmdline-tools/
You should add ANDROID_SDK_ROOT environment variable with <sdktoolspath>
For bash:
echo 'export ANDROID_SDK_ROOT=<sdktoolspath>' >> ~/.bashrc
For Fish:
echo "set -x ANDROID_SDK_ROOT <sdktoolspath>" >> ~/.config/fish/config.fish
To use directly android command you need to update $PATH environment variable
echo 'PATH="$PATH:<sdktoolspath>/cmdline-tools/tools/bin"' >> ~/.bashrc
I advise you to update your sdkmanager environment and accept licenses with theses commands:
sdkmanager --update
yes | sdkmanager --licenses
Install the minimum with the correct version when I wrote that it looks like that:
sdkmanager "platform-tools" "platforms;android-30" "build-tools;30.0.2" "emulator"
Warning
If an error you can check the list of package available and update it
sdkmanager --list
To create a virtual phone without android studio you can use avdmanager command. Be careful, if you wanted a rooted phone you should not use a phone with google api.
Examples:
# Not rooted phone with android 25
sdkmanager 'system-images;android-25;google_apis;x86_64'
avdmanager create avd --force --name not_rooted_phone --abi google_apis/x86_64 --package 'system-images;android-25;google_apis;x86_64'
# Rooted phone with android 25
sdkmanager 'system-images;android-25;default;x86_64'
avdmanager create avd --force --name rooted_phone --abi default/x86_64 --package 'system-images;android-25;default;x86_64'
You can now list your virtual phone:
avdmanager list avd
Documentation
Make this documentation:
cd docs
pip3 install -r requirement.txt
make render