{"id":28725639,"url":"https://github.com/neocanable/garlic","last_synced_at":"2025-06-16T22:07:37.218Z","repository":{"id":297239560,"uuid":"994864925","full_name":"neocanable/garlic","owner":"neocanable","description":"Java decompiler written in C","archived":false,"fork":false,"pushed_at":"2025-06-13T14:22:01.000Z","size":437,"stargazers_count":328,"open_issues_count":3,"forks_count":24,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-13T14:29:30.025Z","etag":null,"topics":["android","android-decompiler","c99","decompile","decompiler","dex","dex-decompiler","java-decompiler","pure-c","reverse-engineering"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neocanable.png","metadata":{"files":{"readme":"README.CN.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,"zenodo":null}},"created_at":"2025-06-02T15:45:03.000Z","updated_at":"2025-06-13T14:22:04.000Z","dependencies_parsed_at":"2025-06-04T21:03:15.999Z","dependency_job_id":"30df72a2-f7ec-4ec5-a227-7d8182facc63","html_url":"https://github.com/neocanable/garlic","commit_stats":null,"previous_names":["neocanable/garlic"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neocanable/garlic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocanable%2Fgarlic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocanable%2Fgarlic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocanable%2Fgarlic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocanable%2Fgarlic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neocanable","download_url":"https://codeload.github.com/neocanable/garlic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocanable%2Fgarlic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260249965,"owners_count":22980765,"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-decompiler","c99","decompile","decompiler","dex","dex-decompiler","java-decompiler","pure-c","reverse-engineering"],"created_at":"2025-06-15T12:01:14.228Z","updated_at":"2025-06-16T22:07:37.209Z","avatar_url":"https://github.com/neocanable.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Garlic decompiler\n[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n\n中文 | [English](https://github.com/neocanable/garlic/blob/main/README.md)\n\n\n用C语言实现的Android/Java反编译器\n\n\n### 功能\n\n* 反编译apk文件\n* 反编译dex文件\n* 反编译class文件\n* 反编译jar文件\n* 反编译war文件\n\n### 编译\n\n**编译环境**:  cmake版本: \u003e=**3.26**\n\n**没有其它依赖**\n\n```sh\ngit clone https://github.com/neocanable/garlic.git\ncd garlic\ncmake -B build\ncmake --build build\n./build/garlic\n```\n\n### 使用方法\n\n* 反编译apk\n  ```sh\n  garlic /path/to/android.apk\n\n  garlic /path/to/android.apk -o /path/to/save # -o 选项是源码输出的目录\n\n  garlic /path/to/android.apk -t 5             # -t 选项是线程数量, 默认是4\n  ```\n\n* 反编译dex\n  ```sh\n  garlic /path/to/classes.dex\n\n  garlic /path/to/classes.dex -o /path/to/save # -o 选项是源码输出的目录\n\n  garlic /path/to/classes.dex -t 5             # -t 选项是线程数量, 默认是4\n  ```\n\n* 反编译 .class 文件\n\n    反编译 .class 文件默认输出是**stdout**\n    ```sh\n    garlic /path/to/jvm.class\n    ```\n\n\n* 反编译 jar 文件\n    ```sh\n    garlic /path/to/file.jar\n\n    garlic /path/to/file.jar -o /path/to/save # -o 选项是源码输出的目录\n    \n    garlic /path/to/file.jar -t 4             # -t 选项是线程数量, 默认是4\n    ```\n\n    没有制定输出目录情况下，默认输出目录是jar的同级目录。\n\n\n* javap \n    \n    像javap，比javap快一些，关闭了LineNumber和StackMapTable属性输出。\n    ```sh\n    garlic /path/to/jvm.class -p\n    ```\n\n* dexdump\n    ```sh\n    garlic /path/to/dalvik.dex -p \n\n    ```\n\n### 速度\n\n反编译最新（2025-06-16）的微信，200M+大小, 19万+个类，需要12秒左右，默认4线程\n\n```sh\ngarlic ~/wechat/wechat.apk\n[Garlic] APK file analysis\nFile     : ~/wechat/wechat.apk\nSave to  : ~/wechat/wechat_apk\nThread   : 4\nProgress : 192538 (192538)\n[Done]\n```\n\n```sh\n$ hyperfine \"garlic ~/wechat/wechat.apk\"\nBenchmark 1: garlic ~/wechat/wechat.apk\n  Time (mean ± σ):     11.502 s ±  0.105 s    [User: 31.803 s, System: 10.588 s]\n  Range (min … max):   11.373 s … 11.774 s    10 runs\n```\n\n### 定制服务\n\n**邮件:** neocanable#gmail.com (替换 # 为 @)\n\n**微信:** neocanable\n\n\n![author](https://github.com/neocanable/garlic/blob/main/shell/images/qrcode.jpg)\n\n\n\n--------------------------------------------\n*Licensed under the Apache 2.0 License*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneocanable%2Fgarlic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneocanable%2Fgarlic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneocanable%2Fgarlic/lists"}