diff --git a/lib_dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java b/lib_dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java index c49b54b5..04b23368 100644 --- a/lib_dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java +++ b/lib_dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java @@ -1478,7 +1478,9 @@ private InputStream openInputStream(@NonNull final String filePath, final String */ private InputStream openInputStream(@NonNull final Uri stream, final String mimeType, final int mbrSize, final int types) throws IOException { - final InputStream is = getContentResolver().openInputStream(stream); + final InputStream is = stream.toString().startsWith("file:///android_asset/") ? + getAssets().open(stream.getPath().substring(15)) : + getContentResolver().openInputStream(stream); assert is != null; if (MIME_TYPE_ZIP.equals(mimeType)) return new ArchiveInputStream(is, mbrSize, types);