update some dependencies etc

This commit is contained in:
jmir1
2021-05-27 16:04:37 +02:00
parent e93f3b9801
commit 4237b8d70e
21 changed files with 103 additions and 52 deletions

View File

@ -2,7 +2,7 @@
I acknowledge that: I acknowledge that:
- I have updated to the latest version of the app (stable is v0.10.11) - I have updated to the latest version of the app (stable is v0.10.12)
- I have updated all extensions - I have updated all extensions
- If this is an issue with the app itself, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi - If this is an issue with the app itself, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi
- I have searched the existing issues for duplicates - I have searched the existing issues for duplicates

View File

@ -10,7 +10,7 @@ labels: "enhancement"
I acknowledge that: I acknowledge that:
- I have updated: - I have updated:
- To the latest version of the app (stable is v0.10.11) - To the latest version of the app (stable is v0.10.12)
- All extensions - All extensions
- I have tried the troubleshooting guide: https://tachiyomi.org/help/guides/troubleshooting-problems/ - I have tried the troubleshooting guide: https://tachiyomi.org/help/guides/troubleshooting-problems/
- If this is an issue with the app itself, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi - If this is an issue with the app itself, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi

View File

@ -10,7 +10,7 @@ labels: "meta"
I acknowledge that: I acknowledge that:
- I have updated: - I have updated:
- To the latest version of the app (stable is v0.10.11) - To the latest version of the app (stable is v0.10.12)
- All extensions - All extensions
- I have tried the troubleshooting guide: https://tachiyomi.org/help/guides/troubleshooting-problems/ - I have tried the troubleshooting guide: https://tachiyomi.org/help/guides/troubleshooting-problems/
- If this is an issue with the app itself, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi - If this is an issue with the app itself, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi

View File

@ -10,7 +10,7 @@ labels: "bug"
I acknowledge that: I acknowledge that:
- I have updated: - I have updated:
- To the latest version of the app (stable is v0.10.11) - To the latest version of the app (stable is v0.10.12)
- All extensions - All extensions
- I have tried the troubleshooting guide: https://tachiyomi.org/help/guides/troubleshooting-problems/ - I have tried the troubleshooting guide: https://tachiyomi.org/help/guides/troubleshooting-problems/
- If this is an issue with the app itself, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi - If this is an issue with the app itself, that I should be opening an issue in https://github.com/tachiyomiorg/tachiyomi

View File

@ -1,5 +1,5 @@
--- ---
name: "Source Request" name: "🌐 Source Request"
title: "[Source Request] <Source Name>" title: "[Source Request] <Source Name>"
about: "Suggest a new source for Tachiyomi" about: "Suggest a new source for Tachiyomi"
labels: "Source Request" labels: "Source Request"

View File

@ -9,9 +9,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Autoclose issues - name: Autoclose issues
uses: arkon/issue-closer-action@v3.0 uses: arkon/issue-closer-action@v3.4
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
ignoreLabel: do-not-autoclose
rules: | rules: |
[ [
{ {
@ -28,5 +29,17 @@ jobs:
"type": "body", "type": "body",
"regex": ".*\\* (Tachiyomi version|Android version|Device|Name|Link|Extension version): \\?.*", "regex": ".*\\* (Tachiyomi version|Android version|Device|Name|Link|Extension version): \\?.*",
"message": "The requested information was not filled out" "message": "The requested information was not filled out"
},
{
"type": "both",
"regex": ".*(mangago|mangafox|hq\\s*dragon|manga\\s*host|supermangas|superhentais|union\\s*mangas|yes\\s*mangas|manhuascan|heroscan|manhwahot).*",
"ignoreCase": true,
"message": "{match} will not be added back as it is too difficult to maintain. Read #3475 for more information"
},
{
"type": "both",
"regex": ".*(teamx|tqneplus|manga\\s*disk|komiktap|gourmet\\s*scans|manga\\s*crimson|mangawow|voidscans|hikari\\s*scans|mangagegecesi|piedpiperfb).*",
"ignoreCase": true,
"message": "{match} will not be added back as the Scanlator team has requested it to be removed. Read #3475 for more information"
} }
] ]

14
.github/workflows/issue_moderator.yml vendored Normal file
View File

@ -0,0 +1,14 @@
name: Issue moderator
on:
issue_comment:
types: [created]
jobs:
autoclose:
runs-on: ubuntu-latest
steps:
- name: Moderate issues
uses: tachiyomiorg/issue-moderator-action@v1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -354,7 +354,7 @@ with open(f"{package}/src/{source}.kt", "w") as f:
## Running ## Running
To aid in local development, you can use the following run configuration to launch an extension: To make local development more convenient, you can use the following run configuration to launch Tachiyomi directly at the Browse panel:
![](https://i.imgur.com/STy0UFY.png) ![](https://i.imgur.com/STy0UFY.png)
@ -372,7 +372,21 @@ And for a release build of Tachiyomi:
## Debugging ## Debugging
Directly debugging your extension (i.e stepping through the extension code) is not possible due to the way that extension code is loaded into the app. However, logs printed from extensions (via [`Logcat`](https://developer.android.com/studio/debug/am-logcat)) do work. ### Android Debugger
You can leverage the Android Debugger to step through your extension while debugging.
You *cannot* simply use Android Studio's `Debug 'module.name'` -> this will most likely result in an error while launching.
Instead, once you've built and installed your extension on the target device, use `Attach Debugger to Android Process` to start debugging Tachiyomi.
![](https://i.imgur.com/muhXyfu.png)
### Logs
You can also elect to simply rely on logs printed from your extension, which
show up in the [`Logcat`](https://developer.android.com/studio/debug/am-logcat) panel of Android Studio
## Building ## Building

View File

@ -3,5 +3,5 @@ plugins {
} }
dependencies { dependencies {
compileOnly(Deps.kotlin.stdlib) compileOnly(Dependencies.kotlin.stdlib)
} }

View File

@ -1,13 +1,13 @@
buildscript { buildscript {
ext.kotlin_version = '1.4.10' ext.kotlin_version = '1.4.32'
ext.coroutines_version = '1.3.9' ext.coroutines_version = '1.4.3'
repositories { repositories {
mavenCentral() mavenCentral()
google() google()
maven { url 'https://plugins.gradle.org/m2/' } maven { url 'https://plugins.gradle.org/m2/' }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.1.3' classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath 'org.jmailen.gradle:kotlinter-gradle:3.3.0' classpath 'org.jmailen.gradle:kotlinter-gradle:3.3.0'

View File

@ -0,0 +1,6 @@
object AndroidConfig {
const val compileSdk = 30
const val minSdk = 21
const val targetSdk = 29
const val buildTools = "30.0.3"
}

View File

@ -1,6 +0,0 @@
object Config {
const val compileSdk = 29
const val minSdk = 16
const val targetSdk = 29
const val buildTools = "29.0.3"
}

View File

@ -0,0 +1,9 @@
object Dependencies {
object kotlin {
const val version = "1.4.32"
const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$version"
}
const val jsoup = "org.jsoup:jsoup:1.13.1"
const val okhttp = "com.squareup.okhttp3:okhttp:4.9.1"
}

View File

@ -7,12 +7,12 @@ dependencies {
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compileOnly 'com.github.inorichi.injekt:injekt-core:65b0440' compileOnly 'com.github.inorichi.injekt:injekt-core:65b0440'
compileOnly 'com.squareup.okhttp3:okhttp:3.10.0' compileOnly 'com.squareup.okhttp3:okhttp:4.9.1'
compileOnly 'io.reactivex:rxjava:1.3.6' compileOnly 'io.reactivex:rxjava:1.3.8'
compileOnly 'org.jsoup:jsoup:1.10.2' compileOnly 'org.jsoup:jsoup:1.13.1'
compileOnly 'com.google.code.gson:gson:2.8.2' compileOnly 'com.google.code.gson:gson:2.8.6'
compileOnly 'com.github.salomonbrys.kotson:kotson:2.5.0' compileOnly 'com.github.salomonbrys.kotson:kotson:2.5.0'
implementation project(":annotations") implementation project(":annotations")
compileOnly project(':duktape-stub') compileOnly project(':duktape-stub')
} }

View File

@ -1,8 +1,8 @@
apply plugin: 'org.jmailen.kotlinter' apply plugin: 'org.jmailen.kotlinter'
android { android {
compileSdkVersion Config.compileSdk compileSdkVersion AndroidConfig.compileSdk
buildToolsVersion Config.buildTools buildToolsVersion AndroidConfig.buildTools
buildTypes { buildTypes {
release { release {
@ -25,8 +25,8 @@ android {
} }
defaultConfig { defaultConfig {
minSdkVersion Config.minSdk minSdkVersion AndroidConfig.minSdk
targetSdkVersion Config.targetSdk targetSdkVersion AndroidConfig.targetSdk
applicationIdSuffix pkgNameSuffix applicationIdSuffix pkgNameSuffix
versionCode extVersionCode versionCode extVersionCode
versionName "$libVersion.$extVersionCode" versionName "$libVersion.$extVersionCode"

View File

@ -3,10 +3,11 @@ plugins {
} }
android { android {
compileSdkVersion(Config.compileSdk) compileSdkVersion(AndroidConfig.compileSdk)
buildToolsVersion(AndroidConfig.buildTools)
defaultConfig { defaultConfig {
minSdkVersion(Config.minSdk) minSdkVersion(AndroidConfig.minSdk)
} }
sourceSets { sourceSets {

View File

@ -9,7 +9,7 @@
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m org.gradle.jvmargs=-Xmx3072m
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. More details, visit

View File

@ -4,12 +4,12 @@ plugins {
} }
android { android {
compileSdkVersion(Config.compileSdk) compileSdkVersion(AndroidConfig.compileSdk)
buildToolsVersion(Config.buildTools) buildToolsVersion(AndroidConfig.buildTools)
defaultConfig { defaultConfig {
minSdkVersion(Config.minSdk) minSdkVersion(AndroidConfig.minSdk)
targetSdkVersion(Config.targetSdk) targetSdkVersion(AndroidConfig.targetSdk)
} }
} }
@ -18,7 +18,7 @@ repositories {
} }
dependencies { dependencies {
compileOnly(Deps.kotlin.stdlib) compileOnly(Dependencies.kotlin.stdlib)
compileOnly(Deps.okhttp) compileOnly(Dependencies.okhttp)
compileOnly(Deps.jsoup) compileOnly(Dependencies.jsoup)
} }

View File

@ -2,10 +2,10 @@ package eu.kanade.tachiyomi.lib.dataimage
import android.util.Base64 import android.util.Base64
import okhttp3.Interceptor import okhttp3.Interceptor
import okhttp3.MediaType import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.Protocol import okhttp3.Protocol
import okhttp3.Response import okhttp3.Response
import okhttp3.ResponseBody import okhttp3.ResponseBody.Companion.toResponseBody
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
/** /**
@ -43,7 +43,7 @@ class DataImageInterceptor : Interceptor {
private val mediaTypePattern = Regex("""(^[^;,]*)[;,]""") private val mediaTypePattern = Regex("""(^[^;,]*)[;,]""")
override fun intercept(chain: Interceptor.Chain): Response { override fun intercept(chain: Interceptor.Chain): Response {
val url = chain.request().url().toString() val url = chain.request().url.toString()
return if (url.startsWith("https://127.0.0.1/?image")) { return if (url.startsWith("https://127.0.0.1/?image")) {
val dataString = url.substringAfter("?") val dataString = url.substringAfter("?")
val byteArray = if (dataString.contains("base64")) { val byteArray = if (dataString.contains("base64")) {
@ -51,8 +51,8 @@ class DataImageInterceptor : Interceptor {
} else { } else {
dataString.substringAfter(",").toByteArray() dataString.substringAfter(",").toByteArray()
} }
val mediaType = MediaType.parse(mediaTypePattern.find(dataString)!!.value) val mediaType = mediaTypePattern.find(dataString)!!.value.toMediaTypeOrNull()
Response.Builder().body(ResponseBody.create(mediaType, byteArray)) Response.Builder().body(byteArray.toResponseBody(mediaType))
.request(chain.request()) .request(chain.request())
.protocol(Protocol.HTTP_1_0) .protocol(Protocol.HTTP_1_0)
.code(200) .code(200)

View File

@ -4,12 +4,12 @@ plugins {
} }
android { android {
compileSdkVersion(Config.compileSdk) compileSdkVersion(AndroidConfig.compileSdk)
buildToolsVersion(Config.buildTools) buildToolsVersion(AndroidConfig.buildTools)
defaultConfig { defaultConfig {
minSdkVersion(Config.minSdk) minSdkVersion(AndroidConfig.minSdk)
targetSdkVersion(Config.targetSdk) targetSdkVersion(AndroidConfig.targetSdk)
} }
} }
@ -18,6 +18,6 @@ repositories {
} }
dependencies { dependencies {
compileOnly(Deps.kotlin.stdlib) compileOnly(Dependencies.kotlin.stdlib)
compileOnly(Deps.okhttp) compileOnly(Dependencies.okhttp)
} }

View File

@ -11,8 +11,8 @@ import java.util.concurrent.TimeUnit
* *
* Examples: * Examples:
* *
* httpUrl = Httpurl.parse("api.manga.com"), permits = 5, period = 1, unit = seconds => 5 requests per second to api.manga.com * httpUrl = "api.manga.com".toHttpUrlOrNull(), permits = 5, period = 1, unit = seconds => 5 requests per second to api.manga.com
* httpUrl = Httpurl.parse("imagecdn.manga.com"), permits = 10, period = 2, unit = minutes => 10 requests per 2 minutes to imagecdn.manga.com * httpUrl = "imagecdn.manga.com".toHttpUrlOrNull(), permits = 10, period = 2, unit = minutes => 10 requests per 2 minutes to imagecdn.manga.com
* *
* @param httpUrl {HttpUrl} The url host that this interceptor should handle. Will get url's host by using HttpUrl.host() * @param httpUrl {HttpUrl} The url host that this interceptor should handle. Will get url's host by using HttpUrl.host()
* @param permits {Int} Number of requests allowed within a period of units. * @param permits {Int} Number of requests allowed within a period of units.
@ -28,10 +28,10 @@ class SpecificHostRateLimitInterceptor(
private val requestQueue = ArrayList<Long>(permits) private val requestQueue = ArrayList<Long>(permits)
private val rateLimitMillis = unit.toMillis(period) private val rateLimitMillis = unit.toMillis(period)
private val host = httpUrl.host() private val host = httpUrl.host
override fun intercept(chain: Interceptor.Chain): Response { override fun intercept(chain: Interceptor.Chain): Response {
if (chain.request().url().host() != host) { if (chain.request().url.host != host) {
return chain.proceed(chain.request()) return chain.proceed(chain.request())
} }
synchronized(requestQueue) { synchronized(requestQueue) {