{"id":37029470,"url":"https://github.com/dimchat/sdk-java","last_synced_at":"2026-01-14T03:32:22.915Z","repository":{"id":57715672,"uuid":"219442433","full_name":"dimchat/sdk-java","owner":"dimchat","description":"Decentralized Instant Messaging (Java SDK)","archived":false,"fork":false,"pushed_at":"2026-01-13T19:50:41.000Z","size":1554,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-13T21:44:10.421Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dimchat.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":"2019-11-04T07:31:15.000Z","updated_at":"2026-01-13T19:50:45.000Z","dependencies_parsed_at":"2023-02-12T21:01:43.916Z","dependency_job_id":"62f30121-1f98-480a-8616-5e2f194aa884","html_url":"https://github.com/dimchat/sdk-java","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/dimchat/sdk-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fsdk-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fsdk-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fsdk-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fsdk-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimchat","download_url":"https://codeload.github.com/dimchat/sdk-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fsdk-java/sbom","scorecard":{"id":343256,"data":{"date":"2025-08-11","repo":{"name":"github.com/dimchat/sdk-java","commit":"2998262e27e5242583ad8893b43a04a80812a1c2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"28 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T06:28:29.452Z","repository_id":57715672,"created_at":"2025-08-18T06:28:29.452Z","updated_at":"2025-08-18T06:28:29.452Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":[],"created_at":"2026-01-14T03:32:22.397Z","updated_at":"2026-01-14T03:32:22.905Z","avatar_url":"https://github.com/dimchat.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Decentralized Instant Messaging (Java SDK)\n\n\n[![License](https://img.shields.io/github/license/dimchat/sdk-java)](https://github.com/dimchat/sdk-java/blob/master/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/dimchat/sdk-java/pulls)\n[![Platform](https://img.shields.io/badge/Platform-Java%208-brightgreen.svg)](https://github.com/dimchat/sdk-java/wiki)\n[![Issues](https://img.shields.io/github/issues/dimchat/sdk-java)](https://github.com/dimchat/sdk-java/issues)\n[![Repo Size](https://img.shields.io/github/repo-size/dimchat/sdk-java)](https://github.com/dimchat/sdk-java/archive/refs/heads/master.zip)\n[![Tags](https://img.shields.io/github/tag/dimchat/sdk-java)](https://github.com/dimchat/sdk-java/tags)\n[![Version](https://img.shields.io/maven-central/v/chat.dim/SDK)](https://mvnrepository.com/artifact/chat.dim/SDK)\n\n[![Watchers](https://img.shields.io/github/watchers/dimchat/sdk-java)](https://github.com/dimchat/sdk-java/watchers)\n[![Forks](https://img.shields.io/github/forks/dimchat/sdk-java)](https://github.com/dimchat/sdk-java/forks)\n[![Stars](https://img.shields.io/github/stars/dimchat/sdk-java)](https://github.com/dimchat/sdk-java/stargazers)\n[![Followers](https://img.shields.io/github/followers/dimchat)](https://github.com/orgs/dimchat/followers)\n\n## Dependencies\n\n* Latest Versions\n\n| Name | Version | Description |\n|------|---------|-------------|\n| [Ming Ke Ming (名可名)](https://github.com/dimchat/mkm-java) | [![Version](https://img.shields.io/maven-central/v/chat.dim/MingKeMing)](https://mvnrepository.com/artifact/chat.dim/MingKeMing) | Decentralized User Identity Authentication |\n| [Dao Ke Dao (道可道)](https://github.com/dimchat/dkd-java) | [![Version](https://img.shields.io/maven-central/v/chat.dim/DaoKeDao)](https://mvnrepository.com/artifact/chat.dim/DaoKeDao) | Universal Message Module |\n| [DIMP (去中心化通讯协议)](https://github.com/dimchat/core-java) | [![Version](https://img.shields.io/maven-central/v/chat.dim/DIMP)](https://mvnrepository.com/artifact/chat.dim/DIMP) | Decentralized Instant Messaging Protocol |\n\n* build.gradle\n\n```javascript\nallprojects {\n    repositories {\n        mavenLocal()\n        mavenCentral()\n        google()\n    }\n}\n\ndependencies {\n    // https://central.sonatype.com/artifact/chat.dim/SDK\n    implementation group: 'chat.dim', name: 'SDK', version: '2.0.0'\n}\n```\n\n* pom.xml\n\n```xml\n\u003cdependencies\u003e\n\n    \u003c!-- https://mvnrepository.com/artifact/chat.dim/SDK --\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003echat.dim\u003c/groupId\u003e\n        \u003cartifactId\u003eSDK\u003c/artifactId\u003e\n        \u003cversion\u003e2.0.0\u003c/version\u003e\n        \u003ctype\u003epom\u003c/type\u003e\n    \u003c/dependency\u003e\n\n\u003c/dependencies\u003e\n```\n\n## Extensions\n\n### Content\n\nextends [CustomizedContent](https://github.com/dimchat/core-java#extends-content)\n\n### ContentProcessor\n\n```java\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport chat.dim.Facebook;\nimport chat.dim.Messenger;\nimport chat.dim.cpu.app.CustomizedContentHandler;\nimport chat.dim.protocol.CustomizedContent;\nimport chat.dim.protocol.ReliableMessage;\n\n\n/**\n *  Customized Content Processing Unit\n *  \u003cp\u003e\n *      Handle content for application customized\n *  \u003c/p\u003e\n */\npublic class AppCustomizedProcessor extends CustomizedContentProcessor {\n\n    private final Map\u003cString, CustomizedContentHandler\u003e handlers = new HashMap\u003c\u003e();\n\n    public AppCustomizedProcessor(Facebook facebook, Messenger messenger) {\n        super(facebook, messenger);\n    }\n\n    public void setContentHandler(String app, String mod, CustomizedContentHandler handler) {\n        handlers.put(app + \":\" + mod, handler);\n    }\n\n    protected CustomizedContentHandler getContentHandler(String app, String mod) {\n        return handlers.get(app + \":\" + mod);\n    }\n\n    @Override\n    protected CustomizedContentHandler filter(String app, String mod, CustomizedContent content, ReliableMessage rMsg) {\n        CustomizedContentHandler handler = getContentHandler(app, mod);\n        if (handler != null) {\n            return handler;\n        }\n        // default handler\n        return super.filter(app, mod, content, rMsg);\n    }\n\n}\n```\n\n```java\nimport java.util.List;\nimport java.util.Map;\n\nimport chat.dim.Facebook;\nimport chat.dim.Messenger;\nimport chat.dim.protocol.*;\nimport chat.dim.protocol.group.*;\n\n\n/*  Command Transform:\n\n    +===============================+===============================+\n    |      Customized Content       |      Group Query Command      |\n    +-------------------------------+-------------------------------+\n    |   \"type\" : i2s(0xCC)          |   \"type\" : i2s(0x88)          |\n    |   \"sn\"   : 123                |   \"sn\"   : 123                |\n    |   \"time\" : 123.456            |   \"time\" : 123.456            |\n    |   \"app\"  : \"chat.dim.group\"   |                               |\n    |   \"mod\"  : \"history\"          |                               |\n    |   \"act\"  : \"query\"            |                               |\n    |                               |   \"command\"   : \"query\"       |\n    |   \"group\"     : \"{GROUP_ID}\"  |   \"group\"     : \"{GROUP_ID}\"  |\n    |   \"last_time\" : 0             |   \"last_time\" : 0             |\n    +===============================+===============================+\n */\npublic final class GroupHistoryHandler extends BaseCustomizedHandler {\n\n    public GroupHistoryHandler(Facebook facebook, Messenger messenger) {\n        super(facebook, messenger);\n    }\n\n    @Override\n    public List\u003cContent\u003e handleAction(String act, ID sender, CustomizedContent content, ReliableMessage rMsg) {\n        if (content.getGroup() == null) {\n            assert false : \"group command error: \" + content + \", sender: \" + sender;\n            return respondReceipt(\"Group command error.\", rMsg.getEnvelope(), content, null);\n        }\n        if (GroupHistory.ACT_QUERY.equals(act)) {\n            assert GroupHistory.APP.equals(content.getApplication());\n            assert GroupHistory.MOD.equals(content.getModule());\n            return transformQueryCommand(content, rMsg);\n        }\n        assert false : \"unknown action: \" + act + \", \" + content + \", sender: \" + sender;\n        return super.handleAction(act, sender, content, rMsg);\n    }\n\n    private List\u003cContent\u003e transformQueryCommand(CustomizedContent content, ReliableMessage rMsg) {\n        Messenger messenger = getMessenger();\n        if (messenger == null) {\n            assert false : \"messenger lost\";\n            return null;\n        }\n        Map\u003cString, Object\u003e info = content.copyMap(false);\n        info.put(\"type\", ContentType.COMMAND);\n        info.put(\"command\", GroupCommand.QUERY);\n        Content query = Content.parse(info);\n        if (query instanceof QueryCommand) {\n            return messenger.processContent(query, rMsg);\n        }\n        assert false : \"query command error: \" + query + \", \" + content + \", sender: \" + rMsg.getSender();\n        return respondReceipt(\"Query command error.\", rMsg.getEnvelope(), content, null);\n    }\n\n}\n```\n\n### ContentProcessorCreator\n\n```java\nimport chat.dim.Facebook;\nimport chat.dim.Messenger;\nimport chat.dim.cpu.app.GroupHistoryHandler;\nimport chat.dim.dkd.ContentProcessor;\nimport chat.dim.protocol.*;\nimport chat.dim.protocol.group.GroupHistory;\n\npublic class ClientContentProcessorCreator extends BaseContentProcessorCreator {\n\n    public ClientContentProcessorCreator(Facebook facebook, Messenger messenger) {\n        super(facebook, messenger);\n    }\n\n    protected AppCustomizedProcessor createCustomizedContentProcessor(Facebook facebook, Messenger messenger) {\n        AppCustomizedProcessor cpu = new AppCustomizedProcessor(facebook, messenger);\n\n        // 'chat.dim.group:history'\n        cpu.setContentHandler(\n                GroupHistory.APP,\n                GroupHistory.MOD,\n                new GroupHistoryHandler(facebook, messenger)\n        );\n\n        return cpu;\n    }\n\n    @Override\n    public ContentProcessor createContentProcessor(String msgType) {\n        switch (msgType) {\n\n            // application customized\n            case ContentType.APPLICATION:\n            case \"application\":\n            case ContentType.CUSTOMIZED:\n            case \"customized\":\n                return createCustomizedContentProcessor(getFacebook(), getMessenger());\n\n            // ...\n        }\n        // others\n        return super.createContentProcessor(msgType);\n    }\n\n    @Override\n    public ContentProcessor createCommandProcessor(String type, String name) {\n        switch (name) {\n\n            case HandshakeCommand.HANDSHAKE:\n                return new HandshakeCommandProcessor(getFacebook(), getMessenger());\n\n            // ...\n        }\n        // others\n        return super.createCommandProcessor(type, name);\n    }\n}\n```\n\n## Usage\n\nTo let your **AppCustomizedProcessor** start to work,\nyou must override ```BaseContentProcessorCreator``` for message types:\n\n1. ContentType.APPLICATION \n2. ContentType.CUSTOMIZED\n\nand then set your **creator** for ```GeneralContentProcessorFactory``` in the ```MessageProcessor```.\n\n----\n\nCopyright \u0026copy; 2018-2025 Albert Moky\n[![Followers](https://img.shields.io/github/followers/moky)](https://github.com/moky?tab=followers)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimchat%2Fsdk-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimchat%2Fsdk-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimchat%2Fsdk-java/lists"}