Skip to content

Commit

Permalink
Merge pull request #209 from GuoXiCheng/dev-c
Browse files Browse the repository at this point in the history
update
  • Loading branch information
GuoXiCheng authored Aug 26, 2024
2 parents 8fd37fa + 7f4d0ee commit 08f5b9b
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"
implementation 'com.squareup.okhttp3:okhttp:3.14.9'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'org.yaml:snakeyaml:1.29'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'androidx.core:core-ktx:1.8.0'
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/java/com/android/skip/dataclass/SkipConfigV3.kt
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 app/src/main/java/com/android/skip/manager/HttpManager2.kt
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)
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/xml/network_security_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">guoxicheng.top</domain>
<domain includeSubdomains="true">guoxicheng.site</domain>
<domain includeSubdomains="true">localhost</domain>
</domain-config>
</network-security-config>
3 changes: 2 additions & 1 deletion docs/inspect/InspectContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const currentNodeKey = ref<number>(-1);
const imgSrc = ref<string>("");
onMounted(async () => {
const response = await fetch("/94e04ea4-2502-4c24-a7f1-7574270fa921.zip");
const params = new URLSearchParams(window.location.href.split("?")[1]);
const response = await fetch(`/${params.get("uuid")}.zip`);
const arrayBuffer = await response.arrayBuffer();
const zip = await JSZip.loadAsync(arrayBuffer);
Expand Down

0 comments on commit 08f5b9b

Please sign in to comment.