* Implemented local cover encryption and made coil capable of reading encrypted cover archives
* add check that the file is not an image before determining that it is a zip file
Issues:
- Apache implementation relies on methods unavailable on lower Android API levels
- Using input stream implementation doesn't seem to read some files properly, but using
ZipFile implementation still requires reading the entire thing into memory
(cherry picked from commit 6f59c6c6bb12f1ef123abd418001c7a86d43ef7a)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt
I feel like this needs to be aligned with the browse screen/deduped somehow, but that can happen separately.
Fixes#9444
(cherry picked from commit 1b25290d399037fe2d9744a899f86ca128699f8e)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SourceSearchScreen.kt
Fetch each source image URL immediately before downloading each image
instead of fetching all URLs and then downloading all images.
Source image URLs may change, so the downloader may fail if there is
too long a delay between fetching the image URL and downloading the
image.
(cherry picked from commit bbe0ab1dd0b51bcb91ff0a7f78555b078d73201e)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt
Closes#9255, sort of. The example is a bad edge case though, where chapter numbers are repeated across versions,
so realistically only the first 113 will appear but the later 113(s) won't despite being "different". Those realistically
should be in different manga entries, not all mixed together, so this is just a crappy source.
(cherry picked from commit 9339ea41962c5a8d8317eb973b25b7dc39b15843)
- It changes the columns based on the current orientation
(cherry picked from commit 7451c13edd8486dd690bf7a2a55c3372b26061c4)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/library/LibrarySettingsDialog.kt
* added chapter swipe
* Rework corner animtion
* Update i18n/src/main/res/values/strings.xml
Co-authored-by: arkon <arkon@users.noreply.github.com>
* Replace LTR/RTL with Start/End layout
* Added label to the animation so the warning will go away
* Getting rid of the swipe threshold setting
* adding disabled option, renaming stuff, other stuff?
* Getting rid of the snackbar
* Getting rid of unecessary strings
* changing enum names as requested
* Renaming Raio to Ratio (I need a better keyboard as well -__-)
* Replacing error with download icon and action
* backup
* minor cleanup
* fixing an nasty edge case
* fixing mistakes in the previous conflict
* space
* fixing bug
fixed bug where the user could dismiss already dismissed item leading to item getting stuck
* fixing lint errors
* fixing lints (hopefully)
* Added "swipe disabled" to the list of actions
* Replacing string value and moving value as requested
* replacing rest of the strings with generic ones
---------
Co-authored-by: arkon <arkon@users.noreply.github.com>
(cherry picked from commit a8f17a3fabae7070a353661873c7a5ae1ae23eca)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt
# app/src/main/java/eu/kanade/presentation/manga/components/MangaChapterListItem.kt
# app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsLibraryScreen.kt
# domain/src/main/java/tachiyomi/domain/library/service/LibraryPreferences.kt
* Extract downloaded archives to tmp folder when loading for viewing
* Generate sequence of entries from ZipInputStream instead of loading entire ZipFile
(cherry picked from commit 44619febd333f4e662cdbf149ae0741a43ebd27b)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt
* change the directory's name for a download when the chapter's name is only composed of numbers or is blank
* maj in case the chapter name is blank or empty
* clean code
(cherry picked from commit 41cc1fe7237a52c830e87c8261254b7f59922a6b)
* App version
* WebView version
* ART profile status
* Device model
* Android version
(cherry picked from commit 2c6e02506363496a183f2ecb7b50382a1544e94e)
* Initial Implementation of encrypted CBZ archives
* changed a preference key to correct Syntax, changed a function name and changed ComicInfo padding length
* Update app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSecurityScreen.kt
Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
* Update app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSecurityScreen.kt
Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
* add necessary imports
* fix indentation after merge conflict
* Update app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSecurityScreen.kt
Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
* fix indentation and add imports
* collect preferences as states
* test if password is correct in ZipPageLoader
* added withIOContext to function call
* added encryption type preference
* implemented database encryption
* added proguard rules for sqlcipher and generate padding length with SecureRandom
---------
Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
No need to translate anything for debug info. Dunno what else will end up in that menu in the future.
(cherry picked from commit 4bcd6238293e0583cdcc082711128358c5ae2069)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt
* fix: skip duplicate chapters on download ahead if option is enabled
* fix: Use a function to filter duplicates
(cherry picked from commit 4816b4b53afa6db5dfaa2b023a4896e31425f97c)
Apparently they die if you rename a worker class.
(cherry picked from commit d25ba23079e72d1cff05bfcd00b5f9830a086821)
# Conflicts:
# app/build.gradle.kts
Update ReaderPageImageView.kt
"true center" Zoom start position #8747.
Changed zoom position to get true center value.
(cherry picked from commit 274218cf228f5dfade2a11f053bb4fe1a7d11ed8)
* Show soft keyboard when the text field is composed (a redo)
* Clear focus on text field when soft keyboard is hidden
* Request focus on text field and show soft keyboard
when clear button is clicked
(cherry picked from commit 7a1b599462498f6be8faf08cbd2814a04863f3ef)
Because of Compose issue, the style of the sheet surface is adjusted as
a workaround
Ref https://issuetracker.google.com/issues/246909281
(cherry picked from commit 6f1099b7103ab7838e999e787f4e81344978a091)
Not sure if this is an ideal approach. If it is, we could migrate more usages to this.
(cherry picked from commit 18f9e5ba6b080a74805db553e22f15412ddeab12)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreenModel.kt
This was effectively DDoSing sources as it does a request for every entry to get the details (primarily a cover image).
The expectation now is that users have to open individual entries to load the details/cover if needed.
This isn't necessary for most sources, which are able to provide covers as part of the listing normally.
(cherry picked from commit 1a61130f0b46addef036687b6c98f930e13147f8)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreenModel.kt
Although we don't even target it yet and don't prompt for it but whatever, less work in the future.
(cherry picked from commit 1de4bc95865a5eb6491db79c413d98e05e8545e3)
* Drop duplicate initial call in Preference.asHotFlow
Preference.changes() always starts by returning the current value of
the preference, so asHotFlow calls block twice on the initial value.
Possible breaking change: As implemented, asHotFlow ran block(get())
before returning the flow. After this change, the first call to block
will run within the flow collection. This might cause concurrency
issues if the flow collection is late to execute.
* Inline Preference.asHotFlow
The Preference.changes().onEach().launchIn() pattern is used widely,
so the asHotFlow extension method is redundant.
(cherry picked from commit 35d381144d010be47566ee480c311c3d13952822)
This partially reverts commit 2769525b2c12547b8dc29b1209ea3bc5d22f1e3f.
Keeps the change to silently ignore spliting errors since it falls back to
the original images in those cases.
(cherry picked from commit ac0596a53d74561ad5174db1938c16049a65dd18)
Now behaves like the non-compose indicator by showing the swipe progress too
(cherry picked from commit 18e55aa25fe7ea63e66a99d1373fbdb449a358d7)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/library/components/LibraryTabs.kt
# presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Tabs.kt
TachiyomiSY's APK didn't have this suffix.
The code now causes the corresponding architecture impossible to find, which leads to downloading the APK for arm64 when updating from x86_64.
Users can still select all the chapters (long press + select all) to download them.
(cherry picked from commit 09acc534835d6aa664b037b54401a817ed44fb45)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/library/LibrarySettingsDialog.kt
Jetpack Compose treats mouse input differently than just mimicking a touch input, so dragging doesn't actually
invoke the pull to refresh. If that changes in the future, we could consider removing these.
Doesn't seem too necessary for the extensions list, so I skipped that.
Closes#8455
(cherry picked from commit f03a83413689923633c8ebe5634b34c566733961)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/manga/components/MangaToolbar.kt
Downloader.stop is now the sole responsible for stopping the
DownloadService. This will help cleanly removing
DownloadService.stop when migrating to coroutines.
(cherry picked from commit 0505906e7a554abe6bbbc2c1cd4a6bfaa9407bf6)
This is most likely Compose issue so these changes will
be reevaluated when new Compose ver is out.
(cherry picked from commit 63048d2f0b57477aecb4fd91f1f8c20a66ec9e18)
* Rename functions for DownloadService internal use
* Call DownloadService.start via DownloadManager
* Inline DownloadService.stop into pauseDownloads
* Inline DownloadService.stop into clearQueue
NotificationReceiver will now also stop the DownloadService when
receiving ACTION_CLEAR_DOWNLOADS.
* Provide DownloadService.isRunning via DownloadManager
(cherry picked from commit 86b9262a7ef6c4e97f248bdf417b0e06503fefac)
1:1 translation from the RxJava implementation, should match the
previous behavior.
Dropped the return value from functions of the form
```
fun foo(t: T, ...): Observable<T>
```
where the Observable produced the original argument `t`.
The caller already has the result if necessary.
While this conversion is not flow-based overall, some sections use
flows to use the flatMapMerge and retryWhen operators.
Removed RetryWithDelay as it was only used here.
Inlined fetchAllImageUrlsFromPageList instead of converting it to a
suspending equivalent. fetchAllImageUrlsFromPageList is no longer
used in the app, but was not removed as it is part of source-api.
(However, it does not seem to be used exposed in extensions-lib or
used in tachiyomi-extensions.)
runBlocking is used as a temporary stop-gap.
(cherry picked from commit fa61c8fe6fb4966f5d23f643759f0e4229b8f016)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt
When restarting a download, the page count would display as 0 until
the first page download completion, after all the existing pages were
rechecked.
To fix, calculate downloadedImages from pages instead of relying on
the downloader to reset and increment the count.
(cherry picked from commit 779df32e98f2a020ca6a4f79c0748dd9f5b16873)
Includes side effects:
- No longer need to restart app for user agent string change to take effect
- parseAs extension function requires a Json instance in the calling context, which doesn't necessarily need to be the default one provided by Injekt
(cherry picked from commit 93523ef50b80ef294866bfb0da54e236cdf2d9f6)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt
# app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt
# core/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt
# core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt
# domain/build.gradle.kts
# source-api/build.gradle.kts
Inline readImageHeaderSubscription in PageHolder
Inline readImageHeaderSubscription in PagerPageHolder and
WebtoonPageHolder by converting setImage() into a suspend function.
The image processing runs in the loadPageAndProcessStatus
continuation.
Use suspendCancellableCoroutine as a substitute for doOnUnsubscribe
in WebtoonPageHolder.
Closing openStream after the frame.setImage but before the PageHolder
is recycled causes the page display to fail for reasons that are not
currently understood.
Remove subscription handling from WebtoonViewer/WebtoonBaseHolder as
it is no longer used.
(cherry picked from commit ffa8c8fd0746863e08b839f9d91102fe6d5d7887)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt
Inline statusJob into loadJob, using supervisorScope to load the page
and track status changes in parallel.
- supervisorScope does not complete until both the child loadPage
coroutine and statusFlow.collectLatest have completed.
- Cancelling supervisorScope cancels the child loadPage coroutine and
statusFlow.collectLatest.
- Use supervisorScope instead of coroutineScope to let status
collection continue if loadPage fails.
Inline progressJob into loadJob, using collectLatest's cancellation
to avoid cancelling the progressFlow collection explicitly.
- collectLatest cancels the previous action block when the flow
emits a new value. This means the DOWNLOAD_IMAGE
progressFlow.collectLatest gets automatically cancelled when
statusFlow emits a new state.
Convert launchLoadJob to suspend function, move job launch to caller,
and rename as loadPageAndProcessStatus.
(cherry picked from commit 4635e58405eedce0b49fc69f7ccb190a7c600da9)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt
* Rework the wheel picker
doesn't need for the animation to stop to change the value
* fix
---------
Co-authored-by: arkon <arkon@users.noreply.github.com>
(cherry picked from commit be4072c86b9251bb7110f873c9332a2890ca69ef)
# Conflicts:
# .github/renovate.json
# app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsLibraryScreen.kt
Same reasoning as removing app update check. It gets kicked off in the foreground now too.
(cherry picked from commit 2970eca9e4b56ede7549eb6d49841b7011fe0741)
# Conflicts:
# app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBrowseScreen.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
We already check in the foreground. If the app isn't being foregrounded at all, then there isn't much
point in checking for an update.
(cherry picked from commit 42954609b94e13d8fadbf1f3769e9f32fa9e8447)
# Conflicts:
# app/build.gradle.kts
# app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateJob.kt
* Move LibraryItem vars to constructor vals
* Convert LibraryItem to data class
Remove redundant equals and hashCode
* Remove unused LibraryItem.displayMode
* Simplify LibraryItem.matches()
* Align types in LibraryItem and LibraryBadges
* fixup! Simplify LibraryItem.matches()
(cherry picked from commit 7b118eba22b6c9caccf09cbd53f846869d5c6f2a)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt
Simplifies things and maybe discourages whacky downloading behavior?
Users can still range select in the chapters list to download custom amounts.
(cherry picked from commit f6e6a7ddf1d32a55da81344b1ae360e16e5560e4)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt
No more trampolining, and stuff.
It's pretty much straight copy-paste from the service, with
some changes related to cancellation handling. Manual updates
will also runs with workman job so auto update work
scheduling need some adjustments too.
Bumped version code to re-enqueue auto update job with the
new spec.
Co-authored-by: arkon <arkon@users.noreply.github.com>
(cherry picked from commit ef9dacde79b1803ec117aae4ea948194b6394605)
# Conflicts:
# app/build.gradle.kts
# app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt
# app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt
* Misc cleanup
- Replace !List.isEmpty with List.isNotEmpty
- Remove redundant case in MoreScreenModel
- Drop no-op StateFlow.catch
- From lint warning:
> SharedFlow never completes, so this operator typically has not
> effect, it can only catch exceptions from 'onSubscribe' operator
* Convert DownloadQueue queue to MutableStateFlow
Replace delegation to a MutableList with an internal
MutableStateFlow<List>.
In order to avoid modifying every usage of the queue as a list, add
passthrough functions for the currently used list functions. This
should be later refactored, possibly by inlining DownloadQueue
into Downloader.
DownloadQueue.updates was a SharedFlow which updated every time a
change was made to the queue. This is now equivalent to the queue
StateFlow.
Simultaneous assignments to _state.value could cause concurrency
issues. To avoid this, always modify the queue using _state.update.
* Add Download.statusFlow/progressFlow
progressFlow is based on the DownloadQueueScreenModel implementation
rather than the DownloadQueue implementation.
* Reimplement DownloadQueue.statusFlow/progressFlow
Use StateFlow<List<T>>.flatMapLatest() and List<Flow<T>>.merge() to
replicate the effect of PublishSubject.
Use drop(1) to avoid re-emitting the state of each download each time
the merged flow is recreated.
* fixup! Reimplement DownloadQueue.statusFlow/progressFlow
(cherry picked from commit bd2cb97179de60dded147f1ec9cdb55f70f28e74)
* Show exception class in snackbar message
* omit IOException too
(cherry picked from commit 589bdba0b1538266b7786591046f88a1159cbb8c)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt
* Simplify DownloadService wake lock handling
_isRunning is only modified in onCreate/onDestroy, so the listener
job is redundant.
* Drop superclass calls to Service.onCreate/onDestroy
From https://developer.android.com/guide/components/services
> Note: Unlike the activity lifecycle callback methods, you are not
> required to call the superclass implementation of these callback
> methods.
(cherry picked from commit aca65f13bb94b6c0c4a77a9d426491d3667f4a7d)
Move Widget to seperate module
- Create a core module for presentation. Widget and App will share some resources and hopefully composables
(cherry picked from commit 12e41b6e6f3b5d95d19e1caa6c9fbe5eb6c9749c)
Fixes#8962.
withTimeout throws a TimeoutCancellationException if the timeout
expires. To avoid crashing renewalJob when there are no extensions,
use withTimeoutOrNull which does not throw on timeout.
(cherry picked from commit 3a82b4d924ae7207f7d1c1b23d2a71a1e7d09258)
Fixup for e4bc8990 (#8955)
HttpSource.fetchImage() uses Call.asObservableSuccess(), which
cancels the call on unsubscribe. This causes the call to be cancelled
before it is used, leading to a "java.net.SocketException: Socket is
closed" when trying to use the response in putImageToCache().
To fix this, use Call.awaitSuccess() via a new HttpSource.getImage()
suspending function. This addition to source-api is only intended for
app use, so it will not be added to the extensions-api stubs.
(cherry picked from commit b4b3a4d2869fae7839b4b3111e289056e33cfea8)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt
* Follow page status via StateFlow
Keep getPage subscription since it's needed to load the pages
* Replace PageLoader.getPage with PageLoader.loadPage
(cherry picked from commit 2ef1f07aaea0852c13a4eb4096ac96c8aa507c39)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt
To keep the commit from being 100+ files the interactors wasn't moved.
The domain module like the data module uses `tachiyomi` instead of `eu.kanade.tachiyomi` for package names
(cherry picked from commit d3a73fc22849a915483bea03fcd7c20834b1f4d8)
# Conflicts:
# app/src/main/java/eu/kanade/domain/category/interactor/SetSortModeForCategory.kt
# app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsLibraryScreen.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt
Fixes#8881
The actual issue is that the ViewModel migration actually differs between what the current `init` block
and previous `onSave` methods did; where the `init` block does not get triggered on saving the
instance on config changes.
Not entirely sure why onSaveInstanceState was explicitly avoided for config changes before, but we
just do it all the time now and end up updating the requestedPage with the current page.
(cherry picked from commit 2ebc8d9ae51f84b0f69dee603a5448a72013f734)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
* Make download function more clearer in manga screen
Maybe resolves#8879
* Minor cleanup
* Minor cleanup 2
(cherry picked from commit e28b0155801859f48a18bc1c5aacead54378c77f)
# Conflicts:
# app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt