Skip to content

Commit

Permalink
fix: crash tiann#2463 (tiann#2465)
Browse files Browse the repository at this point in the history
my bad
  • Loading branch information
JasonKhew96 authored and selfmusing committed Feb 22, 2025
1 parent ce3446b commit 6500db3
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
}


Expand Down

0 comments on commit 6500db3

Please sign in to comment.