zhanghai / zhanghai/MaterialFiles

Cannot open files from SFTP with other apps

Open
#851 9 comments 0 reactions 1 assignee View on GitHub

@zhanghai is already working on this.

Since Aug 31, 2022.

bug
Dominant language
Kotlin
Stars
9k
Forks
736
PR merge metrics
No merged PRs in 30d

Description

Description

I tried to open a PDF file located on a SFTP server with 3 different apps, none of them did work. If I copy the file to internal storage there is no issue opening it.

Setting

Device: Samsung Galaxy J3 (SM-J320F)
OS: LineageOS 14.1
App version: 1.5.2 release

Log
08-31 21:22:49.876  1236  1628 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=content://me.zhanghai.android.files.file_provider/sftp**************.pdf typ=application/pdf flg=0x3000003 cmp=com.artifex.mupdf.viewer.app/com.artifex.mupdf.viewer.DocumentActivity (has extras)} from uid 10070 on display 0
08-31 21:22:49.919  6657  6657 I MuPDF   : OPEN URI content://me.zhanghai.android.files.file_provider/sftp**************.pdf
08-31 21:22:49.919  6657  6657 I MuPDF   :   MAGIC (Intent) application/pdf
08-31 21:22:49.930  6731  6744 E DatabaseUtils: Writing exception to parcel
08-31 21:22:49.930  6731  6744 E DatabaseUtils: android.os.NetworkOnMainThreadException
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at java.net.SocketOutputStream.write(SocketOutputStream.java:157)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at zb.j.r(:13)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at ub.d$a.a(:19)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at ub.d.flush(:3)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at xb.r.m(:3)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at xb.r.f(:7)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at xb.r.a()
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at xb.r.l(:2)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at oa.b.k(:9)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at na.b.e()
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at na.b.l()
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at na.c.v()
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at d.b.I0(:2)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at d.b.a1()
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at me.zhanghai.android.files.file.FileProvider.query(:2)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at android.content.ContentProvider.query(ContentProvider.java:1022)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at android.content.ContentProvider$Transport.query(ContentProvider.java:240)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
08-31 21:22:49.930  6731  6744 E DatabaseUtils: 	at android.os.Binder.execTransact(Binder.java:565)
08-31 21:22:49.932  6657  6657 I MuPDF   :   NAME null
08-31 21:22:49.932  6657  6657 I MuPDF   :   SIZE -1
08-31 21:22:49.932  6657  6657 I MuPDF   : Opening document content://me.zhanghai.android.files.file_provider/sftp**************.pdf
08-31 21:22:49.939  6731  6766 E JavaBinder: *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
08-31 21:22:49.939  6731  6766 E JavaBinder: java.lang.ArrayIndexOutOfBoundsException: length=256; index=-5
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at net.schmizz.sshj.common.Buffer.p()
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at zb.d.d(:4)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at zb.j.r(:10)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at ub.d$a.a(:19)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at ub.d.flush(:3)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at xb.r.m(:3)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at xb.r.f(:7)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at xb.r.a()
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at xb.p.e(:5)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at oa.b.d()
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at oa.b.e()
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at na.c.r(:20)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at me.zhanghai.android.files.file.FileProvider.openFile(:8)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at android.content.ContentProvider.openAssetFile(ContentProvider.java:1379)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at android.content.ContentProvider.openTypedAssetFile(ContentProvider.java:1559)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at android.content.ContentProvider.openTypedAssetFile(ContentProvider.java:1625)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:424)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:313)
08-31 21:22:49.939  6731  6766 E JavaBinder: 	at android.os.Binder.execTransact(Binder.java:565)
08-31 21:22:50.120  1236  1257 I ActivityManager: Displayed com.artifex.mupdf.viewer.app/com.artifex.mupdf.viewer.DocumentActivity: +222ms

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.