Metadata-Version: 2.2
Name: apknife
Version: 1.0.10
Summary: APKnife is an advanced tool for APK analysis, modification, and security auditing. Whether you're a security researcher, penetration tester, or Android developer, APKnife provides powerful features for reverse engineering, decompiling, modifying, and analyzing APK files.
Author-email: Mr_nightmare <hmjany18@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/elrashedy1992/APKnife
Project-URL: Documentation, https://github.com/elrashedy1992/APKnife/wiki
Project-URL: Source, https://github.com/elrashedy1992/APKnife
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: alembic==1.14.1
Requires-Dist: androguard==4.1.3
Requires-Dist: apkInspector==1.3.2
Requires-Dist: asn1crypto==1.5.1
Requires-Dist: asttokens==3.0.0
Requires-Dist: banal==1.0.6
Requires-Dist: certifi==2025.1.31
Requires-Dist: cffi==1.17.1
Requires-Dist: charset-normalizer==3.4.1
Requires-Dist: click==8.1.8
Requires-Dist: colorama==0.4.6
Requires-Dist: contourpy==1.3.1
Requires-Dist: cryptography==44.0.2
Requires-Dist: cycler==0.12.1
Requires-Dist: dataset==1.6.2
Requires-Dist: decorator==5.2.1
Requires-Dist: executing==2.2.0
Requires-Dist: fonttools==4.56.0
Requires-Dist: frida==16.6.6
Requires-Dist: future==1.0.0
Requires-Dist: greenlet==3.1.1
Requires-Dist: idna==3.10
Requires-Dist: ipython==9.0.1
Requires-Dist: ipython_pygments_lexers==1.1.1
Requires-Dist: jedi==0.19.2
Requires-Dist: kiwisolver==1.4.8
Requires-Dist: loguru==0.7.3
Requires-Dist: lxml==5.3.1
Requires-Dist: Mako==1.3.9
Requires-Dist: MarkupSafe==3.0.2
Requires-Dist: matplotlib==3.10.1
Requires-Dist: matplotlib-inline==0.1.7
Requires-Dist: mutf8==1.0.6
Requires-Dist: networkx==3.4.2
Requires-Dist: numpy==2.2.3
Requires-Dist: packaging==24.2
Requires-Dist: parso==0.8.4
Requires-Dist: pexpect==4.9.0
Requires-Dist: pillow==11.1.0
Requires-Dist: prompt_toolkit==3.0.50
Requires-Dist: ptyprocess==0.7.0
Requires-Dist: pure_eval==0.2.3
Requires-Dist: pycparser==2.22
Requires-Dist: pydot==3.0.4
Requires-Dist: Pygments==2.19.1
Requires-Dist: pyparsing==3.2.1
Requires-Dist: python-dateutil==2.9.0.post0
Requires-Dist: PyYAML==6.0.2
Requires-Dist: requests==2.32.3
Requires-Dist: setuptools==75.8.2
Requires-Dist: six==1.17.0
Requires-Dist: SQLAlchemy==1.4.54
Requires-Dist: stack-data==0.6.3
Requires-Dist: tqdm==4.67.1
Requires-Dist: traitlets==5.14.3
Requires-Dist: typing_extensions==4.12.2
Requires-Dist: urllib3==2.3.0
Requires-Dist: wcwidth==0.2.13
Requires-Dist: wheel==0.45.1

<p align="center">
  <img src="assets/cover.png" alt="APKnife Cover" width="100%">
</p>
---

APKnife – The Double-Edged Blade of APK Analysis 🔪

Fear the Blade, Trust the Power!

APKnife is an advanced tool for APK analysis, modification, and security auditing. Whether you're a security researcher, penetration tester, or Android developer, APKnife provides powerful features for reverse engineering, decompiling, modifying, and analyzing APK files.


---

🚀 Features & Capabilities

✅ Extract & decompile APKs into readable formats
✅ Modify & repackage APKs effortlessly
✅ Analyze APKs for security vulnerabilities
✅ Edit AndroidManifest.xml & Smali code
✅ Extract Java source code from an APK
✅ Detect Remote Access Trojans (RATs) & malware
✅ Decode binary XML files & scan for API calls
✅ Change APK metadata (icon, name, package name)
✅ Identify security risks like excessive permissions
✅ Sign APKs for smooth installation


---

🔧 Installation

📌 Prerequisites

Ensure you have the following installed on your system:

Python 3.12

Java (JDK 8 or later)

apktool

zipalign

keytool


🛠 Setting Up a Python Virtual Environment

Before installing apknife, it's recommended to set up a Python virtual environment to avoid package conflicts.

1️⃣ Create a Python Virtual Environment:

python3 -m venv venv
source venv/bin/activate  # On Linux/macOS

venv\Scripts\activate  # On Windows

2️⃣ Install Required Packages

Once the virtual environment is activated, install APKnife:

pip install apknife


---

📥 Installing Rust (Required for APKnife)

apknife requires Rust for building. Follow the installation steps based on your OS:

🐧 On Linux:
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
Then follow the on-screen instructions.

🍏 On macOS (Using Homebrew):

brew install rust

🖥️ On Windows:

1. Visit rustup.rs and install Rust.


2. Verify installation:


```
rustc --version
```

---

⚠️ Troubleshooting Common Issues

❌ Issue Installing Rust on Termux

Ensure Termux is up to date:

pkg update && pkg upgrade

Install required build tools:

pkg install clang make python rust

❌ Issues Installing APKnife

Rust not installed properly? Ensure it's correctly installed via rustup or your package manager.

Python conflicts? If there are issues with virtual environments, reset it:

```
rm -rf venv
python3 -m venv venv
source venv/bin/activate
```
✅ Verifying Installed Versions

python --version
rustc --version


---

🌍 Setting Up Rust Environment Variables

🐧 On Linux/macOS
```
nano ~/.bashrc # For bash
```
```
nano ~/.zshrc   # For zsh
```
Add this line at the end:

```
export PATH="$HOME/.cargo/bin:$PATH"
```
Apply changes:
```
source ~/.bashrc  # For bash
```
```
source ~/.zshrc   # For zsh
```
🖥️ On Windows

1. Open "Environment Variables" from the Start menu.


2. Edit Path under System Variables and add:


```
C:\Users\<YourUsername>\.cargo\bin
```
3. Click OK and restart your terminal.



Verify the setup:
```
cargo --version
```
```
rustc --version
```


---

📥 Cloning the Repository & Installing Dependencies
```
git clone https://github.com/elrashedy1992/APKnife.git
cd APKnife
pip install -r requirements.txt
```


---

📜 Usage

🖥️ Interactive Mode
---
To enter interactive mode, run:
```
python3 apknife.py interactive
```
This will launch a command-line interface for executing APKnife commands.


---

🛠️ Available Commands

🟢 Extract APK Contents
```
python3 apknife.py extract -i target.apk -o extracted/
```
🟢 Modify & Rebuild APK
```
python3 apknife.py build -i
extracted/ -o modified.apk
```
🟢 Sign APK
```
python3 apknife.py sign -i modified.apk
```
🟢 Analyze APK for Vulnerabilities
```
python3 apknife.py scan_vulnerabilities -i target.apk
```
🟢 Detect Remote Access Trojans (RATs)
```
python3 apknife.py catch_rat -i malicious.apk
```
🟢 Extract Java Source Code
```
python3 apknife.py extract-java -i target.apk -o src_folder
```
🟢 Change APK Name
```
python3 apknife.py modify-apk --name -i app.apk
```
🟢 Change APK Icon
```
python3 apknife.py modify-apk --icon new_icon.png -i app.apk
```
🟢 Modify Package Name
```
python3 apknife.py modify-apk --package com.example.example -i app.apk
```

```
python3 apknife.py modify-apk --name new_name --package new.package.name --icon anysize.any -o modified_apk.apk
```
🟢 Scan APK Permissions
```
python3 apknife.py scan_permissions -i target.apk
```
👇help menu👇

---
python3 apknife.py -h
usage: apknife.py [-h] [-i INPUT] [-o OUTPUT] [-c] [--name NAME] [--icon ICON]
                  [--package PACKAGE]
                  {extract,build,sign,analyze,edit-manifest,smali,decode-xml,find-oncreate,find-api,scan-vulnerabilities,scan-permissions,catch_rat,extract-java,interactive,extract-sensitive,modify-apk}

APKnife: Advanced APK analysis & modification tool

positional arguments:
  {extract,build,sign,analyze,edit-manifest,smali,decode-xml,find-oncreate,find-api,scan-vulnerabilities,scan-permissions,catch_rat,extract-java,interactive,extract-sensitive,modify-apk}
                        Command to execute

options:
  -h, --help            show this help message and exit
  -i, --input INPUT     Input APK file
  -o, --output OUTPUT   Output file/directory
  -c, --compress        Compress extracted Java files into a ZIP archive
  --name NAME           New app name
  --icon ICON           New app icon (resized automatically)
  --package PACKAGE     New package name


⚠️ Legal Disclaimer

This tool is designed for educational and security research purposes only. Unauthorized use of APKnife on third-party applications without permission is illegal. The developers are not responsible for any misuse.


---

📜 License

APKnife is released under the MIT License – You are free to modify and distribute it for legal use.


---

💡 Contributions & Support

🚀 Contributions are welcome! Fork the repo, submit pull requests, and report issues. Let's make APKnife even better!

