Compare commits

..

1 Commits
5.2.3 ... 5.2.4

Author SHA1 Message Date
tom5079
f33d1a1bfa 5.2.4 Added logging to fix app crashing 2022-01-04 20:16:04 +09:00
6 changed files with 15 additions and 13 deletions

View File

@@ -38,7 +38,7 @@ android {
minSdkVersion 16
targetSdkVersion 30
versionCode 69
versionName "5.2.3"
versionName "5.2.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
@@ -129,7 +129,7 @@ dependencies {
implementation "com.google.guava:guava:31.0.1-android"
implementation "xyz.quaver:documentfilex:0.7.1"
implementation "xyz.quaver:documentfilex:0.7.2-DEV"
implementation "xyz.quaver:floatingsearchview:1.1.7"
testImplementation "junit:junit:4.13.1"

View File

@@ -11,7 +11,7 @@
"type": "SINGLE",
"filters": [],
"versionCode": 69,
"versionName": "5.2.3",
"versionName": "5.2.4",
"outputFile": "app-release.apk"
}
]

View File

@@ -198,7 +198,7 @@ class Pupil : Application() {
webChromeClient = object: WebChromeClient() {
override fun onConsoleMessage(consoleMessage: ConsoleMessage?): Boolean {
FirebaseCrashlytics.getInstance().log(
"onConsoleMessage: $consoleMessage"
"onConsoleMessage: ${consoleMessage?.message()}"
)
return super.onConsoleMessage(consoleMessage)

View File

@@ -43,10 +43,6 @@ const val protocol = "https:"
val evaluations = Collections.newSetFromMap<String>(ConcurrentHashMap())
suspend fun WebView.evaluate(script: String): String = withContext(Dispatchers.Main) {
if (webViewFailed) {
Toast.makeText(Pupil.instance, "Failed to load scripts. Please restart the app.", Toast.LENGTH_LONG).show()
}
while (webViewFailed || !webViewReady) yield()
val uid = UUID.randomUUID().toString()
@@ -65,10 +61,6 @@ suspend fun WebView.evaluate(script: String): String = withContext(Dispatchers.M
@OptIn(ExperimentalCoroutinesApi::class)
suspend fun WebView.evaluatePromise(script: String, then: String = ".then(result => Callback.onResult(%uid, JSON.stringify(result))).catch(err => Callback.onError(%uid, JSON.stringify(error)))"): String? = withContext(Dispatchers.Main) {
if (webViewFailed) {
Toast.makeText(Pupil.instance, "Failed to load the scripts. Please restart the app.", Toast.LENGTH_LONG).show()
}
while (webViewFailed || !webViewReady) yield()
val uid = UUID.randomUUID().toString()

View File

@@ -19,6 +19,7 @@
package xyz.quaver.pupil.util
import android.annotation.SuppressLint
import com.google.firebase.crashlytics.FirebaseCrashlytics
import kotlinx.serialization.json.*
import okhttp3.OkHttpClient
import okhttp3.Request
@@ -103,7 +104,15 @@ suspend fun GalleryInfo.getRequestBuilders(): List<Request.Builder> {
return this.files.map {
Request.Builder()
.url(imageUrlFromImage(galleryID, it, !lowQuality))
.url(
runCatching {
imageUrlFromImage(galleryID, it, !lowQuality)
}
.onFailure {
FirebaseCrashlytics.getInstance().recordException(it)
}
.getOrDefault("https://a/")
)
.header("Referer", "https://hitomi.la/")
.header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36")
}

View File

@@ -23,6 +23,7 @@ allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://guardian.github.io/maven/repo-releases/" }