> For the complete documentation index, see [llms.txt](https://0xa1mn.gitbook.io/cyber-explained/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0xa1mn.gitbook.io/cyber-explained/pentesting/android-pentesting/re-build-app.md).

# Re-Build App

### Recompile(build) the apk

```
apktool b source.apk -f -o edited.apk
```

### Generate a key.

```
keytool -genkey -v -keystore class.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
```

### Sign the apk

```
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore class.keystore $APP alias_name
```

### Verify apk

```
jarsigner -verify -verbose -certs my_application.apk
```
