package com.zxhy.hfilemanagermaster.knife

import android.content.Context
import android.net.Uri
import androidx.core.content.FileProvider
import java.io.File

// File通过FileProvider,获取Uri
fun fileProviderUri(context: Context, shareFile: File): Uri {
    val s = context.applicationContext.packageName
    //注意这里第二个参数,要和配置文件里的   android:authorities="${applicationId}.fileProvider",保持一致
    return FileProvider.getUriForFile(
        context, context.applicationContext.packageName + ".fileProvider", shareFile
    )
}