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 minSdkVersion 16
targetSdkVersion 30 targetSdkVersion 30
versionCode 69 versionCode 69
versionName "5.2.3" versionName "5.2.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
@@ -129,7 +129,7 @@ dependencies {
implementation "com.google.guava:guava:31.0.1-android" 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" implementation "xyz.quaver:floatingsearchview:1.1.7"
testImplementation "junit:junit:4.13.1" testImplementation "junit:junit:4.13.1"

View File

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

View File

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

View File

@@ -43,10 +43,6 @@ const val protocol = "https:"
val evaluations = Collections.newSetFromMap<String>(ConcurrentHashMap()) val evaluations = Collections.newSetFromMap<String>(ConcurrentHashMap())
suspend fun WebView.evaluate(script: String): String = withContext(Dispatchers.Main) { 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() while (webViewFailed || !webViewReady) yield()
val uid = UUID.randomUUID().toString() val uid = UUID.randomUUID().toString()
@@ -65,10 +61,6 @@ suspend fun WebView.evaluate(script: String): String = withContext(Dispatchers.M
@OptIn(ExperimentalCoroutinesApi::class) @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) { 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() while (webViewFailed || !webViewReady) yield()
val uid = UUID.randomUUID().toString() val uid = UUID.randomUUID().toString()

View File

@@ -19,6 +19,7 @@
package xyz.quaver.pupil.util package xyz.quaver.pupil.util
import android.annotation.SuppressLint import android.annotation.SuppressLint
import com.google.firebase.crashlytics.FirebaseCrashlytics
import kotlinx.serialization.json.* import kotlinx.serialization.json.*
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
@@ -103,7 +104,15 @@ suspend fun GalleryInfo.getRequestBuilders(): List<Request.Builder> {
return this.files.map { return this.files.map {
Request.Builder() 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("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") .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 { repositories {
google() google()
mavenCentral() mavenCentral()
mavenLocal()
jcenter() jcenter()
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
maven { url "https://guardian.github.io/maven/repo-releases/" } maven { url "https://guardian.github.io/maven/repo-releases/" }