{"id":20176678,"url":"https://github.com/joehaivo/removebutterknife","last_synced_at":"2025-04-10T04:12:19.241Z","repository":{"id":46001173,"uuid":"514191575","full_name":"Joehaivo/RemoveButterKnife","owner":"Joehaivo","description":"一键去除Butterknife相关依赖, 老项目迁移利器","archived":false,"fork":false,"pushed_at":"2022-08-10T03:07:55.000Z","size":339,"stargazers_count":9,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T05:34:46.184Z","etag":null,"topics":["android","android-studio","android-studio-plugin","androidx","butterknife"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Joehaivo.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}},"created_at":"2022-07-15T08:22:46.000Z","updated_at":"2024-07-10T01:47:10.000Z","dependencies_parsed_at":"2022-07-18T04:46:39.403Z","dependency_job_id":null,"html_url":"https://github.com/Joehaivo/RemoveButterKnife","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joehaivo%2FRemoveButterKnife","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joehaivo%2FRemoveButterKnife/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joehaivo%2FRemoveButterKnife/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joehaivo%2FRemoveButterKnife/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Joehaivo","download_url":"https://codeload.github.com/Joehaivo/RemoveButterKnife/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154994,"owners_count":21056543,"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","android-studio","android-studio-plugin","androidx","butterknife"],"created_at":"2024-11-14T02:10:48.687Z","updated_at":"2025-04-10T04:12:19.213Z","avatar_url":"https://github.com/Joehaivo.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"## RemoveButterKnife - Android Studio Plugin\n\n\u003e 一个能够一键批量去除Android老项目中的Java类里Butterknife相关依赖的插件✂️, 老项目迁移利器🔥\n\n### 0. 引子\n\n- ButterKnife已在2020年停止了更新, 开发者JakeWharton也不再推荐使用该库\n- ButterKnife对组件化的支持不友好\n- ButterKnife对AndroidX的支持不友好\n\n因此, 在进行老项目升级改造和组件化的时候, 有一个快速剔除ButterKnife库依赖的工具将极大的提升效率, 为此, 我在公司内部进行改造时开发了这款插件, 并在之后将其开源, 希望能帮到你\n\n---\n\n### 1. 插件功能预览\n\n\u003cimg src=\"docs/result_diff.png\" style=\"zoom:110%;\" /\u003e\n\n\u003e 上图左侧为老代码, 右侧是经过处理后的代码\n\n### 2. 插件的主要功能\n\n- 将`@BindView(id)`注解转换成`findViewById(id)`\n- 将`@OnClick(id)`注解转换成`setOnClickListener()`\n- 在合适的位置插入`__bindClicks()`和`__bindViews()`\n\n- 替换`butterknife.internal.DebouncingOnClickListener`为自己定义的\n\n### 3. 安装\n\n- 在[Releases](https://github.com/Joehaivo/RemoveButterKnife/releases)中找到最新版本的Jar文件下载到本地\n\n- 打开`Android Studio` \u003e `Preferences(MacOS)/Settings(Windows)` \u003e `Plugins` \u003e `Install Plugin from Disk...(右上角小齿轮⚙️)` 找到刚才的Jar包安装\n\n### 4. 使用\n\n\u003e  **使用之前, 需要先把`butterknife.internal.DebouncingOnClickListener`类单独拷贝一份出来修改包名后放在项目中, 新的包名不能再包含`butterknife`, 类名不要改, 例如`com.example.biz.DebouncingOnClickListener`**\n\n- 单独处理: 在需要处理的`Java`文件上右键，在展开的菜单底部找到\"RemoveButterKnife\"点击.\n- 批量处理整个文件夹: 在需要处理的`文件夹`上右键，找到\"RemoveButterKnife\"点击.\n- 多选: 按住`Command`/`Ctrl`键再选择好需要处理的`Java`文件，右键, 找到\"RemoveButterKnife\"点击.\n\n\n\n\u003cimg src=\"docs/right_click_menu.png\" style=\"zoom:80%;\" /\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoehaivo%2Fremovebutterknife","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoehaivo%2Fremovebutterknife","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoehaivo%2Fremovebutterknife/lists"}