Pdf-Viewer icon indicating copy to clipboard operation
Pdf-Viewer copied to clipboard

[BUG] Downloading a password protected file gives SecurityException.class

Open Gaawk opened this issue 5 months ago • 2 comments

📝 Describe the Bug

When calling initWithUrl with the url of the pdf file which is password protected, app crashed for Security Exception. Do we have any way to open password protected file without crashing it?

📖 Library Version

  • PDF Viewer Version: [e.g., 2.0.0]

🚶 StackTrace

FATAL EXCEPTION: main java.lang.SecurityException: password required or incorrect password at android.graphics.pdf.PdfRenderer.nativeCreate(Native Method) at android.graphics.pdf.PdfRenderer.(PdfRenderer.java:172) at com.rajat.pdfviewer.PdfRendererCore.(PdfRendererCore.kt:72) at com.rajat.pdfviewer.PdfRendererView.init(PdfRendererView.kt:147) at com.rajat.pdfviewer.PdfRendererView.init(PdfRendererView.kt:142) at com.rajat.pdfviewer.PdfDownloader$download$2$2.invokeSuspend(PdfDownloader.kt:101) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:257) at android.os.Looper.loop(Looper.java:368) at android.app.ActivityThread.main(ActivityThread.java:8839) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@85f94c3, Dispatchers.Main.immediate]

Gaawk avatar Oct 03 '24 06:10 Gaawk