From 211f7b591b25f946e583268753c841d81a1fb236 Mon Sep 17 00:00:00 2001 From: len Date: Tue, 23 May 2017 20:39:02 +0200 Subject: [PATCH] Dependency updates. OkHttp nullability changes --- app/build.gradle | 16 ++++++++-------- .../kanade/tachiyomi/data/cache/ChapterCache.kt | 4 ++-- .../kanade/tachiyomi/data/download/Downloader.kt | 4 ++-- .../tachiyomi/data/track/anilist/AnilistApi.kt | 4 ++-- .../data/track/anilist/AnilistInterceptor.kt | 2 +- .../data/track/kitsu/KitsuInterceptor.kt | 2 +- .../data/track/myanimelist/MyanimelistApi.kt | 4 ++-- .../data/updater/UpdateDownloaderService.kt | 2 +- .../tachiyomi/network/CloudflareInterceptor.kt | 9 ++------- .../kanade/tachiyomi/network/OkHttpExtensions.kt | 2 +- .../tachiyomi/network/PersistentCookieStore.kt | 2 +- .../tachiyomi/network/ProgressResponseBody.kt | 2 +- .../tachiyomi/source/online/YamlHttpSource.kt | 4 ++-- .../tachiyomi/source/online/english/Batoto.kt | 6 +++--- .../tachiyomi/source/online/english/Kissmanga.kt | 6 +++--- .../tachiyomi/source/online/english/Mangafox.kt | 2 +- .../tachiyomi/source/online/english/Mangahere.kt | 2 +- .../tachiyomi/source/online/english/Mangasee.kt | 4 ++-- .../tachiyomi/source/online/russian/Mangachan.kt | 2 +- .../tachiyomi/source/online/russian/Mintmanga.kt | 2 +- .../tachiyomi/source/online/russian/Readmanga.kt | 2 +- .../eu/kanade/tachiyomi/util/JsoupExtensions.kt | 2 +- 22 files changed, 40 insertions(+), 45 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9205d23a3f..5945298e5b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -120,17 +120,17 @@ dependencies { // ReactiveX compile 'io.reactivex:rxandroid:1.2.1' - compile 'io.reactivex:rxjava:1.2.9' + compile 'io.reactivex:rxjava:1.3.0' compile 'com.jakewharton.rxrelay:rxrelay:1.2.0' compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2' compile 'com.github.pwittchen:reactivenetwork:0.7.0' // Network client - compile "com.squareup.okhttp3:okhttp:3.6.0" - compile 'com.squareup.okio:okio:1.11.0' + compile "com.squareup.okhttp3:okhttp:3.8.0" + compile 'com.squareup.okio:okio:1.13.0' // REST - final retrofit_version = '2.2.0' + final retrofit_version = '2.3.0' compile "com.squareup.retrofit2:retrofit:$retrofit_version" compile "com.squareup.retrofit2:converter-gson:$retrofit_version" compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" @@ -160,7 +160,7 @@ dependencies { compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0' // Database - compile "com.pushtorefresh.storio:sqlite:1.12.3" + compile "com.pushtorefresh.storio:sqlite:1.13.0" // Model View Presenter final nucleus_version = '3.0.0' @@ -172,8 +172,8 @@ dependencies { compile "uy.kohesive.injekt:injekt-core:1.16.1" // Image library - compile 'com.github.bumptech.glide:glide:3.7.0' - compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar' + compile 'com.github.bumptech.glide:glide:3.8.0' + compile 'com.github.bumptech.glide:okhttp3-integration:1.5.0@aar' // Transformations compile 'jp.wasabeef:glide-transformations:2.0.2' @@ -192,7 +192,7 @@ dependencies { compile 'eu.davidea:flexible-adapter:5.0.0-rc1' compile 'com.nononsenseapps:filepicker:2.5.2' compile 'com.github.amulyakhare:TextDrawable:558677e' - compile 'com.afollestad.material-dialogs:core:0.9.4.2' + compile 'com.afollestad.material-dialogs:core:0.9.4.5' compile 'me.zhanghai.android.systemuihelper:library:1.0.0' compile 'de.hdodenhof:circleimageview:2.1.0' compile 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.0.4' diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt index 6f75d0db64..cbeb2f43d3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt @@ -187,12 +187,12 @@ class ChapterCache(private val context: Context) { editor = diskCache.edit(key) ?: throw IOException("Unable to edit key") // Get OutputStream and write image with Okio. - response.body().source().saveTo(editor.newOutputStream(0)) + response.body()!!.source().saveTo(editor.newOutputStream(0)) diskCache.flush() editor.commit() } finally { - response.body().close() + response.body()?.close() editor?.abortUnlessCommitted() } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt index 82a3bcbec2..ee2bed35fa 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt @@ -380,7 +380,7 @@ class Downloader(private val context: Context, private val provider: DownloadPro .map { response -> val file = tmpDir.createFile("$filename.tmp") try { - response.body().source().saveTo(file.openOutputStream()) + response.body()!!.source().saveTo(file.openOutputStream()) val extension = getImageExtension(response, file) file.renameTo("$filename.$extension") } catch (e: Exception) { @@ -403,7 +403,7 @@ class Downloader(private val context: Context, private val provider: DownloadPro */ private fun getImageExtension(response: Response, file: UniFile): String { // Read content type if available. - val mime = response.body().contentType()?.let { ct -> "${ct.type()}/${ct.subtype()}" } + val mime = response.body()?.contentType()?.let { ct -> "${ct.type()}/${ct.subtype()}" } // Else guess from the uri. ?: context.contentResolver.getType(file.uri) // Else read magic numbers. diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt index 1e1e620cbb..8f67ddbe88 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt @@ -26,7 +26,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { fun addLibManga(track: Track): Observable { return rest.addLibManga(track.remote_id, track.last_chapter_read, track.toAnilistStatus()) .map { response -> - response.body().close() + response.body()?.close() if (!response.isSuccessful) { throw Exception("Could not add manga") } @@ -38,7 +38,7 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) { return rest.updateLibManga(track.remote_id, track.last_chapter_read, track.toAnilistStatus(), track.toAnilistScore()) .map { response -> - response.body().close() + response.body()?.close() if (!response.isSuccessful) { throw Exception("Could not update manga") } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistInterceptor.kt index 7cdc5dde87..2bb8525d3b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistInterceptor.kt @@ -28,7 +28,7 @@ class AnilistInterceptor(private var refreshToken: String?) : Interceptor { if (oauth == null || oauth!!.isExpired()) { val response = chain.proceed(AnilistApi.refreshTokenRequest(refreshToken!!)) oauth = if (response.isSuccessful) { - Gson().fromJson(response.body().string(), OAuth::class.java) + Gson().fromJson(response.body()!!.string(), OAuth::class.java) } else { response.close() null diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuInterceptor.kt index 92847310fb..8810dd2743 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuInterceptor.kt @@ -22,7 +22,7 @@ class KitsuInterceptor(val kitsu: Kitsu, val gson: Gson) : Interceptor { if (currAuth.isExpired()) { val response = chain.proceed(KitsuApi.refreshTokenRequest(refreshToken)) if (response.isSuccessful) { - newAuth(gson.fromJson(response.body().string(), OAuth::class.java)) + newAuth(gson.fromJson(response.body()!!.string(), OAuth::class.java)) } else { response.close() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyanimelistApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyanimelistApi.kt index 973b2f26e3..85f85807e9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyanimelistApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyanimelistApi.kt @@ -46,7 +46,7 @@ class MyanimelistApi(private val client: OkHttpClient, username: String, passwor } else { client.newCall(GET(getSearchUrl(query), headers)) .asObservable() - .map { Jsoup.parse(it.body().string()) } + .map { Jsoup.parse(it.body()!!.string()) } .flatMap { Observable.from(it.select("entry")) } .filter { it.select("type").text() != "Novel" } .map { @@ -64,7 +64,7 @@ class MyanimelistApi(private val client: OkHttpClient, username: String, passwor return client .newCall(GET(getListUrl(username), headers)) .asObservable() - .map { Jsoup.parse(it.body().string()) } + .map { Jsoup.parse(it.body()!!.string()) } .flatMap { Observable.from(it.select("manga")) } .map { Track.create(TrackManager.MYANIMELIST).apply { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdateDownloaderService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdateDownloaderService.kt index 423513898a..dfb33db5bd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdateDownloaderService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdateDownloaderService.kt @@ -86,7 +86,7 @@ class UpdateDownloaderService : IntentService(UpdateDownloaderService::class.jav val apkFile = File(externalCacheDir, "update.apk") if (response.isSuccessful) { - response.body().source().saveTo(apkFile) + response.body()!!.source().saveTo(apkFile) } else { response.close() throw Exception("Unsuccessful response") diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt index 3a1840b060..8885e6f16e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/CloudflareInterceptor.kt @@ -8,13 +8,10 @@ import okhttp3.Response class CloudflareInterceptor : Interceptor { - //language=RegExp private val operationPattern = Regex("""setTimeout\(function\(\)\{\s+(var (?:\w,)+f.+?\r?\n[\s\S]+?a\.value =.+?)\r?\n""") - //language=RegExp private val passPattern = Regex("""name="pass" value="(.+?)"""") - //language=RegExp private val challengePattern = Regex("""name="jschl_vc" value="(\w+)"""") @Synchronized @@ -34,7 +31,7 @@ class CloudflareInterceptor : Interceptor { val originalRequest = response.request() val url = originalRequest.url() val domain = url.host() - val content = response.body().string() + val content = response.body()!!.string() // CloudFlare requires waiting 4 seconds before resolving the challenge Thread.sleep(4000) @@ -48,9 +45,7 @@ class CloudflareInterceptor : Interceptor { } val js = operation - //language=RegExp .replace(Regex("""a\.value =(.+?) \+.*"""), "$1") - //language=RegExp .replace(Regex("""\s{3,}[a-z](?: = |\.).+"""), "") .replace("\n", "") @@ -58,7 +53,7 @@ class CloudflareInterceptor : Interceptor { val answer = "${result + domain.length}" - val cloudflareUrl = HttpUrl.parse("${url.scheme()}://$domain/cdn-cgi/l/chk_jschl") + val cloudflareUrl = HttpUrl.parse("${url.scheme()}://$domain/cdn-cgi/l/chk_jschl")!! .newBuilder() .addQueryParameter("jschl_vc", challenge) .addQueryParameter("pass", pass) diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt index ba72fb62b7..d82a75923e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt @@ -61,7 +61,7 @@ fun OkHttpClient.newCallWithProgress(request: Request, listener: ProgressListene .addNetworkInterceptor { chain -> val originalResponse = chain.proceed(chain.request()) originalResponse.newBuilder() - .body(ProgressResponseBody(originalResponse.body(), listener)) + .body(ProgressResponseBody(originalResponse.body()!!, listener)) .build() } .build() diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/PersistentCookieStore.kt b/app/src/main/java/eu/kanade/tachiyomi/network/PersistentCookieStore.kt index 4664b22f45..766bb49a22 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/PersistentCookieStore.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/PersistentCookieStore.kt @@ -18,7 +18,7 @@ class PersistentCookieStore(context: Context) { if (cookies != null) { try { val url = HttpUrl.parse("http://$key") - val nonExpiredCookies = cookies.map { Cookie.parse(url, it) } + val nonExpiredCookies = cookies.mapNotNull { Cookie.parse(url, it) } .filter { !it.hasExpired() } cookieMap.put(key, nonExpiredCookies) } catch (e: Exception) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt b/app/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt index 2e2c32f75e..f8123c5199 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt @@ -12,7 +12,7 @@ class ProgressResponseBody(private val responseBody: ResponseBody, private val p } override fun contentType(): MediaType { - return responseBody.contentType() + return responseBody.contentType()!! } override fun contentLength(): Long { diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/YamlHttpSource.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/YamlHttpSource.kt index e73681d236..582a7c3d31 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/YamlHttpSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/YamlHttpSource.kt @@ -171,7 +171,7 @@ class YamlHttpSource(mappings: Map<*, *>) : HttpSource() { } override fun pageListParse(response: Response): List { - val body = response.body().string() + val body = response.body()!!.string() val url = response.request().url().toString() val pages = mutableListOf() @@ -216,7 +216,7 @@ class YamlHttpSource(mappings: Map<*, *>) : HttpSource() { } override fun imageUrlParse(response: Response): String { - val body = response.body().string() + val body = response.body()!!.string() val url = response.request().url().toString() with(map.pages) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Batoto.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Batoto.kt index d8f35cfb29..5cd5fbdb3a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Batoto.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Batoto.kt @@ -85,7 +85,7 @@ class Batoto : ParsedHttpSource(), LoginSource { override fun latestUpdatesNextPageSelector() = "#show_more_row" override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = HttpUrl.parse("$baseUrl/search_ajax").newBuilder() + val url = HttpUrl.parse("$baseUrl/search_ajax")!!.newBuilder() if (!query.isEmpty()) url.addQueryParameter("name", query).addQueryParameter("name_cond", "c") var genres = "" filters.forEach { filter -> @@ -162,7 +162,7 @@ class Batoto : ParsedHttpSource(), LoginSource { } override fun chapterListParse(response: Response): List { - val body = response.body().string() + val body = response.body()!!.string() val matcher = staffNotice.matcher(body) if (matcher.find()) { @Suppress("DEPRECATION") @@ -271,7 +271,7 @@ class Batoto : ParsedHttpSource(), LoginSource { } override fun isAuthenticationSuccessful(response: Response) = - response.priorResponse() != null && response.priorResponse().code() == 302 + response.priorResponse() != null && response.priorResponse()!!.code() == 302 override fun isLogged(): Boolean { return network.cookies.get(URI(baseUrl)).any { it.name() == "pass_hash" } diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Kissmanga.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Kissmanga.kt index 098467d7b3..b77adeca3b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Kissmanga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Kissmanga.kt @@ -115,13 +115,13 @@ class Kissmanga : ParsedHttpSource() { override fun pageListRequest(chapter: SChapter) = POST(baseUrl + chapter.url, headers) override fun pageListParse(response: Response): List { - val body = response.body().string() + val body = response.body()!!.string() val pages = mutableListOf() // Kissmanga now encrypts the urls, so we need to execute these two scripts in JS. - val ca = client.newCall(GET("$baseUrl/Scripts/ca.js", headers)).execute().body().string() - val lo = client.newCall(GET("$baseUrl/Scripts/lo.js", headers)).execute().body().string() + val ca = client.newCall(GET("$baseUrl/Scripts/ca.js", headers)).execute().body()!!.string() + val lo = client.newCall(GET("$baseUrl/Scripts/lo.js", headers)).execute().body()!!.string() Duktape.create().use { it.evaluate(ca) diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangafox.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangafox.kt index 5ea36d8e01..4444d9105f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangafox.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangafox.kt @@ -55,7 +55,7 @@ class Mangafox : ParsedHttpSource() { override fun latestUpdatesNextPageSelector() = "a:has(span.next)" override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = HttpUrl.parse("$baseUrl/search.php?name_method=cw&author_method=cw&artist_method=cw&advopts=1").newBuilder().addQueryParameter("name", query) + val url = HttpUrl.parse("$baseUrl/search.php?name_method=cw&author_method=cw&artist_method=cw&advopts=1")!!.newBuilder().addQueryParameter("name", query) (if (filters.isEmpty()) getFilterList() else filters).forEach { filter -> when (filter) { is Status -> url.addQueryParameter(filter.id, filter.state.toString()) diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangahere.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangahere.kt index 66d76d4e1d..42a8e17b9c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangahere.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangahere.kt @@ -57,7 +57,7 @@ class Mangahere : ParsedHttpSource() { override fun latestUpdatesNextPageSelector() = "div.next-page > a.next" override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = HttpUrl.parse("$baseUrl/search.php?name_method=cw&author_method=cw&artist_method=cw&advopts=1").newBuilder().addQueryParameter("name", query) + val url = HttpUrl.parse("$baseUrl/search.php?name_method=cw&author_method=cw&artist_method=cw&advopts=1")!!.newBuilder().addQueryParameter("name", query) (if (filters.isEmpty()) getFilterList() else filters).forEach { filter -> when (filter) { is Status -> url.addQueryParameter("is_completed", arrayOf("", "1", "0")[filter.state]) diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangasee.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangasee.kt index b0aa2a8c78..eb950a8fc5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangasee.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/english/Mangasee.kt @@ -54,7 +54,7 @@ class Mangasee : ParsedHttpSource() { override fun searchMangaSelector() = "div.requested > div.row" override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = HttpUrl.parse("$baseUrl/search/request.php").newBuilder() + val url = HttpUrl.parse("$baseUrl/search/request.php")!!.newBuilder() if (!query.isEmpty()) url.addQueryParameter("keyword", query) val genres = mutableListOf() val genresNo = mutableListOf() @@ -84,7 +84,7 @@ class Mangasee : ParsedHttpSource() { } private fun convertQueryToPost(page: Int, url: String): Pair { - val url = HttpUrl.parse(url) + val url = HttpUrl.parse(url)!! val body = FormBody.Builder().add("page", page.toString()) for (i in 0..url.querySize() - 1) { body.add(url.queryParameterName(i), url.queryParameterValue(i)) diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mangachan.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mangachan.kt index 0868e4cdc5..a104f1b374 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mangachan.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mangachan.kt @@ -152,7 +152,7 @@ class Mangachan : ParsedHttpSource() { } override fun pageListParse(response: Response): List { - val html = response.body().string() + val html = response.body()!!.string() val beginIndex = html.indexOf("fullimg\":[") + 10 val endIndex = html.indexOf(",]", beginIndex) val trimmedHtml = html.substring(beginIndex, endIndex).replace("\"", "") diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mintmanga.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mintmanga.kt index 6097859fad..b861023568 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mintmanga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mintmanga.kt @@ -120,7 +120,7 @@ class Mintmanga : ParsedHttpSource() { } override fun pageListParse(response: Response): List { - val html = response.body().string() + val html = response.body()!!.string() val beginIndex = html.indexOf("rm_h.init( [") val endIndex = html.indexOf("], 0, false);", beginIndex) val trimmedHtml = html.substring(beginIndex, endIndex) diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Readmanga.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Readmanga.kt index 6ac6e9c28e..bb3af34dc7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Readmanga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Readmanga.kt @@ -120,7 +120,7 @@ class Readmanga : ParsedHttpSource() { } override fun pageListParse(response: Response): List { - val html = response.body().string() + val html = response.body()!!.string() val beginIndex = html.indexOf("rm_h.init( [") val endIndex = html.indexOf("], 0, false);", beginIndex) val trimmedHtml = html.substring(beginIndex, endIndex) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt index 7b5609f6f8..30471b37c9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/JsoupExtensions.kt @@ -22,5 +22,5 @@ fun Element.attrOrText(css: String): String { * @param html the body of the response. Use only if the body was read before calling this method. */ fun Response.asJsoup(html: String? = null): Document { - return Jsoup.parse(html ?: body().string(), request().url().toString()) + return Jsoup.parse(html ?: body()!!.string(), request().url().toString()) } \ No newline at end of file