{"id":46066401,"url":"https://github.com/vova7878/dexfile","last_synced_at":"2026-04-26T15:01:19.840Z","repository":{"id":181614405,"uuid":"667053544","full_name":"vova7878/DexFile","owner":"vova7878","description":"Library for reading and writing dex files","archived":false,"fork":false,"pushed_at":"2026-04-22T18:25:55.000Z","size":1643,"stargazers_count":31,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-22T19:22:18.337Z","etag":null,"topics":["android","dex","reverse-engineering"],"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/vova7878.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":"2023-07-16T13:43:25.000Z","updated_at":"2026-04-08T11:25:43.000Z","dependencies_parsed_at":"2024-01-08T08:24:07.290Z","dependency_job_id":"10364248-3a5e-4cd2-912b-961343fcc478","html_url":"https://github.com/vova7878/DexFile","commit_stats":null,"previous_names":["vova7878/dexfile"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/vova7878/DexFile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vova7878%2FDexFile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vova7878%2FDexFile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vova7878%2FDexFile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vova7878%2FDexFile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vova7878","download_url":"https://codeload.github.com/vova7878/DexFile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vova7878%2FDexFile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32301330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"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","dex","reverse-engineering"],"created_at":"2026-03-01T12:16:24.067Z","updated_at":"2026-04-26T15:01:19.834Z","avatar_url":"https://github.com/vova7878.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Java 17+](https://img.shields.io/badge/Java-17%2B-blue)\n[![License](https://img.shields.io/github/license/vova7878/DexFile)](https://github.com/vova7878/DexFile/blob/main/LICENSE)\n\n# About\n\nThis library is designed for reading, generating, modifying, and writing dex files. It was primarily inspired by the [Class-File API](https://openjdk.org/jeps/484), which was introduced in JDK 22\n\n### Installation\n\n```kotlin\ndependencies {\n    implementation(\"io.github.vova7878:DexFile:\u003cversion\u003e\")\n}\n```\n\n### Example\n\nThis is a simple compiler for the [BrainFuck](https://brainfuck.org/brainfuck.html) language to dex format\n\n```java\npublic static byte[] compile(int tape_length, String bf) {\n    var impl_name = \"com.v7878.bf.Main\";\n    var impl_id = TypeId.ofName(impl_name);\n\n    var system_id = TypeId.of(System.class);\n\n    var print_stream_id = TypeId.of(PrintStream.class);\n    var system_out_id = FieldId.of(system_id, \"out\", print_stream_id);\n    var system_write_id = MethodId.of(print_stream_id, \"print\", TypeId.V, TypeId.C);\n\n    var input_stream_id = TypeId.of(InputStream.class);\n    var system_in_id = FieldId.of(system_id, \"in\", input_stream_id);\n    var system_read_id = MethodId.of(input_stream_id, \"read\", TypeId.I);\n\n    var write_byte_id = MethodId.of(impl_id, \"write\", TypeId.V, TypeId.B);\n    var read_byte_id = MethodId.of(impl_id, \"read\", TypeId.B);\n\n    var impl_def = ClassBuilder.build(impl_id, cb -\u003e cb\n            .withSuperClass(TypeId.OBJECT)\n            .withFlags(ACC_PUBLIC | ACC_FINAL)\n            .withMethod(mb -\u003e mb\n                    .of(write_byte_id)\n                    .withFlags(ACC_PRIVATE | ACC_STATIC)\n                    .withCode(/* locals */ 1, ib -\u003e {\n                        ib.generate_lines();\n\n                        int field_reg = ib.l(0);\n                        ib.sget(field_reg, system_out_id);\n                        ib.invoke(VIRTUAL, system_write_id, field_reg, ib.p(0));\n\n                        ib.return_void();\n                    })\n            )\n            .withMethod(mb -\u003e mb\n                    .of(read_byte_id)\n                    .withFlags(ACC_PRIVATE | ACC_STATIC)\n                    .withCode(/* locals */ 2, ib -\u003e {\n                        ib.generate_lines();\n\n                        int field_reg = ib.l(0);\n                        ib.sget(field_reg, system_in_id);\n                        ib.invoke(VIRTUAL, system_read_id, field_reg);\n\n                        int data_reg = ib.l(1);\n                        ib.move_result(data_reg);\n\n                        ib.unop(INT_TO_BYTE, data_reg, data_reg);\n\n                        ib.return_(data_reg);\n                    })\n            )\n            .withMethod(mb -\u003e mb\n                    .withFlags(ACC_PUBLIC | ACC_STATIC)\n                    .withName(\"main\")\n                    .withReturnType(TypeId.V)\n                    .withParameterTypes(TypeId.of(String[].class))\n                    .withCode(/* locals */ 3, ib -\u003e {\n                        ib.generate_lines();\n\n                        int tape_reg = ib.l(0);\n                        ib.const_(tape_reg, tape_length);\n                        ib.new_array(tape_reg, tape_reg, TypeId.B.array());\n                        ib.local(tape_reg, \"tape\", TypeId.B.array());\n\n                        int index_reg = ib.l(1);\n                        ib.const_(index_reg, /* start */ 0);\n                        ib.local(index_reg, \"index\", TypeId.I);\n\n                        int tmp_reg = ib.l(2);\n                        ib.local(tmp_reg, \"tmp\", TypeId.I);\n\n                        int depth = 0;\n                        var labels = new LinkedList\u003cInteger\u003e();\n\n                        for (char op : bf.toCharArray()) {\n                            switch (op) {\n                                case '\u003e' -\u003e ib.binop_lit(ADD_INT, index_reg, index_reg, 1);\n                                case '\u003c' -\u003e ib.binop_lit(ADD_INT, index_reg, index_reg, -1);\n                                case '+' -\u003e {\n                                    ib.aget('B', tmp_reg, tape_reg, index_reg);\n                                    ib.binop_lit(ADD_INT, tmp_reg, tmp_reg, 1);\n                                    ib.aput('B', tmp_reg, tape_reg, index_reg);\n                                }\n                                case '-' -\u003e {\n                                    ib.aget('B', tmp_reg, tape_reg, index_reg);\n                                    ib.binop_lit(ADD_INT, tmp_reg, tmp_reg, -1);\n                                    ib.aput('B', tmp_reg, tape_reg, index_reg);\n                                }\n                                case '.' -\u003e {\n                                    ib.aget('B', tmp_reg, tape_reg, index_reg);\n                                    ib.invoke(STATIC, write_byte_id, tmp_reg);\n                                }\n                                case ',' -\u003e {\n                                    ib.invoke(STATIC, read_byte_id);\n                                    ib.move_result(tmp_reg);\n                                    ib.aput('B', tmp_reg, tape_reg, index_reg);\n                                }\n                                case '[' -\u003e {\n                                    labels.add(depth);\n                                    int open_depth = depth++;\n                                    ib.label(\"label_open_\" + open_depth);\n                                    ib.aget('B', tmp_reg, tape_reg, index_reg);\n                                    ib.if_testz(EQ, tmp_reg, \"label_close_\" + open_depth);\n                                }\n                                case ']' -\u003e {\n                                    int close_depth = labels.pollLast();\n                                    ib.goto_(\"label_open_\" + close_depth);\n                                    ib.label(\"label_close_\" + close_depth);\n                                }\n                                default -\u003e { /* nop */ }\n                            }\n                        }\n\n                        ib.return_void();\n                    })\n            )\n    );\n\n    return DexIO.write(Dex.of(impl_def));\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvova7878%2Fdexfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvova7878%2Fdexfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvova7878%2Fdexfile/lists"}