diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..9728eb1 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index bc8d0a3..216536e 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,9 @@ + + diff --git a/src/main/kotlin/com/waicool20/mr2tachiyomi/MR2Tachiyomi.kt b/src/main/kotlin/com/waicool20/mr2tachiyomi/MR2Tachiyomi.kt index 4f84bfc..77bf85e 100644 --- a/src/main/kotlin/com/waicool20/mr2tachiyomi/MR2Tachiyomi.kt +++ b/src/main/kotlin/com/waicool20/mr2tachiyomi/MR2Tachiyomi.kt @@ -104,11 +104,12 @@ object MR2Tachiyomi { val buffer = ByteArray(512) ABUtils.ab2tar(input, tarFile) + val dbRegex = Regex("apps/com\\.notabasement\\.mangarock.+?/db/mangarock\\.db") Files.newInputStream(tarFile).use { inputStream -> while (inputStream.available() > 0) { inputStream.read(buffer) val name = buffer.sliceArray(TarHeaderOffsets.NAME_RANGE).toStringAndTrim() - if (name == "apps/com.notabasement.mangarock.android.lotus/db/mangarock.db") { + if (name.matches(dbRegex)) { val size = buffer.sliceArray(TarHeaderOffsets.SIZE_RANGE).toStringAndTrim().toInt(8) val blocks = if (size > 0) 1 + (size - 1) / 512 else 0 Files.newOutputStream(db).use { outputStream ->