Mangaku: use by lazy
for loading assets (#372)
This commit is contained in:
parent
8a55ca5d6f
commit
27bed17520
@ -204,7 +204,6 @@ class Mangaku : ParsedHttpSource() {
|
|||||||
latch.await(5, TimeUnit.SECONDS)
|
latch.await(5, TimeUnit.SECONDS)
|
||||||
handler.post { webView?.destroy() }
|
handler.post { webView?.destroy() }
|
||||||
|
|
||||||
|
|
||||||
if (latch.count == 1L) {
|
if (latch.count == 1L) {
|
||||||
throw Exception("Kehabisan waktu saat men-decrypt tautan gambar") //Timeout while decrypting image links
|
throw Exception("Kehabisan waktu saat men-decrypt tautan gambar") //Timeout while decrypting image links
|
||||||
}
|
}
|
||||||
@ -238,10 +237,15 @@ class Mangaku : ParsedHttpSource() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val jQueryScript = javaClass
|
private val jQueryScript by lazy {
|
||||||
.getResource("/assets/zepto.min.js")!!
|
javaClass
|
||||||
.readText() // Zepto v1.2.0 (jQuery compatible)
|
.getResource("/assets/zepto.min.js")!!
|
||||||
private val cryptoJSScript = javaClass
|
.readText() // Zepto v1.2.0 (jQuery compatible)
|
||||||
.getResource("/assets/crypto-js.min.js")!!
|
}
|
||||||
.readText() // CryptoJS v4.0.0 (on site: cpr2.js)
|
|
||||||
|
private val cryptoJSScript by lazy {
|
||||||
|
javaClass
|
||||||
|
.getResource("/assets/crypto-js.min.js")!!
|
||||||
|
.readText() // CryptoJS v4.0.0 (on site: cpr2.js)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user