{"id":21121561,"url":"https://github.com/revengisquad/pinehookplus","last_synced_at":"2025-07-08T21:32:52.946Z","repository":{"id":263433819,"uuid":"889821851","full_name":"RevEngiSquad/PineHookPlus","owner":"RevEngiSquad","description":"Pine Hook +","archived":false,"fork":false,"pushed_at":"2024-12-31T08:42:28.000Z","size":616,"stargazers_count":26,"open_issues_count":0,"forks_count":9,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-04T11:37:02.448Z","etag":null,"topics":["android","art-runtime","hook","hooking","java-hook","pinehook"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RevEngiSquad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-17T10:30:39.000Z","updated_at":"2025-03-06T18:26:59.000Z","dependencies_parsed_at":"2024-11-18T15:25:13.065Z","dependency_job_id":"b06aa187-b888-4dbc-b35f-52f45df04bd4","html_url":"https://github.com/RevEngiSquad/PineHookPlus","commit_stats":null,"previous_names":["revengisquad/pinehookplus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RevEngiSquad/PineHookPlus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevEngiSquad%2FPineHookPlus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevEngiSquad%2FPineHookPlus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevEngiSquad%2FPineHookPlus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevEngiSquad%2FPineHookPlus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RevEngiSquad","download_url":"https://codeload.github.com/RevEngiSquad/PineHookPlus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevEngiSquad%2FPineHookPlus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264352903,"owners_count":23594992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","art-runtime","hook","hooking","java-hook","pinehook"],"created_at":"2024-11-20T03:51:54.116Z","updated_at":"2025-07-08T21:32:52.940Z","avatar_url":"https://github.com/RevEngiSquad.png","language":"Java","readme":"# PineHookPlus\n\n**PineHookPlus** is an advanced example project demonstrating creative and efficient ways to leverage the [Pine Hooking Framework](https://github.com/canyie/pine) 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.\n\nTo learn more about its usage and demo, please refer to the [blog post](https://qbtaumai.pages.dev/posts/pinehookplus/).\n\n---\n\n## 🌟 **Features**\n\n- Automatically loads libraries based on the user's system architecture:\n  - **AArch64 (arm64)** and **armeabi-v7a** architectures supported.\n  - A11 and UP.\n- Libraries are stored in the root directory of the APK under `hook/` for streamlined access.\n- Use `config.json` to define hooks in the `hook/` directory.\n- Easily specify:\n  - **Class Name**: Target class to hook.\n  - **Method Name**: Method to override.\n  - **Parameter Types**: Types of parameters accepted by the method.\n  - **args**: Arguments to pass to the hooked method.\n  - **Return Value**: The desired return value of the hooked method.\n- No need to write or compile custom code for every method.\n- Directly hook into and modify class constructors.\n- Moves away from methods like `AppComponentFactory`, `android:name` and uses `ContentProvider`.\n\n---\n\n## 📦 **Project Structure**\n\n```\nPineHookPlus/\n│\n├── app/\n│   ├── src/\n│   │   ├── hook/            # Hook source directory\n|   |   |   ├──hook/\n|   |   |   |   ├── libarm.so            # ARM32 library\n|   |   |   |   ├── libarm64.so          # ARM64 library\n|   |   |   |   ├── config.json          # Hook configuration file\n│   │   ├── main/            # Main application source code\n│   │   └── ...              # Other modules and configurations\n│   ├── build.gradle         # Project-specific Gradle file\n│\n├── build.gradle             # Root Gradle file\n└── settings.gradle\n```\n\n---\n\n## 📋 **Example Configurations**\n\n### Hooking a Method\n\nIn `config.json`, define the target class and method to hook, along with the parameter types, arguments, and return value as needed:\n\n```json\n{\n  // Target class to hook\n     \"com.pinehook.plus.MainActivity\": {\n        // Method name to hook\n        \"argMethod\": {\n            // parameter types of the method\n            \"paramTypes\": [\n                \"boolean\"\n            ],\n            // return result of the method after it's call\n            \"after\": {\n                \"result\": false\n            }\n        },\n        \"beforeOnlyMethod\": {\n            \"paramTypes\": [\n                \"java.lang.String\"\n            ],\n            \"before\": {\n                 // args to pass to the method before it's call\n                \"args\": [\n                    \"modifiedBefore\"\n                ]\n            }\n        },\n        \"afterOnlyMethod\": {\n            \"paramTypes\": [\n                \"java.lang.String\"\n            ],\n            \"after\": {\n                 // return result of the method after it's call\n                \"result\": \"modifiedAfter\"\n            }\n        }\n    },\n}\n```\n\n### Hooking a Constructor\n\n```json\n{\n  // Constructor hook example\n    \"com.pinehook.plus.ConstructorClass\": {\n        // Do not change this value for constructor hook\n        \"constructor\": {\n             // parameter types of the constructor\n            \"paramTypes\": [\n                \"boolean\",\n                \"java.lang.String\",\n                \"boolean\",\n                \"long\",\n                \"long\",\n                \"java.lang.String\",\n                \"java.lang.String\",\n                \"java.lang.String\"\n            ],\n             // args to pass to the constructor before it's call\n            \"before\": {\n                \"args\": [\n                    true,\n                    \"PlayStore\",\n                    false,\n                    0,\n                    0,\n                    \"null\",\n                    \"Yearly\",\n                    \"null\"\n                ]\n            }\n        }\n    }\n}\n```\nCheck [config.json](app/src/hook/hook/config.json) for more.\n\n## Result\n\u003cimg src=\"images/result.png\" alt=\"result preview image\" widt=\"200\" height=\"400\"\u003e\n\n---\n\n## Check out other projects\n\n- [Fine](https://github.com/AbhiTheModder/Fine.git)\n- [NewPineExample](https://github.com/AbhiTheModder/NewPineExample.git)\n\n---\n\n## 📜 **License**\n\nThis project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## 🙌 **Acknowledgments**\n\n- [Canyie](https://github.com/canyie) for the incredible [Pine Framework](https://github.com/canyie/pine).\n- [Hikki](https://github.com/kyzsuukii) for Initial Ideas, Support and Work.\n- [Abhi](https://github.com/AbhiTheModder) for Constructor Hooks and other improvements.\n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevengisquad%2Fpinehookplus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevengisquad%2Fpinehookplus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevengisquad%2Fpinehookplus/lists"}