Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37cd99731c |
5
.idea/jarRepositories.xml
generated
5
.idea/jarRepositories.xml
generated
@@ -81,5 +81,10 @@
|
|||||||
<option name="name" value="MavenLocal" />
|
<option name="name" value="MavenLocal" />
|
||||||
<option name="url" value="file:$USER_HOME$/.m2/repository/" />
|
<option name="url" value="file:$USER_HOME$/.m2/repository/" />
|
||||||
</remote-repository>
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven2" />
|
||||||
|
<option name="name" value="maven2" />
|
||||||
|
<option name="url" value="https://oss.sonatype.org/content/repositories/snapshots" />
|
||||||
|
</remote-repository>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
*Pupil, Hitomi.la viewer for Android*
|
*Pupil, Hitomi.la viewer for Android*
|
||||||
|
|
||||||

|

|
||||||
[](https://github.com/tom5079/Pupil/releases/download/5.1.29/Pupil-v5.1.29.apk)
|
[](https://github.com/tom5079/Pupil/releases/download/5.1.30/Pupil-v5.1.30.apk)
|
||||||
[](https://discord.gg/Stj4b5v)
|
[](https://discord.gg/Stj4b5v)
|
||||||
|
|
||||||
# Features
|
# Features
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ android {
|
|||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 69
|
versionCode 69
|
||||||
versionName "5.1.29"
|
versionName "5.1.30"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,7 @@ dependencies {
|
|||||||
implementation "ru.noties.markwon:core:3.1.0"
|
implementation "ru.noties.markwon:core:3.1.0"
|
||||||
|
|
||||||
implementation "org.jsoup:jsoup:1.14.3"
|
implementation "org.jsoup:jsoup:1.14.3"
|
||||||
implementation "com.github.seven332:quickjs-android:0.1.0"
|
implementation "app.cash.zipline:zipline:1.0.0-SNAPSHOT"
|
||||||
|
|
||||||
implementation "com.google.guava:guava:31.0.1-android"
|
implementation "com.google.guava:guava:31.0.1-android"
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"versionCode": 69,
|
"versionCode": 69,
|
||||||
"versionName": "5.1.29",
|
"versionName": "5.1.30",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import android.content.Context
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.util.Log
|
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
@@ -36,11 +35,6 @@ import com.google.android.gms.common.GooglePlayServicesNotAvailableException
|
|||||||
import com.google.android.gms.common.GooglePlayServicesRepairableException
|
import com.google.android.gms.common.GooglePlayServicesRepairableException
|
||||||
import com.google.android.gms.security.ProviderInstaller
|
import com.google.android.gms.security.ProviderInstaller
|
||||||
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||||
import com.hippo.quickjs.android.QuickJS
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.MainScope
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import okhttp3.Dispatcher
|
import okhttp3.Dispatcher
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
@@ -48,9 +42,7 @@ import okhttp3.Response
|
|||||||
import xyz.quaver.io.FileX
|
import xyz.quaver.io.FileX
|
||||||
import xyz.quaver.pupil.types.Tag
|
import xyz.quaver.pupil.types.Tag
|
||||||
import xyz.quaver.pupil.util.*
|
import xyz.quaver.pupil.util.*
|
||||||
import xyz.quaver.readText
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.net.URL
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|||||||
@@ -17,16 +17,12 @@
|
|||||||
package xyz.quaver.pupil.hitomi
|
package xyz.quaver.pupil.hitomi
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.hippo.quickjs.android.QuickJS
|
import app.cash.zipline.QuickJs
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import kotlinx.coroutines.sync.Mutex
|
|
||||||
import kotlinx.coroutines.sync.withLock
|
|
||||||
import kotlinx.serialization.decodeFromString
|
import kotlinx.serialization.decodeFromString
|
||||||
import xyz.quaver.json
|
import xyz.quaver.json
|
||||||
import xyz.quaver.readText
|
import xyz.quaver.readText
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
|
import java.nio.charset.Charset
|
||||||
|
|
||||||
const val protocol = "https:"
|
const val protocol = "https:"
|
||||||
|
|
||||||
@@ -54,33 +50,18 @@ interface gg {
|
|||||||
fun getInstance(): gg =
|
fun getInstance(): gg =
|
||||||
instance ?: synchronized(this) {
|
instance ?: synchronized(this) {
|
||||||
instance ?: object: gg {
|
instance ?: object: gg {
|
||||||
private val ggjs by lazy { URL("https://ltn.hitomi.la/gg.js").readText() }
|
private val engine = QuickJs.create().also {
|
||||||
private val quickJS = QuickJS.Builder().build()
|
it.evaluate(URL("https://ltn.hitomi.la/gg.js").readText(Charset.defaultCharset()).also {
|
||||||
|
Log.d("PUPILD", it)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
override fun m(g: Int): Int =
|
override fun m(g: Int): Int = engine.evaluate("gg.m($g)") as Int
|
||||||
quickJS.createJSRuntime().use { runtime ->
|
|
||||||
runtime.createJSContext().use { context ->
|
|
||||||
context.evaluate(ggjs, "gg.js")
|
|
||||||
context.evaluate("gg.m($g)", "gg.js", Int::class.java)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override val b: String
|
override val b: String
|
||||||
get() =
|
get() = engine.evaluate("gg.b") as String
|
||||||
quickJS.createJSRuntime().use { runtime ->
|
|
||||||
runtime.createJSContext().use { context ->
|
|
||||||
context.evaluate(ggjs, "gg.js")
|
|
||||||
context.evaluate("gg.b", "gg.js", String::class.java)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun s(h: String): String =
|
override fun s(h: String): String = engine.evaluate("gg.s('$h')") as String
|
||||||
quickJS.createJSRuntime().use { runtime ->
|
|
||||||
runtime.createJSContext().use { context ->
|
|
||||||
context.evaluate(ggjs, "gg.js")
|
|
||||||
context.evaluate("gg.s('$h')", "gg.js", String::class.java)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.also { instance = it }
|
}.also { instance = it }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ class DownloadService : Service() {
|
|||||||
|
|
||||||
override fun source(): BufferedSource {
|
override fun source(): BufferedSource {
|
||||||
if (bufferedSource == null)
|
if (bufferedSource == null)
|
||||||
bufferedSource = Okio.buffer(source(responseBody.source()))
|
bufferedSource = source(responseBody.source()).buffer()
|
||||||
|
|
||||||
return bufferedSource!!
|
return bufferedSource!!
|
||||||
}
|
}
|
||||||
@@ -174,9 +174,13 @@ class DownloadService : Service() {
|
|||||||
private val interceptor: PupilInterceptor = { chain ->
|
private val interceptor: PupilInterceptor = { chain ->
|
||||||
val request = chain.request()
|
val request = chain.request()
|
||||||
|
|
||||||
|
Log.d("PUPILD", "REQ")
|
||||||
|
|
||||||
if (rateLimitHost.matches(request.url().host()))
|
if (rateLimitHost.matches(request.url().host()))
|
||||||
rateLimiter.acquire()
|
rateLimiter.acquire()
|
||||||
|
|
||||||
|
Log.d("PUPILD", "ACQ ${request.url()}")
|
||||||
|
|
||||||
var response = chain.proceed(request)
|
var response = chain.proceed(request)
|
||||||
var limit = 5
|
var limit = 5
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ allprojects {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
jcenter()
|
jcenter()
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
|
||||||
maven { url "https://guardian.github.io/maven/repo-releases/" }
|
maven { url "https://guardian.github.io/maven/repo-releases/" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user