{"id":37028086,"url":"https://github.com/hpuhsp/gyps","last_synced_at":"2026-01-14T03:21:03.955Z","repository":{"id":37417719,"uuid":"313815469","full_name":"hpuhsp/gyps","owner":"hpuhsp","description":"🔥🔥🔥The MVVM architecture mobile development framework based on the Kotlin language。","archived":false,"fork":false,"pushed_at":"2025-11-06T07:30:58.000Z","size":29219,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-06T09:14:47.128Z","etag":null,"topics":["dagger-hilt","glidev4","gradle","kotlin","retrofit2","room","viewbinding"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/hpuhsp.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":"2020-11-18T03:44:42.000Z","updated_at":"2025-05-24T01:46:22.000Z","dependencies_parsed_at":"2024-11-15T09:37:41.330Z","dependency_job_id":"7d35c378-3d51-449e-a0e9-cc5703fabcd4","html_url":"https://github.com/hpuhsp/gyps","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/hpuhsp/gyps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpuhsp%2Fgyps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpuhsp%2Fgyps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpuhsp%2Fgyps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpuhsp%2Fgyps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hpuhsp","download_url":"https://codeload.github.com/hpuhsp/gyps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpuhsp%2Fgyps/sbom","scorecard":{"id":470260,"data":{"date":"2025-08-11","repo":{"name":"github.com/hpuhsp/gyps","commit":"0de02b1de51e79add9ff0e6c071a736b5acf5c7a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"Code-Review","score":0,"reason":"Found 1/29 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":"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":"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":"Binary-Artifacts","score":6,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: msc/libs/Msc.jar:1","Warn: binary detected: msc/src/main/jniLibs/arm64-v8a/libmsc.so:1","Warn: binary detected: msc/src/main/jniLibs/armeabi-v7a/libmsc.so:1"],"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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"}},{"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T13:43:21.982Z","repository_id":37417719,"created_at":"2025-08-19T13:43:21.982Z","updated_at":"2025-08-19T13:43:21.982Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408824,"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":["dagger-hilt","glidev4","gradle","kotlin","retrofit2","room","viewbinding"],"created_at":"2026-01-14T03:21:03.250Z","updated_at":"2026-01-14T03:21:03.941Z","avatar_url":"https://github.com/hpuhsp.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Gyps  基于Google 最新AAC架构的移动端开发框架\n\n\u003eThe MVVM architecture mobile development framework based on the Kotlin language.Contains Retrofit、Coroutine-Flow、Dagger-Hilt、ViewBinding、Glide、ROOM、ARouter And Other commonly used library of tools.\n\n\n[![Jitpack](https://jitpack.io/v/hpuhsp/gyps.svg)](https://jitpack.io/#hpuhsp/gyps)\n\n### 主要技术实现\n\n* Retrofit 网络请求\n* 协程Coroutine及1.3.2发布后新增Flow库\n* ViewBinding 视图绑定\n* Hilt 依赖注入\n* Glide V4版本 （Generated API使用）\n* Room 数据库\n* ARouter 路由框架（1.0.3版本后已移除，根据需要自行引入）\n* immersionbar 状态栏定制\n* easypermissions 权限处理\n* ...\n\n\n### Usage\n#### 1、接入方式\n\n1、直接将swallow模块作为Module引入。\n\n2、添加远程依赖\n Add it in your root build.gradle at the end of repositories:\n```groovy\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n Add the dependency\n```groovy\ndependencies {\n\t        implementation 'com.github.hpuhsp:gyps:latestVersion' // latestVersion 替换为上方最新版本\n\t}\n```\n\n#### 2、配置build.gradle文件\n\n* 项目根目录下build.gradle下引入Dagger Hilt插件，gradle工具版本推荐4.0+\n\n```groovy\n    // 1.5.0之前版本\n    dependencies {\n        classpath \"com.android.tools.build:gradle:4.0.1\"\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n        // Dagger-Hilt\n        classpath 'com.google.dagger:hilt-android-gradle-plugin:2.28-alpha'\n    }\n\t// 1.5.0之后版本\n\tplugins {\n    ...\n    id 'com.google.dagger.hilt.android' version '2.44' apply false\n    ...\n\t}\n\n```\n\n* app或Module下build.gradle文件配置：\n\n```groovy\n// 1.5.0之前版本\nplugins {\n    id 'com.android.application'\n    id 'kotlin-android'\n    id 'kotlin-android-extensions'\n    id 'kotlin-kapt'\n    id 'dagger.hilt.android.plugin'\n}\nandroid {\n    ...\n    // ViewBinding\n    buildFeatures {\n        viewBinding = true\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n    //=========== Dagger Hilt 依赖注入 ============//\n    implementation rootProject.ext.dependencies[\"hilt-android\"]\n    implementation rootProject.ext.dependencies[\"hilt-lifecycle-viewmodel\"]\n    kapt rootProject.ext.dependencies[\"hilt-android-compiler\"]\n    kapt rootProject.ext.dependencies[\"hilt-compiler\"]\n    // Glide\n    kapt rootProject.ext.dependencies[\"glide-compiler\"]\n    ....\n}\n// 1.5.0之后版本示例\nplugins {\n    id 'com.android.application'\n    id 'org.jetbrains.kotlin.android'\n    id 'kotlin-kapt'\n    id 'kotlin-parcelize'\n    id 'com.google.dagger.hilt.android'\n}\nandroid {\n    ...\n    // ViewBinding\n    buildFeatures {\n        viewBinding  true\n    }\n}\ndependencies {\n    implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n    // ARouter\n    kapt 'com.alibaba:arouter-compiler:1.2.2'\n    // Room\n    kapt 'androidx.room:room-compiler:2.5.1'\n    // Glide\n    implementation \"com.github.bumptech.glide:okhttp3-integration:4.11.0\"\n    kapt 'com.github.bumptech.glide:compiler:4.11.0'\n    // Hilt\n    implementation 'com.google.dagger:hilt-android:2.44'\n    kapt 'com.google.dagger:hilt-compiler:2.44'\n    ...\n}\n```\n\n#### 3、Dagger Hilt依赖注入\n\n* 程序入口处添加@HiltAndroidApp注解\n\n```kotlin\n@HiltAndroidApp\nclass MyApplication : BaseApplication() {\n    override fun onCreate() {\n        super.onCreate()\n        // 可根据编译环境选择日志打印策略\n        initLogger(true)\n    }\n}\n```\n\n* 1.5.0之后版本由于Hilt版本变动，注解配置有所调整\n\n```kotlin\n// 1.5.0之后\n@HiltViewModel\nclass MainViewModel @Inject constructor(private val repository: MainRepository) :\n    BaseViewModel() {\n\n}\n// 1.5.0之前版本\nclass MainViewModel @ViewModelInject constructor(private val repository: MainRepository) :\n    BaseViewModel() {\n\n}\n```\n\n#### 4、MVVM模式下进行开发\n\n![1b622821b9f386ba76924d2a3d551fe7.png](images/54432gg.png)\n基于Dagger-Hilt依赖注入实现标准化、松耦合等特性MVVM架构下进行开发。如：Activity/Fragment 需要添加@AndroidEntryPoint注解。本地化存储及注入类全局初始化策略可以参考设备项目‘包名.app/’目录下具体实现类。功能页面开发构成方式可以参见Gyps项目主页健康上报功能实现方式。\n\n#### 5、全局文件配置（可选）\n\n![ac5806ded0961f148766fb21ad406b23.png](images/231134.jpg)\n\n* AppLifecycleImpl生命周期实现类\n\n```kotlin\n@Singleton\nclass AppLifecycleImpl : AppLifecycle {\n    override fun attachBaseContext(base: Context) {\n\n    }\n\n    override fun onCreate(application: Application) {\n        // Module下应用级初始化操作\n        // initARouter()\n    }\n\n    /**\n     * 退出APP\n     */\n    override fun onTerminate(application: Application) {\n    }\n}\n```\n\n* GlobalConfiguration 全局配置文件+AndroidManifest中注册\n\n```kotlin\n@Singleton\nclass GlobalConfiguration : ConfigModule {\n    override fun applyOptions(context: Context?, builder: GlobalConfigModule.Builder) {\n        // App域名、网络参数配置\n        builder.baseurl(object : BaseUrl {\n            override fun url(): HttpUrl? {\n                return \"http://www.github.com/\".toHttpUrlOrNull()\n            }\n        })\n        builder.globalHttpHandler(HttpHandlerImpl())\n    }\n\n    /**\n     * 添加子Module的生命周期监听\n     */\n    override fun injectModulesLifecycle(context: Context, lifecycleList: ArrayList\u003cAppLifecycle\u003e) {\n        lifecycleList.add(AppLifecycleImpl())\n    }\n}\n```\n```xml\n// \"包名\"替换为项目实际包名\n\u003cmeta-data\n    android:name=\"{包名}.app.GlobalConfiguration\"\n    android:value=\"ConfigModule\" /\u003e\n```\n\n* HttpHandlerImpl 网络请求参数配置及拦截处理\n\n```kotlin\n@Singleton\nclass HttpHandlerImpl : GlobalHttpHandler {\n\n    override fun onHttpResultResponse(\n        httpResult: String?,\n        chain: Interceptor.Chain,\n        response: Response\n    ): Response {\n        // 此处可以进行token校验并进行相关处理\n        return response\n    }\n\n    override fun onHttpRequestBefore(chain: Interceptor.Chain, request: Request): Request {\n        return chain.request().newBuilder()\n            .header(\"Content-Type\", \"application/json;charset=UTF-8\")\n            .addHeader(\"platform\", \"Android\")\n            .addHeader(\"token\",\"xxxxxxxxxxxxxxxxx\")\n            .addHeader(\"udid\",\"231ddsad1421x2312sdmdsads22\")\n            .build()\n    }\n\n    /**\n     * 动态切换域名访问\n     */\n    override fun redirectRequest(\n        chain: Interceptor.Chain,\n        request: Request,\n        exception: Exception\n    ): Response? {\n\n        return null\n    }\n}\n```\n\n* Glide 图片加载配置\n\n  * 引入方式\n\n    推荐使用Generated API方式进行Glide的项目配置，为实现灵活性，此库已移除AppGlideModule及LibraryGlideModule实现，接入时请在app模块下进行AppGlideModule配置，需要注意两者的使用场景及区别。具体可参考：https://muyangmin.github.io/glide-docs-cn/doc/configuration.html#avoid-appglidemodule-in-libraries\n\n    \n\n  * 扩展配置\n\n```kotlin\n@GlideExtension\nclass MyGlideExtension private constructor() {\n    companion object {\n        private const val USER_AVATAR_SIZE = 168\n\n        /**\n         * 加载用户头像\n         */\n        @JvmStatic\n        @GlideOption\n        fun userAvatar(options: BaseRequestOptions\u003c*\u003e): BaseRequestOptions\u003c*\u003e {\n            return options\n                .centerCrop()\n                .override(USER_AVATAR_SIZE)\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpuhsp%2Fgyps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhpuhsp%2Fgyps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpuhsp%2Fgyps/lists"}