Skip to content

Commit

Permalink
Merge remote-tracking branch 'j2k/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/ISSUE_TEMPLATE.md
#	.github/ISSUE_TEMPLATE/feature_request.yml
#	.github/ISSUE_TEMPLATE/issue_report.yml
#	app/src/main/java/eu/kanade/tachiyomi/ui/source/globalsearch/GlobalSearchPresenter.kt
#	app/src/main/res/values-ar/strings.xml
#	app/src/main/res/values-fil/strings.xml
#	app/src/main/res/values-in/strings.xml
  • Loading branch information
Saud-97 committed Apr 20, 2023
2 parents d75ae56 + 21a2705 commit 44e247a
Show file tree
Hide file tree
Showing 153 changed files with 2,463 additions and 2,074 deletions.
109 changes: 109 additions & 0 deletions .github/ISSUE_TEMPLATE/beta_issue_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: 🐛 Beta Issue report
description: Report an issue or bug in the beta version of TachiyomiJ2K
labels: [beta bug]
body:

- type: textarea
id: reproduce-steps
attributes:
label: Steps to reproduce
description: Provide an example of the issue.
placeholder: |
Example:
1. First step
2. Second step
3. Issue here
validations:
required: true

- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: Explain what you should expect to happen.
placeholder: |
Example:
"This should happen..."
validations:
required: true

- type: textarea
id: actual-behavior
attributes:
label: Actual behavior
description: Explain what actually happens.
placeholder: |
Example:
"This happened instead..."
validations:
required: true

- type: textarea
id: crash-logs
attributes:
label: Crash logs
description: |
If you're experiencing crashes, share the crash logs from **More → Settings → Advanced** then press **Dump crash logs**.
placeholder: |
You can paste the crash logs in pure text or upload it as an attachment.
- type: input
id: tachiyomi-version
attributes:
label: TachiyomiJ2K version
description: You can find your TachiyomiJ2K version in **More → About**.
placeholder: |
Example: "1.7.0-b01"
validations:
required: true

- type: input
id: android-version
attributes:
label: Android version
description: You can find this somewhere in your Android settings.
placeholder: |
Example: "Android 14"
validations:
required: true

- type: input
id: device
attributes:
label: Device
description: List your device and model.
placeholder: |
Example: "Google Pixel 7"
validations:
required: true

- type: textarea
id: other-details
attributes:
label: Other details
placeholder: |
Additional details and attachments.
- type: checkboxes
id: acknowledgements
attributes:
label: Acknowledgements
description: Read this carefully, we will close and ignore your issue if you skimmed through this.
options:
- label: I have searched the existing issues and this is a new ticket, **NOT** a duplicate or related to another open issue.
required: true
- label: I have written a short but informative title.
required: true
- label: If this is an issue with an extension, I should be opening an issue in the [extensions repository](https://github.com/tachiyomiorg/tachiyomi-extensions/issues/new/choose).
required: true
- label: I am reporting an issue exclusive to this fork. I have also checked that is not an issue on the [main version of Tachiyomi](https://github.com/tachiyomiorg/tachiyomi)
required: true
- label: I have tried the [troubleshooting guide](https://tachiyomi.org/help/guides/troubleshooting/).
required: true
- label: I have updated the app to beta version **[1.7.0-b02](https://github.com/Jays2Kings/tachiyomiJ2K/releases)**.
required: true
- label: I have updated all installed extensions.
required: true
- label: I have admitted that I am a clown by having checked this box, as I have not read these acknowledgements.
- label: I have filled out all of the requested information in this form.
required: true
2 changes: 1 addition & 1 deletion .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
all_but_latest: true
Expand Down
36 changes: 16 additions & 20 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
id(Plugins.kotlinSerialization)
id("com.google.android.gms.oss-licenses-plugin")
id(Plugins.googleServices) apply false
id("com.google.firebase.crashlytics")
}

if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
Expand Down Expand Up @@ -43,7 +44,7 @@ android {
multiDexEnabled = true

buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
buildConfigField("String", "BETA_COMMIT_COUNT", "\"${getCommitCountSinceLastRelease()}\"")
buildConfigField("String", "BETA_COUNT", "\"${getBetaCount()}\"")
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
buildConfigField("Boolean", "INCLUDE_UPDATER", "false")
Expand Down Expand Up @@ -83,8 +84,7 @@ android {
create("beta") {
initWith(getByName("release"))
buildConfigField("boolean", "BETA", "true")

versionNameSuffix = "-b${getCommitCountSinceLastRelease()}"
versionNameSuffix = "-b${getBetaCount()}"
}
}

Expand Down Expand Up @@ -155,24 +155,28 @@ dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.cardview:cardview:1.0.0")
implementation("com.google.android.material:material:1.8.0")
implementation("androidx.webkit:webkit:1.6.0")
implementation("androidx.recyclerview:recyclerview:1.2.1")
implementation("androidx.webkit:webkit:1.6.1")
implementation("androidx.recyclerview:recyclerview:1.3.0")
implementation("androidx.preference:preference:1.2.0")
implementation("androidx.annotation:annotation:1.5.0")
implementation("androidx.annotation:annotation:1.6.0")
implementation("androidx.browser:browser:1.5.0")
implementation("androidx.biometric:biometric:1.1.0")
implementation("androidx.palette:palette:1.0.0")
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1")
implementation("androidx.activity:activity-ktx:1.7.0")
implementation("androidx.core:core-ktx:1.10.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
implementation("com.google.android.flexbox:flexbox:3.0.0")
implementation("androidx.window:window:1.0.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")

implementation("androidx.constraintlayout:constraintlayout:2.1.4")

implementation("androidx.multidex:multidex:2.0.1")

implementation("com.google.firebase:firebase-core:21.1.0")
implementation("com.google.firebase:firebase-analytics-ktx:21.1.0")
implementation(platform("com.google.firebase:firebase-bom:31.2.3"))

implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-crashlytics-ktx")

val lifecycleVersion = "2.5.1"
kapt("androidx.lifecycle:lifecycle-compiler:$lifecycleVersion")
Expand All @@ -183,7 +187,6 @@ dependencies {
implementation("io.reactivex:rxandroid:1.2.1")
implementation("io.reactivex:rxjava:1.3.8")
implementation("com.jakewharton.rxrelay:rxrelay:1.2.0")
implementation("com.github.pwittchen:reactivenetwork:0.13.0")

// Coroutines
implementation("com.fredporciuncula:flow-preferences:1.6.0")
Expand Down Expand Up @@ -226,12 +229,9 @@ dependencies {

implementation("com.google.android.gms:play-services-gcm:17.0.0")

// Changelog
implementation("com.github.gabrielemariotti.changeloglib:changelog:2.1.0")

// Database
implementation("androidx.sqlite:sqlite-ktx:2.2.0")
implementation("com.github.requery:sqlite-android:3.36.0")
implementation("androidx.sqlite:sqlite-ktx:2.3.0")
implementation("com.github.requery:sqlite-android:3.39.2")
implementation("com.github.inorichi.storio:storio-common:8be19de@aar")
implementation("com.github.inorichi.storio:storio-sqlite:8be19de@aar")

Expand Down Expand Up @@ -263,7 +263,6 @@ dependencies {
implementation("com.mikepenz:fastadapter-extensions-binding:$fastAdapterVersion")
implementation("com.github.arkon.FlexibleAdapter:flexible-adapter:c8013533")
implementation("com.github.arkon.FlexibleAdapter:flexible-adapter-ui:c8013533")
implementation("com.nononsenseapps:filepicker:2.5.2")
implementation("com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0")
implementation("com.github.mthli:Slice:v1.2")
implementation("io.noties.markwon:core:4.6.2")
Expand All @@ -289,9 +288,6 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines")

// Crash reports
implementation("ch.acra:acra-http:5.9.3")

// Text distance
implementation("info.debatty:java-string-similarity:2.0.0")

Expand Down
4 changes: 0 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@
android:configChanges="uiMode|orientation|screenSize"/>
<activity
android:name=".ui.security.BiometricActivity" />
<activity
android:name=".widget.CustomLayoutPickerActivity"
android:label="@string/app_name"
android:theme="@style/FilePickerTheme" />
<activity
android:name=".ui.setting.track.MyAnimeListLoginActivity"
android:label="MyAnimeList"
Expand Down
31 changes: 6 additions & 25 deletions app/src/main/java/eu/kanade/tachiyomi/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.ProcessLifecycleOwner
import androidx.lifecycle.lifecycleScope
import androidx.multidex.MultiDex
import eu.kanade.tachiyomi.appwidget.TachiyomiWidgetManager
import eu.kanade.tachiyomi.data.image.coil.CoilSetup
import eu.kanade.tachiyomi.data.notification.Notifications
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
Expand All @@ -26,14 +27,11 @@ import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate
import eu.kanade.tachiyomi.ui.source.SourcePresenter
import eu.kanade.tachiyomi.util.manga.MangaCoverMetadata
import eu.kanade.tachiyomi.util.system.AuthenticatorUtil
import eu.kanade.tachiyomi.util.system.launchIO
import eu.kanade.tachiyomi.util.system.localeContext
import eu.kanade.tachiyomi.util.system.notification
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import org.acra.ACRA
import org.acra.config.httpSender
import org.acra.data.StringFormat
import org.acra.ktx.initAcra
import org.conscrypt.Conscrypt
import timber.log.Timber
import uy.kohesive.injekt.Injekt
Expand All @@ -42,13 +40,6 @@ import uy.kohesive.injekt.injectLazy
import uy.kohesive.injekt.registry.default.DefaultRegistrar
import java.security.Security

// @ReportsCrashes(
// formUri = "https://collector.tracepot.com/e90773ff",
// reportType = org.acra.sender.HttpSender.Type.JSON,
// httpMethod = org.acra.sender.HttpSender.Method.PUT,
// buildConfigClass = BuildConfig::class,
// excludeMatchingSharedPreferencesKeys = [".*username.*", ".*password.*", ".*token.*"]
// )
open class App : Application(), DefaultLifecycleObserver {

val preferences: PreferencesHelper by injectLazy()
Expand All @@ -75,7 +66,6 @@ open class App : Application(), DefaultLifecycleObserver {
Injekt.importModule(AppModule(this))

CoilSetup(this)
setupAcra()
setupNotificationChannels()

ProcessLifecycleOwner.get().lifecycle.addObserver(this)
Expand All @@ -85,6 +75,10 @@ open class App : Application(), DefaultLifecycleObserver {
.asImmediateFlow { AppCompatDelegate.setDefaultNightMode(it) }
.launchIn(ProcessLifecycleOwner.get().lifecycleScope)

ProcessLifecycleOwner.get().lifecycleScope.launchIO {
with(TachiyomiWidgetManager()) { this@App.init() }
}

// Show notification to disable Incognito Mode when it's enabled
preferences.incognitoMode().asFlow()
.onEach { enabled ->
Expand Down Expand Up @@ -134,19 +128,6 @@ open class App : Application(), DefaultLifecycleObserver {
SourcePresenter.onLowMemory()
}

protected open fun setupAcra() {
initAcra {
reportFormat = StringFormat.JSON
buildConfigClass = BuildConfig::class.java
excludeMatchingSharedPreferencesKeys = listOf(".*username.*", ".*password.*", ".*token.*")
httpSender {
uri = "https://collector.tracepot.com/e90773ff"
httpMethod = org.acra.sender.HttpSender.Method.PUT
}
}
ACRA.init(this)
}

protected open fun setupNotificationChannels() {
Notifications.createChannels(this)
}
Expand Down
10 changes: 7 additions & 3 deletions app/src/main/java/eu/kanade/tachiyomi/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ class AppModule(val app: Application) : InjektModule {

addSingletonFactory { JavaScriptEngine(app) }

addSingletonFactory { SourceManager(app).also { get<ExtensionManager>().init(it) } }

addSingletonFactory { SourceManager(app, get()) }
addSingletonFactory { ExtensionManager(app) }

addSingletonFactory { DownloadManager(app) }
Expand All @@ -49,7 +48,12 @@ class AppModule(val app: Application) : InjektModule {

addSingletonFactory { TrackManager(app) }

addSingletonFactory { Json { ignoreUnknownKeys = true } }
addSingletonFactory {
Json {
ignoreUnknownKeys = true
explicitNulls = false
}
}

addSingletonFactory { ChapterFilter() }

Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/eu/kanade/tachiyomi/Migrations.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import eu.kanade.tachiyomi.extension.ExtensionUpdateJob
import eu.kanade.tachiyomi.network.PREF_DOH_CLOUDFLARE
import eu.kanade.tachiyomi.ui.library.LibraryPresenter
import eu.kanade.tachiyomi.ui.reader.settings.OrientationType
import eu.kanade.tachiyomi.ui.recents.RecentsPresenter
import eu.kanade.tachiyomi.util.system.launchIO
import eu.kanade.tachiyomi.util.system.toast
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -209,6 +210,12 @@ object Migrations {
preferences.autoDownloadWhileReading().set(max(2, oldDLAfterReading))
}
}
if (oldVersion < 102) {
val oldGroupHistory = prefs.getBoolean("group_chapters_history", true)
if (!oldGroupHistory) {
preferences.groupChaptersHistory().set(RecentsPresenter.GroupType.Never)
}
}

return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class ChapterCache(private val context: Context) {
*/
fun isImageInCache(imageUrl: String): Boolean {
return try {
diskCache.get(DiskUtil.hashKeyForDisk(imageUrl)) != null
diskCache.get(DiskUtil.hashKeyForDisk(imageUrl)).use { it != null }
} catch (e: IOException) {
false
}
Expand Down Expand Up @@ -217,12 +217,12 @@ class ChapterCache(private val context: Context) {
editor = diskCache.edit(key) ?: throw IOException("Unable to edit key")

// Get OutputStream and write image with Okio.
response.body!!.source().saveTo(editor.newOutputStream(0))
response.body.source().saveTo(editor.newOutputStream(0))

diskCache.flush()
editor.commit()
} finally {
response.body?.close()
response.body.close()
editor?.abortUnlessCommitted()
}
}
Expand Down
Loading

0 comments on commit 44e247a

Please sign in to comment.