{"id":16963583,"url":"https://github.com/coderobe/jsplice","last_synced_at":"2026-03-10T14:32:43.917Z","repository":{"id":94540147,"uuid":"131516711","full_name":"coderobe/jsplice","owner":"coderobe","description":"JSplice is a java class hotpatcher CLI powered by javassist","archived":false,"fork":false,"pushed_at":"2018-04-29T17:58:12.000Z","size":9,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T12:57:09.222Z","etag":null,"topics":["compiler","java","javassist","patcher"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderobe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-04-29T17:53:45.000Z","updated_at":"2022-02-09T21:06:16.000Z","dependencies_parsed_at":"2023-03-07T08:45:18.810Z","dependency_job_id":null,"html_url":"https://github.com/coderobe/jsplice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coderobe/jsplice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderobe%2Fjsplice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderobe%2Fjsplice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderobe%2Fjsplice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderobe%2Fjsplice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderobe","download_url":"https://codeload.github.com/coderobe/jsplice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderobe%2Fjsplice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30337243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T12:41:07.687Z","status":"ssl_error","status_checked_at":"2026-03-10T12:41:06.728Z","response_time":106,"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":["compiler","java","javassist","patcher"],"created_at":"2024-10-13T23:25:24.755Z","updated_at":"2026-03-10T14:32:43.894Z","avatar_url":"https://github.com/coderobe.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSplice\n\nJSplice is a java class hotpatcher CLI powered by javassist\n  1. Acquire jsplice patch file\n  2. Apply patch with a single command\n  3. Magic\n\n# Features\n  - Add, replace, or modify methods from existing classes\n  - Add interface implementation to existing class\n\n#### You can also:\n  - Import additional classes to use in the patched code\n  - Wrap a method to intercept, modify, or act on an rval\n\n# Why?\nModifying a class usually involves recompiling the entire project, which ends up being troublesome when the source code is not available - and based on the build system even *when* the source is available.\nJSplice recompiles and exports the modified classes, which allows you to repack the class into your original container (be it `jar`, `war`, raw classes, or something entirely different)\n\n# Getting Started\n### The JSplice patch format\nThe patches are written in JSON. An example patch might look like this:\n```json\n[{\n  \"target\": \"com.example.app.TargetClass\",\n  \"methods\": [{\n    \"name\": \"myTargetMethod\",\n    \"type\": 0,\n    \"body\": [\n      \"System.out.println(\\\"myTargetMethod call blocked\\\");\"\n    ]\n  }]\n}]\n```\nThe above patch will replace\u003csup\u003e1\u003c/sup\u003e the method `myTargetMethod` in `com.example.app.TargetClass`, thus the original method `myTargetMethod` will never be called.\n\n\u003csup\u003e1\u003c/sup\u003e `type 0` is method replacement\n\n----\nAlternatively, you can append to existing methods instead of replacing it entirely:\n```json\n[{\n  \"target\": \"com.example.app.TargetClass\",\n  \"methods\": [{\n    \"name\": \"myTargetMethod\",\n    \"type\": 1,\n    \"body\": [\n      \"System.out.println(\\\"original result was: \\\"+jsplice_result);\",\n      \"return true;\"\n    ]\n  }]\n}]\n```\nThat one would append\u003csup\u003e1\u003c/sup\u003e `body` to `myTargetMethod` of `com.example.app.TargetClass` by renaming the original method and inserting a new method calling the original under the original name. The return value of the original method will be available in `jsplice_result`, which always has the type of the original rval. Thus our patched method ends up printing the original rval\u003csup\u003e(boolean)\u003c/sup\u003e and `return`ing `true` to the caller.\n\n\u003csup\u003e1\u003c/sup\u003e `type 1` is method wrapping\u003csup\u003e(appending)\u003c/sup\u003e\n\n### Commandline options\n`-import`: Classpath to import, can be specified multiple times, should contain your patch targets and patch dependencies\n`-patch`: Path to the JSplice patch json\n`-outdir`: Output path for the patched classes\n\n### Example Applying a Patch\n```sh\n$ mkdir out\n$ java -jar jsplice.jar -import PatchTarget.jar -patch mypatch.json -outdir out\n```\nThen, all that's left to do is repacking the modified classes into your patch target.\n\n# Patch Syntax Documentation\n\nTODO, lol\n\n### Tech\nJSplice uses a number of open source projects to work properly:\n* JCommander \u003csup\u003ecom.beust.jcommander\u003c/sup\u003e - Command line parsing\n* Javassist \u003csup\u003eorg.javassist.javassist\u003c/sup\u003e - Hotpatching\n* GSON \u003csup\u003ecom.google.code.gson\u003c/sup\u003e - JSON parsing of jsplice patch files\n* commons-io \u003csup\u003eorg.apache.commons.commons-io\u003c/sup\u003e - IO utility functions\n\n### Compilation\n\nJSplice requires a Java JDK (1.8+) and Apache Maven\n\nCompilation and Packaging:\n```sh\n$ mvn package\n```\n\nThe built artifact ends up at `target/jsplice-1.0-SNAPSHOT-jar-with-dependencies.jar`\n\n### Development\nWant to contribute? Great!\n\nYou can submit patches as GitHub Pull Requests\n\n### Todos\n - Write proper tests\n - Add ability to create new classes for simplicity of complex patches\n - Add automatic repacking of patched target (CLI toggle, default off)\n\nLicense\n----\nGNU Lesser General Public License v3.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderobe%2Fjsplice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderobe%2Fjsplice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderobe%2Fjsplice/lists"}