mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
chore: Move core module to core.main
This commit is contained in:
parent
672d364f43
commit
54a3059730
45 changed files with 22 additions and 24 deletions
|
@ -144,7 +144,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(projects.core)
|
implementation(projects.core.main)
|
||||||
implementation(projects.data)
|
implementation(projects.data)
|
||||||
implementation(projects.domain)
|
implementation(projects.domain)
|
||||||
implementation(projects.i18n)
|
implementation(projects.i18n)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.network
|
package eu.kanade.tachiyomi.network
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
import okhttp3.MediaType
|
import okhttp3.MediaType
|
||||||
import okhttp3.ResponseBody
|
import okhttp3.ResponseBody
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
|
@ -7,7 +8,6 @@ import okio.BufferedSource
|
||||||
import okio.ForwardingSource
|
import okio.ForwardingSource
|
||||||
import okio.Source
|
import okio.Source
|
||||||
import okio.buffer
|
import okio.buffer
|
||||||
import java.io.IOException
|
|
||||||
|
|
||||||
class ProgressResponseBody(private val responseBody: ResponseBody, private val progressListener: ProgressListener) : ResponseBody() {
|
class ProgressResponseBody(private val responseBody: ResponseBody, private val progressListener: ProgressListener) : ResponseBody() {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.network
|
package eu.kanade.tachiyomi.network
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit.MINUTES
|
||||||
import okhttp3.CacheControl
|
import okhttp3.CacheControl
|
||||||
import okhttp3.FormBody
|
import okhttp3.FormBody
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
|
@ -7,7 +8,6 @@ import okhttp3.HttpUrl
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.RequestBody
|
import okhttp3.RequestBody
|
||||||
import java.util.concurrent.TimeUnit.*
|
|
||||||
|
|
||||||
private val DEFAULT_CACHE_CONTROL = CacheControl.Builder().maxAge(10, MINUTES).build()
|
private val DEFAULT_CACHE_CONTROL = CacheControl.Builder().maxAge(10, MINUTES).build()
|
||||||
private val DEFAULT_HEADERS = Headers.Builder().build()
|
private val DEFAULT_HEADERS = Headers.Builder().build()
|
|
@ -1,11 +1,11 @@
|
||||||
package eu.kanade.tachiyomi.network.interceptor
|
package eu.kanade.tachiyomi.network.interceptor
|
||||||
|
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
|
import java.io.IOException
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import java.io.IOException
|
|
||||||
import java.util.concurrent.*
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An OkHttp interceptor that handles rate limiting.
|
* An OkHttp interceptor that handles rate limiting.
|
|
@ -1,12 +1,12 @@
|
||||||
package eu.kanade.tachiyomi.network.interceptor
|
package eu.kanade.tachiyomi.network.interceptor
|
||||||
|
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
|
import java.io.IOException
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.HttpUrl
|
import okhttp3.HttpUrl
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import java.io.IOException
|
|
||||||
import java.util.concurrent.*
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An OkHttp interceptor that handles given url host's rate limiting.
|
* An OkHttp interceptor that handles given url host's rate limiting.
|
|
@ -1,8 +1,8 @@
|
||||||
package eu.kanade.tachiyomi.network.interceptor
|
package eu.kanade.tachiyomi.network.interceptor
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import java.io.IOException
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Catches any uncaught exceptions from later in the chain and rethrows as a non-fatal
|
* Catches any uncaught exceptions from later in the chain and rethrows as a non-fatal
|
|
@ -10,13 +10,14 @@ import eu.kanade.tachiyomi.util.system.WebViewUtil
|
||||||
import eu.kanade.tachiyomi.util.system.launchUI
|
import eu.kanade.tachiyomi.util.system.launchUI
|
||||||
import eu.kanade.tachiyomi.util.system.setDefaultSettings
|
import eu.kanade.tachiyomi.util.system.setDefaultSettings
|
||||||
import eu.kanade.tachiyomi.util.system.toast
|
import eu.kanade.tachiyomi.util.system.toast
|
||||||
|
import java.util.Locale
|
||||||
|
import java.util.concurrent.CountDownLatch
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import yokai.i18n.MR
|
import yokai.i18n.MR
|
||||||
import java.util.*
|
|
||||||
import java.util.concurrent.*
|
|
||||||
|
|
||||||
abstract class WebViewInterceptor(
|
abstract class WebViewInterceptor(
|
||||||
private val context: Context,
|
private val context: Context,
|
|
@ -5,7 +5,6 @@ import android.widget.Toast
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import dev.icerock.moko.resources.StringResource
|
import dev.icerock.moko.resources.StringResource
|
||||||
import yokai.util.lang.getString
|
import yokai.util.lang.getString
|
||||||
import dev.icerock.moko.resources.compose.stringResource
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a toast in this context.
|
* Display a toast in this context.
|
|
@ -7,7 +7,6 @@ import android.os.ParcelFileDescriptor
|
||||||
import com.hippo.unifile.UniFile
|
import com.hippo.unifile.UniFile
|
||||||
import java.io.BufferedOutputStream
|
import java.io.BufferedOutputStream
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.nio.channels.SeekableByteChannel
|
|
||||||
|
|
||||||
val UniFile.nameWithoutExtension: String?
|
val UniFile.nameWithoutExtension: String?
|
||||||
get() = name?.substringBeforeLast('.')
|
get() = name?.substringBeforeLast('.')
|
|
@ -1,10 +1,10 @@
|
||||||
package yokai.core.archive
|
package yokai.core.archive
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer
|
||||||
|
import kotlin.concurrent.Volatile
|
||||||
import me.zhanghai.android.libarchive.Archive
|
import me.zhanghai.android.libarchive.Archive
|
||||||
import me.zhanghai.android.libarchive.ArchiveEntry
|
import me.zhanghai.android.libarchive.ArchiveEntry
|
||||||
import me.zhanghai.android.libarchive.ArchiveException
|
import me.zhanghai.android.libarchive.ArchiveException
|
||||||
import java.nio.ByteBuffer
|
|
||||||
import kotlin.concurrent.Volatile
|
|
||||||
|
|
||||||
class AndroidArchiveInputStream(buffer: Long, size: Long) : ArchiveInputStream() {
|
class AndroidArchiveInputStream(buffer: Long, size: Long) : ArchiveInputStream() {
|
||||||
private val lock = Any()
|
private val lock = Any()
|
|
@ -6,8 +6,8 @@ import android.system.Os
|
||||||
import android.system.OsConstants
|
import android.system.OsConstants
|
||||||
import com.hippo.unifile.UniFile
|
import com.hippo.unifile.UniFile
|
||||||
import eu.kanade.tachiyomi.util.system.openFileDescriptor
|
import eu.kanade.tachiyomi.util.system.openFileDescriptor
|
||||||
import me.zhanghai.android.libarchive.ArchiveException
|
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
|
import me.zhanghai.android.libarchive.ArchiveException
|
||||||
|
|
||||||
class AndroidArchiveReader(pfd: ParcelFileDescriptor) : ArchiveReader {
|
class AndroidArchiveReader(pfd: ParcelFileDescriptor) : ArchiveReader {
|
||||||
val size = pfd.statSize
|
val size = pfd.statSize
|
|
@ -5,11 +5,11 @@ import android.system.Os
|
||||||
import android.system.StructStat
|
import android.system.StructStat
|
||||||
import com.hippo.unifile.UniFile
|
import com.hippo.unifile.UniFile
|
||||||
import eu.kanade.tachiyomi.util.system.openFileDescriptor
|
import eu.kanade.tachiyomi.util.system.openFileDescriptor
|
||||||
|
import java.io.Closeable
|
||||||
|
import java.nio.ByteBuffer
|
||||||
import me.zhanghai.android.libarchive.Archive
|
import me.zhanghai.android.libarchive.Archive
|
||||||
import me.zhanghai.android.libarchive.ArchiveEntry
|
import me.zhanghai.android.libarchive.ArchiveEntry
|
||||||
import me.zhanghai.android.libarchive.ArchiveException
|
import me.zhanghai.android.libarchive.ArchiveException
|
||||||
import java.io.Closeable
|
|
||||||
import java.nio.ByteBuffer
|
|
||||||
|
|
||||||
class ZipWriter(val context: Context, file: UniFile) : Closeable {
|
class ZipWriter(val context: Context, file: UniFile) : Closeable {
|
||||||
private val pfd = file.openFileDescriptor(context, "wt")
|
private val pfd = file.openFileDescriptor(context, "wt")
|
|
@ -1,5 +1,8 @@
|
||||||
package yokai.util.lang
|
package yokai.util.lang
|
||||||
|
|
||||||
|
import kotlin.coroutines.cancellation.CancellationException
|
||||||
|
import kotlin.coroutines.resume
|
||||||
|
import kotlin.coroutines.resumeWithException
|
||||||
import kotlinx.coroutines.CancellableContinuation
|
import kotlinx.coroutines.CancellableContinuation
|
||||||
import kotlinx.coroutines.CoroutineStart
|
import kotlinx.coroutines.CoroutineStart
|
||||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||||
|
@ -12,9 +15,6 @@ import rx.Emitter
|
||||||
import rx.Observable
|
import rx.Observable
|
||||||
import rx.Subscriber
|
import rx.Subscriber
|
||||||
import rx.Subscription
|
import rx.Subscription
|
||||||
import kotlin.coroutines.cancellation.CancellationException
|
|
||||||
import kotlin.coroutines.resume
|
|
||||||
import kotlin.coroutines.resumeWithException
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Util functions for bridging RxJava and coroutines. Taken from TachiyomiEH/SY.
|
* Util functions for bridging RxJava and coroutines. Taken from TachiyomiEH/SY.
|
|
@ -5,7 +5,6 @@ import kotlinx.coroutines.CoroutineStart
|
||||||
import kotlinx.coroutines.DelicateCoroutinesApi
|
import kotlinx.coroutines.DelicateCoroutinesApi
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.GlobalScope
|
import kotlinx.coroutines.GlobalScope
|
||||||
import kotlinx.coroutines.IO
|
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import kotlinx.coroutines.NonCancellable
|
import kotlinx.coroutines.NonCancellable
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
|
@ -20,7 +20,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(projects.core)
|
implementation(projects.core.main)
|
||||||
implementation(projects.data)
|
implementation(projects.data)
|
||||||
implementation(projects.domain)
|
implementation(projects.domain)
|
||||||
implementation(projects.i18n)
|
implementation(projects.i18n)
|
||||||
|
|
|
@ -31,7 +31,7 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||||
|
|
||||||
rootProject.name = "Yokai"
|
rootProject.name = "Yokai"
|
||||||
include(":app")
|
include(":app")
|
||||||
include(":core")
|
include(":core:main")
|
||||||
include(":data")
|
include(":data")
|
||||||
include(":domain")
|
include(":domain")
|
||||||
include(":i18n")
|
include(":i18n")
|
||||||
|
|
|
@ -21,7 +21,7 @@ kotlin {
|
||||||
}
|
}
|
||||||
val androidMain by getting {
|
val androidMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(projects.core)
|
implementation(projects.core.main)
|
||||||
api(androidx.preference)
|
api(androidx.preference)
|
||||||
|
|
||||||
// Workaround for https://youtrack.jetbrains.com/issue/KT-57605
|
// Workaround for https://youtrack.jetbrains.com/issue/KT-57605
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue