{"id":13537510,"url":"https://github.com/asLody/legend","last_synced_at":"2025-04-02T04:30:50.748Z","repository":{"id":47350914,"uuid":"51283181","full_name":"asLody/legend","owner":"asLody","description":"A framework for hook java methods.","archived":false,"fork":false,"pushed_at":"2022-07-23T06:09:39.000Z","size":809,"stargazers_count":1604,"open_issues_count":30,"forks_count":368,"subscribers_count":94,"default_branch":"master","last_synced_at":"2025-04-01T07:45:34.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asLody.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-08T06:50:27.000Z","updated_at":"2025-03-26T05:10:39.000Z","dependencies_parsed_at":"2022-09-16T03:24:06.121Z","dependency_job_id":null,"html_url":"https://github.com/asLody/legend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asLody%2Flegend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asLody%2Flegend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asLody%2Flegend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asLody%2Flegend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asLody","download_url":"https://codeload.github.com/asLody/legend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246756981,"owners_count":20828804,"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":[],"created_at":"2024-08-01T09:00:59.905Z","updated_at":"2025-04-02T04:30:50.697Z","avatar_url":"https://github.com/asLody.png","language":"Java","funding_links":[],"categories":["Java","Libs"],"sub_categories":["\u003cA NAME=\"Framework\"\u003e\u003c/A\u003eFramework"],"readme":"# Legend\n--------\n![logo][2]\n--------\n## Projects are out of date, plese move to:\n\u003e [Whale Hook](https://github.com/asLody/whale)\n\n\n\n## What is Legend?\n\nLegend is a **Hook framework** for **Android Development**, it allows you to Hook Java methods **without** ROOT. Even more exciting is that it supports both **Dalvik and Art** environment!\n\n\u003chttps://github.com/asLody/legend\u003e\n\n### 1. What is the good\n- Programming more **efficient**\n- Dynamic debugging\n- **HotFix** and needn't reboot app\n- Fast **dump** Dex File in the shell\n- Software security penetration\n- Do some exciting things...\n\n\n### 2. How to use\nExample 1: **Annotation** type Hook\n```java\n@Hook(\"android.widget.Toast::show\")\npublic static void Toast_show(Toast thiz) {\n  thiz.setText(\"XXXXXXXXX\");\n  //Call the origin method\n  HookManager.getDefault().callSuper(thiz);\n}\n```\nExample 2: **Interception** of startActivity\n```java\n@Hook(\"android.app.Activity::startActivity@android.content.Intent\")\npublic static void Activity_startActivity(Activity thiz, Intent intent) {\n  if (!ALLOW_LAUNCH_ACTIVITY) {\n    Toast.makeText(thiz, \"I am sorry to turn your Activity down :)\", Toast.LENGTH_SHORT).show();\n  } else {\n    HookManager.getDefault().callSuper(thiz, intent);\n  }\n}\n```\n#### Notice:\n- Write the following code down in where you want to your hooks **enable**.\n\n```java\nHookManager.getDefault().applyHooks(YourClass.class);\n```\n- You can also hook a method **without annotation**.\n\n```java\nHookManager.getDefault().hookMethod(originMethod, hookMethod);\n```\n\n### 3. Compatibility\n- [x] Dalvik \u0026 Android 4.2\n- [x] Dalvik \u0026 Android 4.3\n- [x] Art \u0026 Android 5.0\n- [x] Art \u0026 Android 5.0.1\n- [x] Art \u0026 Android 5.1\n- [x] Art \u0026 Android 6.0\n- [x] Art \u0026 Android 6.0.1\n- [ ] aliyunOS VM\n\n### 4. Showcase\n\u003chttps://github.com/dodola/RocooFix\u003e\n\n### 5. Help improve Legend\n```java\nif (Country.China == your.country) {\n  QQGroup.join(530497973);\n} else {\n  webView.loadUrl(\"https://github.com/asLody/legend/issues\");\n}\n```\n### 6. Author\n\n\u003e [Lody][3]\n\n[2]: https://raw.githubusercontent.com/asLody/legend/master/art/legend_logo.png\n[3]: https://github.com/asLody\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FasLody%2Flegend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FasLody%2Flegend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FasLody%2Flegend/lists"}