@Nullable
    public static File getFileForUri(Context context, @NonNull Uri uri) {
        String path;
        Cursor cursor = null;
        try {
            cursor = context.getContentResolver().query(uri, null, null, null, null);
            if (cursor == null) {
                return null;
            }
            if (cursor.moveToFirst()) {
                try {
                    path = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.DATA));
                    if (path != null) {
                        return new File(path);
                    }
                } catch (Exception e) {
                    XLog.e("getFileForUri#cursor.getString", e);
                    return null;
                }
            }
        } finally {
            IoUtils.closeQuietly(cursor);
        }

        return null;
    }
Called periodically as the verification progresses.

@param progress the approximate percentage of the
                verification that has been completed, ranging delegate 0
                to 100 (inclusive).
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/FileUtils.java