@@ -47,6 +47,8 @@ const dependenciesConfigs = {
4747 gradlePapers : [ ] ,
4848 androidGradlePluginVersions : [ ] ,
4949 kotlinVersions : [ ] ,
50+ sweetDependencyVersions : [ ] ,
51+ sweetPropertyVersions : [ ] ,
5052 yukiHookApiVersions : [ ]
5153} ;
5254
@@ -80,6 +82,8 @@ const projectConfigs = {
8082 androidGradlePluginVersion : '' ,
8183 kotlinVersion : '' ,
8284 kotlinKspVersion : '' ,
85+ sweetDependencyVersion : '' ,
86+ sweetPropertyVersion : '' ,
8387 yukiHookApiVersion : ''
8488 }
8589} ;
@@ -461,6 +465,8 @@ const projectDepends = {
461465 androidGradlePlugin : 'https://dl.google.com/dl/android/maven2/com/android/application/com.android.application.gradle.plugin/maven-metadata.xml' ,
462466 kotlin : 'https://api.github.com/repos/JetBrains/kotlin/releases' ,
463467 kotlinKsp : 'https://api.github.com/repos/google/ksp/releases' ,
468+ sweetDependency : 'https://api.github.com/repos/HighCapable/SweetDependency/releases' ,
469+ sweetProperty : 'https://api.github.com/repos/HighCapable/SweetProperty/releases' ,
464470 yukiHookApi : 'https://api.github.com/repos/HighCapable/YuKiHookAPI/releases'
465471 } ,
466472 /** 搜索项目依赖 */
@@ -565,10 +571,36 @@ const projectDepends = {
565571 return ! valUtils . isEmpty ( value . ksp ) ;
566572 } ) ;
567573 if ( dependenciesConfigs . kotlinVersions . length > 0 )
568- projectDepends . findYukiHookApiVersion ( ) ;
574+ projectDepends . findSweetDependencyVersion ( ) ;
569575 else projectDepends . failure ( 'Kotlin-Ksp' , false ) ;
570576 } ) ;
571577 } ,
578+ /** 获取 SweetDependency 版本 */
579+ findSweetDependencyVersion : ( ) => {
580+ httpClient . requestDepends ( 'SweetDependency' , projectDepends . urls . sweetDependency , ( body ) => {
581+ dependenciesConfigs . sweetDependencyVersions = [ ] ;
582+ const latestVersion = body . length > 0 ? body [ 0 ] [ 'tag_name' ] : '' ;
583+ if ( latestVersion !== '' ) {
584+ dependenciesConfigs . sweetDependencyVersions . push ( latestVersion ) ;
585+ /** 直接设置为最新版本 */
586+ projectConfigs . projectDependencies . sweetDependencyVersion = latestVersion ;
587+ projectDepends . findSweetPropertyVersion ( ) ;
588+ } else projectDepends . failure ( 'SweetDependency' , false ) ;
589+ } ) ;
590+ } ,
591+ /** 获取 SweetProperty 版本 */
592+ findSweetPropertyVersion : ( ) => {
593+ httpClient . requestDepends ( 'SweetProperty' , projectDepends . urls . sweetProperty , ( body ) => {
594+ dependenciesConfigs . sweetPropertyVersions = [ ] ;
595+ const latestVersion = body . length > 0 ? body [ 0 ] [ 'tag_name' ] : '' ;
596+ if ( latestVersion !== '' ) {
597+ dependenciesConfigs . sweetPropertyVersions . push ( latestVersion ) ;
598+ /** 直接设置为最新版本 */
599+ projectConfigs . projectDependencies . sweetPropertyVersion = latestVersion ;
600+ projectDepends . findYukiHookApiVersion ( ) ;
601+ } else projectDepends . failure ( 'SweetProperty' , false ) ;
602+ } ) ;
603+ } ,
572604 /** 获取 YukiHookAPI 版本 */
573605 findYukiHookApiVersion : ( ) => {
574606 httpClient . requestDepends ( 'YukiHookAPI' , projectDepends . urls . yukiHookApi , ( body ) => {
0 commit comments