{"id":13470232,"url":"https://github.com/Sunzxyong/JsBridge","last_synced_at":"2025-03-26T11:30:59.289Z","repository":{"id":84636627,"uuid":"56755812","full_name":"Sunzxyong/JsBridge","owner":"Sunzxyong","description":"js and java call each other.（一个JS与Java互相通信框架）","archived":false,"fork":false,"pushed_at":"2018-12-22T03:48:26.000Z","size":108,"stargazers_count":196,"open_issues_count":5,"forks_count":38,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-29T18:24:29.190Z","etag":null,"topics":["java","js","jsbridge"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sunzxyong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-04-21T08:22:13.000Z","updated_at":"2024-10-12T02:41:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"aef406c1-53e9-4f9c-aca4-d2df18948e0b","html_url":"https://github.com/Sunzxyong/JsBridge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunzxyong%2FJsBridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunzxyong%2FJsBridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunzxyong%2FJsBridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunzxyong%2FJsBridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sunzxyong","download_url":"https://codeload.github.com/Sunzxyong/JsBridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222138879,"owners_count":16937421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["java","js","jsbridge"],"created_at":"2024-07-31T16:00:26.356Z","updated_at":"2024-10-30T00:30:21.730Z","avatar_url":"https://github.com/Sunzxyong.png","language":"Java","readme":"# **RainbowBridge**\nA safe JsBridge framework!\n\n----\n\n![](https://img.shields.io/badge/Android%20Arsenal-JsBridge-green.svg)\n## Gif\n![JsBridge](https://raw.githubusercontent.com/Sunzxyong/ImageRepository/master/jsbridge.gif)\n\n## **Js invoke Native protocol**\n\n```\nrainbow://class:port/method?params\n```\nparams is a json string.\n\n## **Return to the Js data format**\n\n```\nresultData = {\n    status: {\n        code: 0,//0:Success，1:Failure\n        msg: 'request timeout'//Failure to display a message, success can be null\n    },\n    data: {}//resultData，can be null\n};\n```\n## **Call the Js callback format**\n\n```\njavascript:JsBridge.onComplete('port','resultData');\n```\n## **The method`s format can be invoked by Js**\n\n```\npublic static void ***(WebView webView, JSONObject data, JsCallback callback) {\n\t //...\n\t JsCallback.invokeJsCallback(callback, true, result, null);\n}\n```\nIf the native method is time consuming operation.Such use:\n\n```\npublic static void ***(WebView webView, JSONObject data, JsCallback callback) {\n\t AsyncTaskExecutor.runOnAsyncThread(new Runnable() {\n        @Override\n        public void run() {\n            //IO、decode、sqlite... \n            JsCallback.invokeJsCallback(callback, true, result, null);\n        }\n    });\n}\n        \n```\n\n## License\n\u003e The MIT License (MIT)\n\n\u003e Copyright (c) 2016 郑晓勇\n\u003e\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\u003e\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\u003e\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n","funding_links":[],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSunzxyong%2FJsBridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSunzxyong%2FJsBridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSunzxyong%2FJsBridge/lists"}