Back to All

[Android] PDF Viewer issues - PDF protected by password crashes the app

Hi there.

In our app we serve some PDFs that are password protected. When these try to get opened, the app crashes as there's no handling done for password protected ones - doesn't pop any input for the password.

Crash sample:```
Exception java.lang.SecurityException: password required or incorrect password
at android.graphics.pdf.PdfRenderer.nativeCreate
at android.graphics.pdf.PdfRenderer. (PdfRenderer.java:172)
at com.rajat.pdfviewer.PdfRendererCore. (PdfRendererCore.kt)
at com.rajat.pdfviewer.PdfRendererView.init (PdfRendererView.kt:1)
at com.rajat.pdfviewer.PdfRendererView.init (PdfRendererView.kt:1)
at com.rajat.pdfviewer.PdfRendererView.initWithFile (PdfRendererView.kt:1)
at co.median.android.pdfviewer.PdfViewerActivity.loadUrlToPDFViewer (PdfViewerActivity.kt:1)
at co.median.android.pdfviewer.PdfViewerActivity.downloadAndLoadPDFUrl$lambda$12$lambda$10 (PdfViewerActivity.kt:1)
at android.os.Handler.handleCallback (Handler.java:996)
at android.os.Handler.dispatchMessage (Handler.java:110)
at android.os.Looper.loopOnce (Looper.java:210)
at android.os.Looper.loop (Looper.java:302)
at android.app.ActivityThread.main (ActivityThread.java:9652)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:601)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1062)


If there's any other info needed, please let me know. We're waiting for a fix soon in order to re-compile and publish the update.

Thanks.