Linux support (#381)
* Add desktop release CI and support for Arch Linux packaging * Make Gradle wrapper executable in desktop-release workflow * Make Gradle wrapper executable in desktop-release workflow * Make Gradle wrapper executable in desktop-release workflow * Configure Gradle and update Java environment in desktop-release workflow * Update Java setup and AUR packaging in desktop release workflow * Update Java setup and AUR packaging in desktop release workflow * Add MSIX packaging support for Windows desktop distribution * Update AUR packaging metadata and validation * Use spine toc attribute for NCX resolution * crash fixes * Implement automatic discovery and injection of EPUB font face siblings * Enhance custom font support with family grouping and variable font handling * Optimize metadata loading and improve TTS highlighting * Add keyboard navigation support for EPUB reader * Refine PDF spread page sizing to respect aspect ratios * Implement responsive maximum height for reader popups and sheets * Handle TTS generation failures by skipping problematic chunks * Refactor PDF tile rendering logic and zoom indicator behavior * Prefer block and offset locators over page index in native vertical flow * Implement save and share actions for original book files * Add Estonian language support * Implement temporary viewing mode for external files * Implement direct opening for temporary external files without library persistence * fix failing tests * Import SharedFileCapabilities in DesktopLibraryUi * Improve native vertical reader progress, persistence, and image support * Center target in viewport for native vertical reader and support animated scrolling
This commit is contained in:
parent
a13d6599d1
commit
625a4d5d2e
102 changed files with 6012 additions and 687 deletions
|
|
@ -41,7 +41,7 @@ class OdtParser(private val context: Context) {
|
|||
|
||||
val mathJaxFileName = "tex-mml-chtml.js"
|
||||
val mathJaxFile = File(extractionDir, mathJaxFileName)
|
||||
if (!mathJaxFile.exists()) {
|
||||
if (parseContent && !mathJaxFile.exists()) {
|
||||
try {
|
||||
context.assets.open("mathjax/$mathJaxFileName").use { input ->
|
||||
FileOutputStream(mathJaxFile).use { output ->
|
||||
|
|
@ -170,32 +170,33 @@ class OdtParser(private val context: Context) {
|
|||
|
||||
try {
|
||||
if (!isFlat) {
|
||||
val zis = ZipInputStream(inputStream)
|
||||
var entry = zis.nextEntry
|
||||
var contentXmlBytes: ByteArray? = null
|
||||
var stylesXmlBytes: ByteArray? = null
|
||||
val ignoredFiles = setOf("meta.xml", "settings.xml", "META-INF/manifest.xml")
|
||||
|
||||
while (entry != null) {
|
||||
if (!entry.isDirectory) {
|
||||
when (entry.name) {
|
||||
"content.xml" -> contentXmlBytes = zis.readBytes()
|
||||
"styles.xml" -> stylesXmlBytes = zis.readBytes()
|
||||
"Thumbnails/thumbnail.png" -> coverBytes = zis.readBytes()
|
||||
else -> {
|
||||
if (entry.name !in ignoredFiles) {
|
||||
val extractedFile = safeFileInRoot(extractionDir, entry.name)
|
||||
if (extractedFile != null) {
|
||||
extractedFile.parentFile?.mkdirs()
|
||||
FileOutputStream(extractedFile).use { out -> zis.copyTo(out) }
|
||||
} else {
|
||||
Timber.w("Skipping unsafe ODT entry outside extraction root: ${entry.name}")
|
||||
ZipInputStream(inputStream).use { zis ->
|
||||
var entry = zis.nextEntry
|
||||
while (entry != null) {
|
||||
if (!entry.isDirectory) {
|
||||
when (entry.name) {
|
||||
"content.xml" -> contentXmlBytes = zis.readBytes()
|
||||
"styles.xml" -> stylesXmlBytes = zis.readBytes()
|
||||
"Thumbnails/thumbnail.png" -> coverBytes = zis.readBytes()
|
||||
else -> {
|
||||
if (entry.name !in ignoredFiles) {
|
||||
val extractedFile = safeFileInRoot(extractionDir, entry.name)
|
||||
if (extractedFile != null) {
|
||||
extractedFile.parentFile?.mkdirs()
|
||||
FileOutputStream(extractedFile).use { out -> zis.copyTo(out) }
|
||||
} else {
|
||||
Timber.w("Skipping unsafe ODT entry outside extraction root: ${entry.name}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
entry = zis.nextEntry
|
||||
}
|
||||
entry = zis.nextEntry
|
||||
}
|
||||
|
||||
// Pre-parse styles if available
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue