> 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
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cas-cyber.gitbook.io/cas-cybersecurity/android-malware/lab-setup-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
