Skip to content

Commit

Permalink
Merge pull request #64 from quarkslab/dev
Browse files Browse the repository at this point in the history
Bump v. 0.3.5
  • Loading branch information
Ha0ris authored Jan 29, 2023
2 parents 0178f59 + de1410a commit ddbac22
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 118 deletions.
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
![Python version](https://img.shields.io/badge/Python-%E2%89%A53.7-brightgreen?style=flat-square&logo=python "Python 3")
![Linux](https://img.shields.io/badge/Linux-x86__64-brightgreen?style=flat-square&logo=linux "Linux")
![macOS](https://img.shields.io/badge/macOS-x86__64-brightgreen?style=flat-square&logo=apple "macOS")
[![Codestyle](https://img.shields.io/badge/codestyle-black-000000?style=flat-square)](https://github.com/psf/black)

![AERoot](https://user-images.githubusercontent.com/56136693/121723563-f4021c80-cae6-11eb-84bb-ac6d6dc32665.png "AERoot Logo")

Expand Down Expand Up @@ -42,6 +43,7 @@
| 5.15.32-android13-3-00067-g7b5e736d7c63-ab8474665 | || 13.0 |
| 5.15.41-android13-6-02245-g158384f20d1e-ab8610100 | || 13.0 |
| 5.15.41-android13-8-00205-gf1bf82c3dacd-ab8747247 | || 13.0 |
| 5.15.41-android13-8-00055-g4f5025129fe8-ab8949913 | || 13.0 |

# Requirements

Expand All @@ -51,17 +53,17 @@ AERoot requires [gdb](https://www.gnu.org/software/gdb/) (with Python support en

## Last Release

```bash
```console
pip install aeroot
```

## Current version

```bash
```console
git clone https://github.com/quarkslab/AERoot.git
```

```bash
```console
python3 setup.py install --user
```

Expand All @@ -70,15 +72,15 @@ python3 setup.py install --user
A Docker image of *AERoot* is available on [dockerhub](https://hub.docker.com/r/ha0ris/aeroot).

Also, you can build an image by yourself:
```bash
```console
docker build -t aeroot https://github.com/quarkslab/AERoot.git
```

### Linux

#### Usage

```bash
```console
docker run --rm \
-v $HOME/.emulator_console_auth_token:$HOME/.emulator_console_auth_token \
--network host \
Expand All @@ -87,7 +89,7 @@ docker run --rm \

#### Example

```bash
```console
docker run --rm \
-v $HOME/.emulator_console_auth_token:$HOME/.emulator_console_auth_token \
--network host \
Expand All @@ -98,15 +100,15 @@ docker run --rm \

#### Usage

```bash
```console
docker run --rm \
-v $HOME/.emulator_console_auth_token:$HOME/.emulator_console_auth_token \
ha0ris/aeroot --host host.docker.internal [aeroot options]
```

#### Example

```bash
```console
docker run --rm \
-v $HOME/.emulator_console_auth_token:$HOME/.emulator_console_auth_token \
ha0ris/aeroot --host host.docker.internal daemon
Expand All @@ -115,7 +117,7 @@ docker run --rm \
# Quick-start

First of all, you must launch the Android emulator with the gdb qemu option (`-qemu -s`).
```bash
```console
emulator @Your_AVD -qemu -s
```

Expand All @@ -126,31 +128,31 @@ Then run **aeroot** by choosing the mode among:

## Usage

```bash
```console
aeroot [-h] [--verbose | --quiet] [--device DEVICE] [--host HOST] [--port PORT] {name,pid,daemon} ...
```

## Examples

### *pid* mode example

```bash
```console
aeroot pid 1337
```

> Gives the root privileges to the process with pid 1337
### *name* mode example

```bash
```console
aeroot name my_process
```

> Gives the root privileges to the process named "my_process"
### *daemon* mode example

```bash
```console
aeroot daemon
```

Expand Down
2 changes: 1 addition & 1 deletion aeroot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
AERoot module
"""

__version__ = "0.3.4"
__version__ = "0.3.5"
13 changes: 7 additions & 6 deletions aeroot/aeroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
from aeroot.avd import Avd, AVDError, AmbiguousProcessNameError


class ProcessNotRunningError(Exception): pass
class AERootError(Exception): pass
class ProcessNotRunningError(Exception):
pass


class AERootError(Exception):
pass


class Mode(IntEnum):
Expand All @@ -17,12 +21,10 @@ class Mode(IntEnum):


class AERoot:

def __init__(self, options):
self.options = options
self.avd = None


def do_root(self):
try:
self.avd = Avd(self.options.device, self.options.host, self.options.port)
Expand All @@ -40,11 +42,10 @@ def do_root(self):
except AmbiguousProcessNameError:
msg = (
"Several processes with the same name are currently running",
"You should use the pid to target the process"
"You should use the pid to target the process",
)
raise AERootError("\n".join(msg))


def cleanup(self):
if self.avd is not None:
self.avd.close()
Loading

0 comments on commit ddbac22

Please sign in to comment.