{"id":25102974,"url":"https://github.com/lalakii/apk-repack-gradle-plugin","last_synced_at":"2026-04-01T22:41:36.026Z","repository":{"id":239265763,"uuid":"799057664","full_name":"lalakii/apk-repack-gradle-plugin","owner":"lalakii","description":"使用7-Zip的zip算法，重新打包apk，减小apk的体积，对于体积大或是包含文件多的apk，效果非常明显。","archived":false,"fork":false,"pushed_at":"2024-07-01T18:37:53.000Z","size":143,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-27T23:42:24.279Z","etag":null,"topics":["android","android-studio-plugin","apk","gradle","gradle-plugin","reduce-size","repackge","zip"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":false,"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/lalakii.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-11T04:22:53.000Z","updated_at":"2025-12-01T11:24:02.000Z","dependencies_parsed_at":"2024-05-18T12:22:44.910Z","dependency_job_id":"bd040f15-b988-4e5c-955e-4dd504c88f49","html_url":"https://github.com/lalakii/apk-repack-gradle-plugin","commit_stats":null,"previous_names":["lalakii/apk-repack-gradle-plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lalakii/apk-repack-gradle-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lalakii%2Fapk-repack-gradle-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lalakii%2Fapk-repack-gradle-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lalakii%2Fapk-repack-gradle-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lalakii%2Fapk-repack-gradle-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lalakii","download_url":"https://codeload.github.com/lalakii/apk-repack-gradle-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lalakii%2Fapk-repack-gradle-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-plugin","apk","gradle","gradle-plugin","reduce-size","repackge","zip"],"created_at":"2025-02-07T21:35:24.027Z","updated_at":"2026-04-01T22:41:36.008Z","avatar_url":"https://github.com/lalakii.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# APK Repack Gradle Plugin\r\n\r\n[![Maven Central](https://img.shields.io/maven-central/v/cn.lalaki.repack/cn.lalaki.repack.gradle.plugin.svg?label=Maven%20Central\u0026logo=sonatype)](https://central.sonatype.com/artifact/cn.lalaki.repack/cn.lalaki.repack.gradle.plugin)\r\n![License: Apache-2.0 (shields.io)](https://img.shields.io/badge/License-Apache--2.0-c02041?logo=apache)\r\n\r\n为了生成体积更小的apk文件，使用[7-Zip](https://7-zip.org/)的zip算法重新打包apk文件，并且可以通过配置参数让一些文件不要打包到apk\r\n\r\n### 如何使用，参考：[app/build.gradle.kts 配置示例](https://github.com/lalakii/apk-repack-gradle-plugin/blob/master/sample/build.gradle.kts)\r\n```dsl\r\nplugins {\r\n  id(\"cn.lalaki.repack\") version \"3.0.1-LTS\"\r\n}\r\n\r\nrepackConfig {\r\n  sevenZip = \"C:\\\\example\\\\7za.exe\"\r\n  /**\r\n   7zip的可执行文件（Console版本），可以在：https://www.7-zip.org 下载\r\n   对于Windows平台，通常不需要指定此参数，会自动下载依赖，\r\n  **/\r\n\r\n  resign = true\r\n  // 对重新打包的apk签名（值为false时，将不会为生成的apk签名，addV1Sign ，addV2Sign也不会生效 ）\r\n\r\n  addV1Sign = true // v1签名，android7以下需要\r\n  addV2Sign = true // v2签名，android7~9需要（targetVersion30及以上）\r\n  disableV3V4 = false // 禁用v3/v4签名（默认false不禁用）\r\n  apkFile = null\r\n  // 通常无需设置，如果插件找不到默认生成的apk文件，可以配置此参数指定某个apk文件，值可以为null\r\n\r\n  blacklist = arrayOf(\"META-INF\",\"1.example.txt\",\"2.example.txt\")\r\n  // 打包时apk时，可以通过配置此参数排除掉某些无用的文件或文件夹，按照相对路径匹配\r\n  // 不支持通配符，值可以为null\r\n\r\n  quiet = false // 安静模式（默认false，将会在终端输出日志）\r\n  disabled = false // 禁用此插件（默认false，不禁用）\r\n}\r\n```\r\n\r\n配置完成后，直接生成apk，之后终端将会打印日志\r\n\r\n```console\r\n\u003e Task :sample:repacking\r\n[ APK Repacking Task Started!#3784 ]    // 这里的数字是当前进程的pid\r\n\r\nbuild tool: 35.0.0-rc3\r\n7z: C:\\Users\\sa\\Downloads\\7z2404-extra\\x64\\7za.exe\r\nworking directory: ..\\sample\\release\\.tmp_ac7dc02d-c43e-44d0-b442-8a24f4e3e215\r\nblacklist: ...\r\nzipAligned: ok\r\nsigned: ok, v1 v2 v3 v4\r\napk: ..\\sample-release.apk  //输出的apk文件路径\r\n\r\n[ Done ]\r\n```\r\n\r\n### 注意事项\r\n\r\n* apk没有签名或者签名失败，检查是否正确配置signingConfig\r\n\r\n  或者也可以将resign设置为false，打包完成后手动签名\r\n\r\n### License\r\n\r\n[APACHE LICENSE, VERSION 2.0](https://www.apache.org/licenses/LICENSE-2.0)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flalakii%2Fapk-repack-gradle-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flalakii%2Fapk-repack-gradle-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flalakii%2Fapk-repack-gradle-plugin/lists"}