{"id":48886097,"url":"https://github.com/iyxan23/zipalign-java","last_synced_at":"2026-04-16T05:09:21.817Z","repository":{"id":37681241,"uuid":"492511696","full_name":"iyxan23/zipalign-java","owner":"iyxan23","description":"📦 zipalign re-implemented in pure Java with no dependencies!","archived":false,"fork":false,"pushed_at":"2025-06-20T14:32:42.000Z","size":153,"stargazers_count":70,"open_issues_count":5,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-31T01:10:09.981Z","etag":null,"topics":["android","build-system","java","zipalign"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iyxan23.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}},"created_at":"2022-05-15T14:32:42.000Z","updated_at":"2026-03-02T10:16:14.000Z","dependencies_parsed_at":"2024-01-31T01:48:49.099Z","dependency_job_id":"43f7b0e8-8852-4e08-a027-9c0dffb2746f","html_url":"https://github.com/iyxan23/zipalign-java","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/iyxan23/zipalign-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyxan23%2Fzipalign-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyxan23%2Fzipalign-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyxan23%2Fzipalign-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyxan23%2Fzipalign-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iyxan23","download_url":"https://codeload.github.com/iyxan23/zipalign-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyxan23%2Fzipalign-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31872131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","build-system","java","zipalign"],"created_at":"2026-04-16T05:09:21.264Z","updated_at":"2026-04-16T05:09:21.802Z","avatar_url":"https://github.com/iyxan23.png","language":"Java","readme":"\u003ch1 align=center\u003e\u003cpre\u003ezipalign-java\u003c/pre\u003e\u003c/h1\u003e\n\n[Zipalign](https://developer.android.com/studio/command-line/zipalign) implemented in java without any dependencies.\n[Read my post about it :\u003e](https://nurihsanalghifari.my.id/posts/Zipalign-java/)\n\n## Using\n\nPass in a `RandomAccessFile` to the function `ZipAlign#alignZip` to provide ZipAlign with a seekable file for more performant aligning.\n\n```java\nimport com.iyxan23.zipalignjava.ZipAlign;\n\nRandomAccessFile zipIn = new RandomAccessFile(zipPath, \"r\");\nFileOutputStream zipOut = ...;\n\nZipAlign.alignZip(zipIn, zipOut);\n```\n\nAdditionaly, you could use a regular `InputStream` (caution: terribly slow)\n\n```java\nimport com.iyxan23.zipalignjava.ZipAlign;\n\nFileInputStream zipIn = ...;\nFileOutputStream zipOut = ...;\n\nZipAlign.alignZip(zipIn, zipOut);\n```\n\n\u003e [!WARNING]\n\u003e The `InputStream` API is deprecated and is not supported anymore, it does not support aligning\n\u003e `.so` files and will not be.\n\nAligning .so files to 16KiB page boundaries is enabled by default, pass in a boolean to opt out:\n\n```java\n// only if zipIn is a RandomAccessFile\nZipAlign.alignZip(zipIn, zipOut, false);\n```\n\nPrefer to align .so files in a 4KiB page boundaries?\n\n```java\n// only if zipIn is a RandomAccessFile\nZipAlign.alignZip(zipIn, zipOut, 4, 4096);\n```\n\n## Importing\n\nThis library is published in [jitpack](https://jitpack.io), you can add it as your dependency it with:\n\n```gradle\nallprojects {\n    repositories {\n        mavenCentral()\n        maven { url \"https://jitpack.io\" }\n    }\n}\n\ndependencies {\n    implementation 'com.github.iyxan23:zipalign-java:1.2.2'\n}\n```\n\nYou could also use [prebuilt jars by the CI](https://github.com/Iyxan23/zipalign-java/actions) or in the [releases section](https://github.com/Iyxan23/zipalign-java/releases).\n\nThe jar contains a simple CLI that allows you to use it in the command line.\n\n```\n$ java -jar zipalign-java-1.2.2.jar input.zip output.zip\n```\n\n## Benchmarks\n\nBenchmarks are ran on an AMD Ryzen 5-5500U CPU with IntelliJ IDEA's runner and Temurin JDK 18.\n\n```\nFunction                                             Avg elapsed time   Input\n\nZipAlign#alignZip(RandomAccessFile, OutputStream)    28ms               File from https://github.com/Iyxan23/zipalign-java/issues/1#issue-1236875761 (270K)\nZipAlign#alignZip(InputStream, OutputStream)         497ms              -- same file --\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiyxan23%2Fzipalign-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiyxan23%2Fzipalign-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiyxan23%2Fzipalign-java/lists"}