-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #209 from GuoXiCheng/dev-c
update
- Loading branch information
Showing
5 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/android/skip/dataclass/SkipConfigV3.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.android.skip.dataclass | ||
|
||
data class SkipIdsV3(val id: String) | ||
|
||
data class SkipTextsV3(val text: String, val length: Int? = null) | ||
|
||
data class SkipBoundsV3(val bound: String) | ||
|
||
data class ConfigV3( | ||
val packageName: String, | ||
val skipIds: List<SkipIdsV3>? = null, | ||
val skipTexts: List<SkipTextsV3>? = null, | ||
val skipBounds: List<SkipBoundsV3>? = null | ||
) | ||
|
||
data class SkipConfigV3(val config: List<ConfigV3>) |
25 changes: 25 additions & 0 deletions
25
app/src/main/java/com/android/skip/manager/HttpManager2.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.android.skip.manager | ||
|
||
import com.android.skip.dataclass.SkipConfigV3 | ||
import retrofit2.Retrofit | ||
import retrofit2.converter.gson.GsonConverterFactory | ||
import retrofit2.http.GET | ||
|
||
interface ApiService { | ||
@GET("/skip_config_v3.json") | ||
suspend fun getSkipConfigV3(): SkipConfigV3 | ||
} | ||
|
||
|
||
object HttpManager2 { | ||
private val retrofit by lazy { | ||
Retrofit.Builder() | ||
.baseUrl("http://localhost:5173") // 替换为你的服务器地址 | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.build() | ||
} | ||
|
||
val api: ApiService by lazy { | ||
retrofit.create(ApiService::class.java) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters