my bad
This commit is contained in:
Js0n
2025-02-22 18:30:13 +08:00
committed by GitHub
parent 1f2f4136e6
commit 6936520515

View File

@@ -15,15 +15,7 @@ lateinit var ksuApp: KernelSUApplication
class KernelSUApplication : Application() {
val okhttpClient =
OkHttpClient.Builder().cache(Cache(File(cacheDir, "okhttp"), 10 * 1024 * 1024))
.addInterceptor { block ->
block.proceed(
block.request().newBuilder()
.header("User-Agent", "KernelSU/${BuildConfig.VERSION_CODE}")
.header("Accept-Language", Locale.getDefault().toLanguageTag()).build()
)
}.build()
lateinit var okhttpClient: OkHttpClient
override fun onCreate() {
super.onCreate()
@@ -47,6 +39,16 @@ class KernelSUApplication : Application() {
// Provide working env for rust's temp_dir()
Os.setenv("TMPDIR", cacheDir.absolutePath, true)
okhttpClient =
OkHttpClient.Builder().cache(Cache(File(cacheDir, "okhttp"), 10 * 1024 * 1024))
.addInterceptor { block ->
block.proceed(
block.request().newBuilder()
.header("User-Agent", "KernelSU/${BuildConfig.VERSION_CODE}")
.header("Accept-Language", Locale.getDefault().toLanguageTag()).build()
)
}.build()
}