{"id":13482856,"url":"https://github.com/tiann/epic","last_synced_at":"2025-05-14T16:02:41.088Z","repository":{"id":38361466,"uuid":"92005100","full_name":"tiann/epic","owner":"tiann","description":"Dynamic java method AOP hook for Android(continution of Dexposed on ART), Supporting 5.0~11","archived":false,"fork":false,"pushed_at":"2023-07-22T14:04:07.000Z","size":558,"stargazers_count":4467,"open_issues_count":18,"forks_count":816,"subscribers_count":163,"default_branch":"master","last_synced_at":"2025-04-12T01:53:34.358Z","etag":null,"topics":["android","aop","art","dexposed","epic","hook","xposed"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":null,"patreon":"weishu","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"http://paypal.me/virtualxposed"}},"created_at":"2017-05-22T02:52:44.000Z","updated_at":"2025-04-09T03:51:34.000Z","dependencies_parsed_at":"2022-07-09T06:46:23.482Z","dependency_job_id":"7a439980-ebee-4caf-868e-e6fa3fcf207e","html_url":"https://github.com/tiann/epic","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiann%2Fepic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiann%2Fepic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiann%2Fepic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiann%2Fepic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiann","download_url":"https://codeload.github.com/tiann/epic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505873,"owners_count":21115354,"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","aop","art","dexposed","epic","hook","xposed"],"created_at":"2024-07-31T17:01:06.117Z","updated_at":"2025-04-12T01:53:40.069Z","avatar_url":"https://github.com/tiann.png","language":"Java","readme":"[![Download](https://api.bintray.com/packages/twsxtd/maven/epic/images/download.svg) ](https://bintray.com/twsxtd/maven/epic/_latestVersion)\n[![Join the chat at https://gitter.im/android-hacker/epic](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/android-hacker/epic?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)   \n\n[中文文档入口](README_cn.md \"中文\")\n\nWhat is it?\n-----------\n\nEpic is the continuation of [Dexposed](https://github.com/alibaba/dexposed) on ART (Supports 5.0 ~ 11).\n\n\u003e Dexposed is a powerful yet non-invasive runtime [AOP (Aspect-oriented Programming)](http://en.wikipedia.org/wiki/Aspect-oriented_programming) framework\nfor Android app development, based on the work of open-source [Xposed](https://github.com/rovo89/Xposed) [framework](https://github.com/rovo89/XposedBridge) project.\n\u003e\n\u003e The AOP of Dexposed is implemented purely non-invasive, without any annotation processor,\nweaver or bytecode rewriter. The integration is as simple as loading a small JNI library\nin just one line of code at the initialization phase of your app.\n\u003e\n\u003e Not only the code of your app, but also the code of Android framework that running in your\napp process can be hooked.\n\nEpic keeps the same API and all capability of Dexposed, you can do anything which is supported by Dexposed.\n\nTypical use-cases\n-----------------\n\n* Classic AOP programming\n* Instrumentation (for testing, performance monitoring and etc.)\n* Security audit (sensitive api check,Smash shell)\n* Just for fun :)\n\n\nIntegration\n-----------\n\nDirectly add epic aar to your project as compile libraries, Gradle dependency like following(jitpack):\n\n```groovy\ndependencies {\n    compile 'com.github.tiann:epic:0.11.2'\n}\n```\n\nEverything is ready.\n\nBasic usage\n-----------\n\nThere are three injection points for a given method: *before*, *after*, *origin*.\n\nExample 1: monitor the creation and destroy of java thread\n\n```java\nclass ThreadMethodHook extends XC_MethodHook{\n    @Override\n    protected void beforeHookedMethod(MethodHookParam param) throws Throwable {\n        super.beforeHookedMethod(param);\n        Thread t = (Thread) param.thisObject;\n        Log.i(TAG, \"thread:\" + t + \", started..\");\n    }\n\n    @Override\n    protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n        super.afterHookedMethod(param);\n        Thread t = (Thread) param.thisObject;\n        Log.i(TAG, \"thread:\" + t + \", exit..\");\n    }\n}\n\nDexposedBridge.hookAllConstructors(Thread.class, new XC_MethodHook() {\n    @Override\n    protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n        super.afterHookedMethod(param);\n        Thread thread = (Thread) param.thisObject;\n        Class\u003c?\u003e clazz = thread.getClass();\n        if (clazz != Thread.class) {\n            Log.d(TAG, \"found class extend Thread:\" + clazz);\n            DexposedBridge.findAndHookMethod(clazz, \"run\", new ThreadMethodHook());\n        }\n        Log.d(TAG, \"Thread: \" + thread.getName() + \" class:\" + thread.getClass() +  \" is created.\");\n    }\n});\nDexposedBridge.findAndHookMethod(Thread.class, \"run\", new ThreadMethodHook());\n```\n\nExample 2: Intercept the dex loading behavior\n\n```java\nDexposedBridge.findAndHookMethod(DexFile.class, \"loadDex\", String.class, String.class, int.class, new XC_MethodHook() {\n    @Override\n    protected void beforeHookedMethod(MethodHookParam param) throws Throwable {\n        super.beforeHookedMethod(param);\n        String dex = (String) param.args[0];\n        String odex = (String) param.args[1];\n        Log.i(TAG, \"load dex, input:\" + dex + \", output:\" + odex);\n    }\n});\n```\n\nCheckout the `sample` project to find out more.\n\nSupport\n----------\n\nEpic supports ART thumb2 and arm64 architecture from Android 5.0 ~ 11. arm32, x86, x86_64 and mips are not supported now (Thus it cannot work on android emulator).\n\n\nKnown Issues\n-------------\n\n1. Short method (instruction less 8 bytes on thumb2 or less 16bytes in ARM64) are not supported.\n2. Fully inline methods are not supported.\n\nContribute\n----------\n\nWe are open to constructive contributions from the community, especially pull request\nand quality bug report. **Currently, the implementation for ART is not proved in large scale, we value your help to test or improve the implementation.**\n\nYou can clone this project, build and install the sample app, just make some click  in your device, if some bugs/crash occurs, please file an issue or a pull request, I would appreciate it :)\n\nThanks\n-------\n\n1. [Dexposed](https://github.com/alibaba/dexposed)\n2. [Xposed](http://repo.xposed.info/module/de.robv.android.xposed.installer)\n3. [mar-v-in/ArtHook](https://github.com/mar-v-in/ArtHook)\n4. [Nougat_dlfunctions](https://github.com/avs333/Nougat_dlfunctions.git)\n\nContact me\n----------\n\ntwsxtd@gmail.com\n\n[Join discussion](https://gitter.im/android-hacker/epic?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) \n","funding_links":["https://patreon.com/weishu","http://paypal.me/virtualxposed"],"categories":["Java","Mobile Development","\u003ca id=\"2110ded2aa5637fa933cc674bc33bf21\"\u003e\u003c/a\u003e工具"],"sub_categories":["C++/C Toolkit","\u003ca id=\"7f353b27e45b5de6b0e6ac472b02cbf1\"\u003e\u003c/a\u003eXposed"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiann%2Fepic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiann%2Fepic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiann%2Fepic/lists"}