> For the complete documentation index, see [llms.txt](https://cas-cyber.gitbook.io/cas-cybersecurity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cas-cyber.gitbook.io/cas-cybersecurity/android-malware/lab-setup-1.md).

# LAB Setup 1

### 1. Tool and LAB Setup with Android Studio

For some exercises we need Android Studio that we can install and emulate android apps. To run a virtualization inside a virtual machine is not even easy and it's possible that the emulator won't work or bring the whole VM to crash.  I got it to work inside my Kali Linux box, but it's also possible to run Android Studio native on the client.

<div align="left"><img src="/files/fsIkFam8aEOLMSCNrUYI" alt=""></div>

If you use Windows you can't use Hyper-V and VMware, because they are in conflict with each other.

Use this command in powershell to disable hyper-v and reboot the machine:&#x20;

```
bcdedit /set hypervisorlaunchtype off
```

My VMware Configuration looks like this:

<div align="left"><img src="/files/gFiEwTUgByOc4jocKY7Y" alt=""></div>

<div align="left"><img src="/files/RBaozTLeo96qsJ9bMdUB" alt=""></div>

Download and Install Android Studio:

{% embed url="<https://developer.android.com/studio/install#linux>" %}

Unpack tar.gz file

```
tar -xvf android-studio-ide-2021.2.1.15-linux.tar.gz -C <DIRECTORY>
```

Launch Android Studio:

```
~/android-studio/bin# ./studio.sh
```

Create an Android virtual Device (AVD) in Android Studio:

Tools --> AVD Manager

<div align="left"><img src="/files/GwxgdFh6SANI5pcqM9of" alt=""></div>

Emulator starten:

<div align="left"><img src="/files/HfxRUzHdEfQiY3lcQizi" alt=""></div>

<div align="left"><img src="/files/zUg31oCMS6FL0IuVJC5S" alt=""></div>

The emulator is in directory `~/Android/Sdk/emulator`

Install apktool:

```
apt install apktool
```

Install apksigner:

```
apt install apksigner
```

Install adb:

```
apt install adb
```

Install Android Asset packaging tool:

```
apt install aapt
```

Install jadx:

```
git clone https://github.com/skylot/jadx.git
cd jadx
./gradlew build
./gradlew dist

./build/jadx/bin/jadx

./build/jadx/bin/jadx-gui
```

Install Frida:

Frida requires python >=3.6 and should be installed in a virtual environment

```
pipenv --python 3 shell
pip install frida
pip install frida-tools
pip install objection
pip install frida-android-helper
```

Workaround if pip install frida-android-helper gets errors:

```
git clone https://github.com/Hamz-a/frida-android-helper.git
cd frida-android-helper
python3 setup.py install
```
