{"id":15381433,"url":"https://github.com/xcoder1011/skgeneratemodeltool","last_synced_at":"2025-04-15T19:17:36.762Z","repository":{"id":110836377,"uuid":"262801084","full_name":"Xcoder1011/SKGenerateModelTool","owner":"Xcoder1011","description":"Automatically generate model files, support JSON and URL requests.  JSON转model工具（Mac软件）","archived":false,"fork":false,"pushed_at":"2023-11-09T10:02:41.000Z","size":48880,"stargazers_count":56,"open_issues_count":0,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T19:17:18.840Z","etag":null,"topics":["dart","flutter","generated-code","handyjson","interface","json","mjextension","swift","typescript","yymodel"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/Xcoder1011.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":"2020-05-10T14:08:59.000Z","updated_at":"2024-08-13T01:19:25.000Z","dependencies_parsed_at":"2024-10-18T07:01:54.172Z","dependency_job_id":null,"html_url":"https://github.com/Xcoder1011/SKGenerateModelTool","commit_stats":{"total_commits":40,"total_committers":4,"mean_commits":10.0,"dds":0.35,"last_synced_commit":"6a1f7cdeb3518135452bc4ea656473f79184640e"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xcoder1011%2FSKGenerateModelTool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xcoder1011%2FSKGenerateModelTool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xcoder1011%2FSKGenerateModelTool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xcoder1011%2FSKGenerateModelTool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xcoder1011","download_url":"https://codeload.github.com/Xcoder1011/SKGenerateModelTool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249135832,"owners_count":21218365,"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":["dart","flutter","generated-code","handyjson","interface","json","mjextension","swift","typescript","yymodel"],"created_at":"2024-10-01T14:27:14.968Z","updated_at":"2025-04-15T19:17:36.728Z","avatar_url":"https://github.com/Xcoder1011.png","language":"Swift","readme":"# SKGenerateModelTool\n\n[![](https://img.shields.io/badge/.dmg-4.2MB-brightgreen)](https://github.com/Xcoder1011/SKGenerateModelTool/blob/master/SKGenerateModelTool.dmg)  ![](https://img.shields.io/badge/Dart-flutter-blue)\n    ![](https://img.shields.io/badge/TypeScript-interface-brightgreen)\n    ![](https://img.shields.io/badge/Swift-91.7%25-brightgreen)\n    ![](https://img.shields.io/badge/license-MIT-green)\n\n\n- 支持`Objective-C` / `Swift` / `Dart` / `TypeScript`\n- 支持通过`URL`链接或`json`字符串一键生成model文件\n- 兼容`YYModel` / `MJExtension` / `HandyJSON`解析\n- 支持字符串加密（可设置不同的密钥，开发者可自行修改加密算法）\n- 支持自定义model父类名、自定义model前缀、自定义作者名、添加注释\n- 支持代码高亮（使用[highlight.js](https://highlightjs.org/)）\n- 支持导出`TypeScript Interfaces`\n- 支持自定义导出文件路径\n- `Flutter Model`解析兼容了服务端返回`string/int/double`时数据类型混用的情况\n- 兼容服务端返回“id”字段\n- 支持类驼峰命名\n\n\n- Support `Objective-C` / `Swift` / `Dart` / `TypeScript`\n- Supports one-click generation of model files through `URL` links or `json` strings\n- Compatible with `YYModel` / `MJExtension` / `HandyJSON` analysis\n- Support string encryption (different keys can be set, developers can modify the encryption algorithm)\n- Support custom model superclass name, custom model prefix, custom author name, add comments\n- Support code highlighting(It uses [highlight.js](https://highlightjs.org/) as it core)\n- Support for exporting `TypeScript Interfaces`\n- Support custom output folder path\n- `Flutter model` parsing is compatible with mixed data types when the server returns string / int / double\n- Compatible server returns \"id\" field\n- Supports hump naming\n\n### Usage\n\n\u003e * 方式一：直接下载软件安装 [点击下载](https://github.com/Xcoder1011/SKGenerateModelTool/blob/master/SKGenerateModelTool.dmg) \n\u003e * 方式二：下载代码运行\n\n\n### Objective-C\n\n![Objective-C](../master/images/home.png)\n\n### Swift\n\n![Swift](../master/images/swift.png)\n\n### Dart\n\n![Dart](../master/images/dart.png)\n\n### TypeScript Interfaces\n\n![TypeScript](../master/images/typescript.png)\n\n### 字符串加密示例\n\n![字符串加密示例](../master/images/encrypt.png)\n\n加密后的内容添加到项目中（声明和定义可以分别放.h和.m），因为代码依赖SKEncryptString结构体，所以需要导入头文件**SKEncryptHeader.h**引用。\n\n\u003e 只需把此头文件（SKEncryptHeader.h）加入到项目，并在pch文件中导入该头文件即可使用;\nJust add this header file (SKEncryptHeader.h) to the project and import the header file in the pch file to use;\n\n![SKEncryptHeader.h](../master/images/SKEncryptHeader.png)\n\n加密后的数据申明：\n\n```\n/** 需要加密的重要字符，比如AppKey、AppSecret、AppID、数据库密码等 */\nextern const SKEncryptString * const _3596508958;\n\n/** Important characters that need to be encrypted, such as appkey, appsecret, appid, database password, etc */\nextern const SKEncryptString * const _4038772756;\n\n/** appkeyhdfoashiodfowehfowefjqwehgpqegpifhwappkey */\nextern const SKEncryptString * const _3908173925;\n```\n\n定义：\n```\n/** 需要加密的重要字符，比如AppKey、AppSecret、AppID、数据库密码等 */\nconst SKEncryptString * const _3596508958 = \u0026(SKEncryptString){\n       .factor = (char)9,\n       .value = (char[]){-125,-10,-22,-126,-52,-21,-113,-32,-54,-113,-59,-20,-115,-16,-18,-125,-19,-25,-126,-52,-21,-113,-57,-3,-115,-58,-52,-123,-42,-26,-116,-59,-2,-113,-52,-24,43,26,26,33,15,19,-119,-22,-21,43,26,26,57,15,9,24,15,30,-119,-22,-21,43,26,26,35,46,-119,-22,-21,-116,-1,-38,-116,-25,-60,-113,-48,-7,-113,-59,-20,-115,-54,-21,-115,-57,-29,0},\n       .length = 83,\n};\n\n/** Important characters that need to be encrypted, such as appkey, appsecret, appid, database password, etc */\nconst SKEncryptString * const _4038772756 = \u0026(SKEncryptString){\n       .factor = (char)100,\n       .value = (char[]){57,31,4,0,20,29,1,2,6,73,19,26,21,29,7,10,20,9,0,26,80,6,28,14,18,73,14,9,23,13,80,6,27,79,4,12,64,9,28,10,2,11,4,27,3,13,76,76,1,28,19,26,84,14,21,73,1,28,2,2,21,11,88,79,7,25,16,31,23,10,2,23,0,67,70,8,16,28,27,13,92,82,16,14,18,8,2,13,1,12,80,2,21,28,21,30,15,30,22,69,80,23,0,12,0},\n       .length = 104,\n       .key = (char[]){119,117,115,104,97,110,103,107,117,110,0},\n       .kl = 10\n};\n\n/** appkeyhdfoashiodfowehfowefjqwehgpqegpifhwappkey */\nconst SKEncryptString * const _3908173925 = \u0026(SKEncryptString){\n       .factor = (char)50,\n       .value = (char[]){4,20,23,14,1,30,13,0,1,10,5,20,13,13,8,1,2,8,18,1,15,3,11,16,0,2,13,20,19,2,13,3,23,20,1,0,21,13,1,13,19,6,21,20,12,0,29,0},\n       .length = 47,\n       .key = (char[]){98,99,96,0},\n       .kl = 3\n};\n```\n\n使用时\n\n```\n        if let string =  sk_OCString(_3596508958) {\n            print(\"示例：解密后的数据为：\\(string)\")\n        }\n        if let string =  sk_OCString(_4038772756) {\n            print(\"The decrypted data is：\\(string)\")\n        }\n```\n\n![encrypt_result](../master/images/encrypt_result.png)\n\nTip：本工具仅用到简单的XOR加密算法，开发者可自行下载项目进行加密算法修改，另外也可直接下载项目里的dmg文件进行安装使用。\n\n- 简书地址：[https://www.jianshu.com/p/a2ee31a04252](https://www.jianshu.com/p/a2ee31a04252)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcoder1011%2Fskgeneratemodeltool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxcoder1011%2Fskgeneratemodeltool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcoder1011%2Fskgeneratemodeltool/lists"}