Try Apache implementation of ZipFile instead

Docs: https://commons.apache.org/proper/commons-compress/
Related StackOverflow post: https://stackoverflow.com/a/54236244/4421500

Related to #9438

(cherry picked from commit c623258e8c289ecebb2a673fd118686ab56bd0bd)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt
This commit is contained in:
arkon
2023-05-03 14:00:33 -04:00
committed by Jobobby04
parent fe0f9f053b
commit 782b6dec02
6 changed files with 33 additions and 55 deletions
@@ -146,10 +146,12 @@ object CbzCrypto {
return decrypt(securityPreferences.sqlPassword().get(), ALIAS_SQL).toByteArray()
}
/** Function that returns true when the supplied password
* can Successfully decrypt the supplied zip archive */
// not very elegant but this is the solution recommended by the maintainer for checking passwords
// a real password check will likely be implemented in the future though
/**
* Function that returns true when the supplied password
* can Successfully decrypt the supplied zip archive
* not very elegant but this is the solution recommended by the maintainer for checking passwords
* a real password check will likely be implemented in the future though
*/
fun checkCbzPassword(zip4j: ZipFile, password: CharArray): Boolean {
try {
zip4j.setPassword(password)