> For the complete documentation index, see [llms.txt](https://heapbytes.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://heapbytes.gitbook.io/notes/apk-pentesting/pull-and-patch.md).

# Pull & Patch

## Pull apk from android

### Package name

<figure><img src="/files/qNiu9tXpdAg6yigU8cS8" alt=""><figcaption></figcaption></figure>

play.google.com/store/apps/details?id=**com.\<REDACTED>**\&hl=en\_IN

The above bold text is our app package name which we want to pull from our android.

#### Another way to list packages is

```
adb shell pm list package
```

### Adb devices

```
E:\platform-tools>adb devices
List of devices attached
97z43dslc2bf    device
```

Make sure that you have ADB installed, up and running

### Pull apk from android

```bash
adb shell pm path <PACKAGE_NAME>
# e.g: /data/app/apath/where/itisinstalled/base.apk
: '
adb            : Android Debug Bridge for interacting with a device.
shell          : Opens a command-line shell on the Android device.
pm             : Package Manager tool for managing apps.
path           : Retrieves the path of the APK file for a given app.
<package_name> : The unique identifier of the app whose APK path you want to find.
'
```

This will return as path of APK where it's stored in our android,

```bash
adb pull <PATH> <DESTINATION> 
# e.g: abd pull /data/app/apath/where/itisinstalled/base.apk .\apks\myapk.apk
```

## Patch apk

### First way - objection (automatic)

> Dependencies -&#x20;
>
> sudo apt install zipalign apksigner -y &#x20;
