MCPcopy Index your code
hub / github.com/RevEngiSquad/PineHookPlus

github.com/RevEngiSquad/PineHookPlus @1.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.1.0 ↗ · + Follow
42 symbols 93 edges 11 files 2 documented · 5% updated 8mo ago1.1.0 · 2025-11-10★ 51

Browse by type

Functions 34 Types & classes 8
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PineHookPlus

PineHookPlus is an advanced example project demonstrating creative and efficient ways to leverage the Pine Hooking Framework for runtime modifications in Android apps. This project focuses on simplifying the integration and customization of hooks, offering a structured and flexible approach to app behavior modification.

To learn more about its usage and demo, please refer to the blog post.


🌟 Features

  • Automatically loads libraries based on the user's system architecture:
  • AArch64 (arm64) and armeabi-v7a architectures supported.
  • A11 and UP.
  • Libraries are stored in the root directory of the APK under hook/ for streamlined access.
  • Use config.json to define hooks in the hook/ directory.
  • Easily specify:
  • Class Name: Target class to hook.
  • Method Name: Method to override.
  • Parameter Types: Types of parameters accepted by the method.
  • args: Arguments to pass to the hooked method.
  • Return Value: The desired return value of the hooked method.
  • No need to write or compile custom code for every method.
  • Directly hook into and modify class constructors.
  • Moves away from methods like AppComponentFactory, android:name and uses ContentProvider.
  • Load Xposed modules seamlessly.

📦 Project Structure

PineHookPlus/
│
├── app/
│   ├── src/
│   │   ├── hook/            # Hook source directory
|   |   |   ├──hook/
|   |   |   |   ├── libarm.so            # ARM32 library
|   |   |   |   ├── libarm64.so          # ARM64 library
|   |   |   |   ├── config.json          # Hook configuration file
|   |   |   |   ├── modules.txt          # Xposed modules configuration file
│   │   ├── main/            # Main application source code
│   │   └── ...              # Other modules and configurations
│   ├── build.gradle         # Project-specific Gradle file
│
├── build.gradle             # Root Gradle file
└── settings.gradle

📋 Example Configurations

Hooking a Method

In config.json, define the target class and method to hook, along with the parameter types, arguments, and return value as needed:

{
  // Target class to hook
     "com.pinehook.plus.MainActivity": {
        // Method name to hook
        "argMethod": {
            // parameter types of the method
            "paramTypes": [
                "boolean"
            ],
            // return result of the method after it's call
            "after": {
                "result": false
            }
        },
        "beforeOnlyMethod": {
            "paramTypes": [
                "java.lang.String"
            ],
            "before": {
                 // args to pass to the method before it's call
                "args": [
                    "modifiedBefore"
                ]
            }
        },
        "afterOnlyMethod": {
            "paramTypes": [
                "java.lang.String"
            ],
            "after": {
                 // return result of the method after it's call
                "result": "modifiedAfter"
            }
        }
    },
}

Hooking a Constructor

{
  // Constructor hook example
    "com.pinehook.plus.ConstructorClass": {
        // Do not change this value for constructor hook
        "constructor": {
             // parameter types of the constructor
            "paramTypes": [
                "boolean",
                "java.lang.String",
                "boolean",
                "long",
                "long",
                "java.lang.String",
                "java.lang.String",
                "java.lang.String"
            ],
             // args to pass to the constructor before it's call
            "before": {
                "args": [
                    true,
                    "PlayStore",
                    false,
                    0,
                    0,
                    "null",
                    "Yearly",
                    "null"
                ]
            }
        }
    }
}

Check config.json for more.

Result

result preview image


Check out other projects


📜 License

This project is licensed under the MIT License. See the LICENSE file for details.


🙌 Acknowledgments


Core symbols most depended-on inside this repo

Shape

Method 34
Class 8

Languages

Java100%

Modules by API surface

app/src/main/java/com/pinehook/plus/Hook.java13 symbols
app/src/main/java/com/pinehook/plus/MainActivity.java8 symbols
app/src/main/java/com/pinehook/plus/Loader.java7 symbols
app/src/main/java/com/pinehook/plus/NativeLibLoader.java5 symbols
app/src/main/java/com/pinehook/plus/JsonParser.java3 symbols
app/src/test/java/com/pinehook/plus/ExampleUnitTest.java2 symbols
app/src/main/java/com/pinehook/plus/ConstructorClass.java2 symbols
app/src/androidTest/java/com/pinehook/plus/ExampleInstrumentedTest.java2 symbols

For agents

$ claude mcp add PineHookPlus \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page