mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 09:24:34 -05:00
move dex2jar to server, lint
This commit is contained in:
@@ -79,10 +79,6 @@ configure(projects) {
|
|||||||
// to get application content root
|
// to get application content root
|
||||||
implementation("net.harawata:appdirs:1.2.1")
|
implementation("net.harawata:appdirs:1.2.1")
|
||||||
|
|
||||||
// dex2jar: https://github.com/DexPatcher/dex2jar/releases/tag/v2.1-20190905-lanchon
|
|
||||||
// note: watch https://github.com/ThexXTURBOXx/dex2jar for future development
|
|
||||||
implementation("com.github.DexPatcher.dex2jar:dex-tools:v2.1-20190905-lanchon")
|
|
||||||
|
|
||||||
// APK parser
|
// APK parser
|
||||||
implementation("net.dongliu:apk-parser:2.6.10")
|
implementation("net.dongliu:apk-parser:2.6.10")
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ dependencies {
|
|||||||
implementation("com.github.salomonbrys.kotson:kotson:2.5.0")
|
implementation("com.github.salomonbrys.kotson:kotson:2.5.0")
|
||||||
|
|
||||||
|
|
||||||
|
// dex2jar: https://github.com/DexPatcher/dex2jar/releases/tag/v2.1-20190905-lanchon
|
||||||
|
// note: watch https://github.com/ThexXTURBOXx/dex2jar for future developments
|
||||||
|
implementation("com.github.DexPatcher.dex2jar:dex-tools:v2.1-20190905-lanchon")
|
||||||
|
|
||||||
// asm for fixing SimpleDateFormat (must match Dex2Jar version)
|
// asm for fixing SimpleDateFormat (must match Dex2Jar version)
|
||||||
implementation("org.ow2.asm:asm-debug-all:5.0.3")
|
implementation("org.ow2.asm:asm-debug-all:5.0.3")
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ interface SManga : Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//fun SManga.toMangaInfo(): MangaInfo {
|
// fun SManga.toMangaInfo(): MangaInfo {
|
||||||
// return MangaInfo(
|
// return MangaInfo(
|
||||||
// key = this.url,
|
// key = this.url,
|
||||||
// title = this.title,
|
// title = this.title,
|
||||||
@@ -73,9 +73,9 @@ interface SManga : Serializable {
|
|||||||
// status = this.status,
|
// status = this.status,
|
||||||
// cover = this.thumbnail_url ?: ""
|
// cover = this.thumbnail_url ?: ""
|
||||||
// )
|
// )
|
||||||
//}
|
// }
|
||||||
//
|
//
|
||||||
//fun MangaInfo.toSManga(): SManga {
|
// fun MangaInfo.toSManga(): SManga {
|
||||||
// val mangaInfo = this
|
// val mangaInfo = this
|
||||||
// return SManga.create().apply {
|
// return SManga.create().apply {
|
||||||
// url = mangaInfo.key
|
// url = mangaInfo.key
|
||||||
@@ -87,5 +87,4 @@ interface SManga : Serializable {
|
|||||||
// status = mangaInfo.status
|
// status = mangaInfo.status
|
||||||
// thumbnail_url = mangaInfo.cover
|
// thumbnail_url = mangaInfo.cover
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ package suwayomi.tachidesk.manga.impl.backup
|
|||||||
|
|
||||||
abstract class AbstractBackupValidator {
|
abstract class AbstractBackupValidator {
|
||||||
data class ValidationResult(val missingSources: List<String>, val missingTrackers: List<String>)
|
data class ValidationResult(val missingSources: List<String>, val missingTrackers: List<String>)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import suwayomi.tachidesk.manga.impl.backup.AbstractBackupValidator
|
|||||||
import suwayomi.tachidesk.manga.impl.backup.legacy.models.Backup
|
import suwayomi.tachidesk.manga.impl.backup.legacy.models.Backup
|
||||||
import suwayomi.tachidesk.manga.model.table.SourceTable
|
import suwayomi.tachidesk.manga.model.table.SourceTable
|
||||||
|
|
||||||
object LegacyBackupValidator: AbstractBackupValidator() {
|
object LegacyBackupValidator : AbstractBackupValidator() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks for critical backup file data.
|
* Checks for critical backup file data.
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
package suwayomi.tachidesk.manga.impl.backup.models
|
package suwayomi.tachidesk.manga.impl.backup.models
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
//import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
|
// import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
|
||||||
//import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType
|
// import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType
|
||||||
|
|
||||||
|
|
||||||
// substitute for eu.kanade.tachiyomi.ui.reader.setting.OrientationType
|
// substitute for eu.kanade.tachiyomi.ui.reader.setting.OrientationType
|
||||||
object OrientationType {
|
object OrientationType {
|
||||||
@@ -15,7 +14,6 @@ object ReadingModeType {
|
|||||||
const val MASK = 0x00000007
|
const val MASK = 0x00000007
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interface Manga : SManga {
|
interface Manga : SManga {
|
||||||
|
|
||||||
var id: Long?
|
var id: Long?
|
||||||
@@ -129,7 +127,7 @@ interface Manga : SManga {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//fun Manga.toMangaInfo(): MangaInfo {
|
// fun Manga.toMangaInfo(): MangaInfo {
|
||||||
// return MangaInfo(
|
// return MangaInfo(
|
||||||
// artist = this.artist ?: "",
|
// artist = this.artist ?: "",
|
||||||
// author = this.author ?: "",
|
// author = this.author ?: "",
|
||||||
@@ -140,4 +138,4 @@ interface Manga : SManga {
|
|||||||
// status = this.status,
|
// status = this.status,
|
||||||
// title = this.title
|
// title = this.title
|
||||||
// )
|
// )
|
||||||
//}
|
// }
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ open class MangaImpl : Manga {
|
|||||||
url = mangaRecord[MangaTable.url]
|
url = mangaRecord[MangaTable.url]
|
||||||
title = mangaRecord[MangaTable.title]
|
title = mangaRecord[MangaTable.title]
|
||||||
source = mangaRecord[MangaTable.sourceReference]
|
source = mangaRecord[MangaTable.sourceReference]
|
||||||
viewer_flags = 0 // TODO: implement
|
viewer_flags = 0 // TODO: implement
|
||||||
chapter_flags = 0 // TODO: implement
|
chapter_flags = 0 // TODO: implement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ open class ProtoBackupBase {
|
|||||||
var sourceMapping: Map<Long, String> = emptyMap()
|
var sourceMapping: Map<Long, String> = emptyMap()
|
||||||
|
|
||||||
val parser = ProtoBuf
|
val parser = ProtoBuf
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import suwayomi.tachidesk.manga.impl.backup.proto.models.Backup
|
|||||||
import suwayomi.tachidesk.manga.impl.backup.proto.models.BackupSerializer
|
import suwayomi.tachidesk.manga.impl.backup.proto.models.BackupSerializer
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
|
|
||||||
object ProtoBackupExport: ProtoBackupBase() {
|
object ProtoBackupExport : ProtoBackupBase() {
|
||||||
suspend fun createBackup(flags: BackupFlags): ByteArray {
|
suspend fun createBackup(flags: BackupFlags): ByteArray {
|
||||||
// Create root object
|
// Create root object
|
||||||
var backup: Backup? = null
|
var backup: Backup? = null
|
||||||
@@ -38,4 +38,4 @@ object ProtoBackupExport: ProtoBackupBase() {
|
|||||||
|
|
||||||
return byteStream.toByteArray()
|
return byteStream.toByteArray()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import java.io.InputStream
|
|||||||
|
|
||||||
private val logger = KotlinLogging.logger {}
|
private val logger = KotlinLogging.logger {}
|
||||||
|
|
||||||
object ProtoBackupImport: ProtoBackupBase() {
|
object ProtoBackupImport : ProtoBackupBase() {
|
||||||
var restoreAmount = 0
|
var restoreAmount = 0
|
||||||
|
|
||||||
suspend fun performRestore(sourceStream: InputStream): ValidationResult {
|
suspend fun performRestore(sourceStream: InputStream): ValidationResult {
|
||||||
@@ -59,7 +59,6 @@ object ProtoBackupImport: ProtoBackupBase() {
|
|||||||
// showRestoreProgress(restoreProgress, restoreAmount, context.getString(R.string.categories))
|
// showRestoreProgress(restoreProgress, restoreAmount, context.getString(R.string.categories))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun restoreManga(backupManga: BackupManga, backupCategories: List<BackupCategory>) { // TODO
|
private fun restoreManga(backupManga: BackupManga, backupCategories: List<BackupCategory>) { // TODO
|
||||||
// val manga = backupManga.getMangaImpl()
|
// val manga = backupManga.getMangaImpl()
|
||||||
// val chapters = backupManga.getChaptersImpl()
|
// val chapters = backupManga.getChaptersImpl()
|
||||||
@@ -77,4 +76,4 @@ object ProtoBackupImport: ProtoBackupBase() {
|
|||||||
// restoreProgress += 1
|
// restoreProgress += 1
|
||||||
// showRestoreProgress(restoreProgress, restoreAmount, manga.title)
|
// showRestoreProgress(restoreProgress, restoreAmount, manga.title)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import suwayomi.tachidesk.manga.impl.backup.AbstractBackupValidator
|
|||||||
import suwayomi.tachidesk.manga.impl.backup.proto.models.Backup
|
import suwayomi.tachidesk.manga.impl.backup.proto.models.Backup
|
||||||
import suwayomi.tachidesk.manga.model.table.SourceTable
|
import suwayomi.tachidesk.manga.model.table.SourceTable
|
||||||
|
|
||||||
object ProtoBackupValidator: AbstractBackupValidator() {
|
object ProtoBackupValidator : AbstractBackupValidator() {
|
||||||
fun validate(backup: Backup): ValidationResult {
|
fun validate(backup: Backup): ValidationResult {
|
||||||
if (backup.backupManga.isEmpty()) {
|
if (backup.backupManga.isEmpty()) {
|
||||||
throw Exception("Backup does not contain any manga.")
|
throw Exception("Backup does not contain any manga.")
|
||||||
@@ -42,4 +42,4 @@ object ProtoBackupValidator: AbstractBackupValidator() {
|
|||||||
|
|
||||||
return ValidationResult(missingSources, missingTrackers)
|
return ValidationResult(missingSources, missingTrackers)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user