ARK-Builders / ARK-Builders/Navigator
Corrupted PDF file can crash root opening
- Dominant language
- Kotlin
- Stars
- 16
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
```
ACRA caught a IOException for dev.arkbuilders.navigator
java.io.IOException: file not in PDF format or corrupted
at android.graphics.pdf.PdfRenderer.nativeCreate(Native Method)
at android.graphics.pdf.PdfRenderer.(PdfRenderer.java:172)
at space.taran.arklib.domain.meta.generator.DocumentMetadataGenerator.generate-gIAlu-s(DocumentMetadataGenerator.kt:51)
at space.taran.arklib.domain.meta.MetadataGenerator$Companion.generate-gIAlu-s(MetadataGenerator.kt:40)
at space.taran.arklib.domain.meta.RootMetadataProcessor$generate$4.invokeSuspend(RootMetadataProcessor.kt:100)
at space.taran.arklib.domain.meta.RootMetadataProcessor$generate$4.invoke(Unknown Source:8)
at space.taran.arklib.domain.meta.RootMetadataProcessor$generate$4.invoke(Unknown Source:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
at space.taran.arklib.domain.meta.RootMetadataProcessor.generate(RootMetadataProcessor.kt:84)
at space.taran.arklib.domain.meta.RootMetadataProcessor.access$generate(RootMetadataProcessor.kt:22)
at space.taran.arklib.domain.meta.RootMetadataProcessor$generate$2$jobs$1$1.invokeSuspend(RootMetadataProcessor.kt:71)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@29f427d, Dispatchers.Main]
```
Contributor guide
Research direction
Start at DocumentMetadataGenerator.kt:51, where PdfRenderer reports the corrupted-file exception, then trace how RootMetadataProcessor.kt handles generation at lines 84 and 100. Reproduce root opening with a corrupted PDF and verify that the root opens without crashing while the invalid document is handled safely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100