your app(s) are using a content provider with an unsafe implementation of openfile :App is rejected from playstore

旧时模样 提交于 2019-12-11 18:49:06

问题


My app is being rejected due to your app(s) are using a content provider with an unsafe implementation of openfile.

@Override
    public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
        File privateFile = new File(uri.getPath());
        ParcelFileDescriptor desc = ParcelFileDescriptor.open(privateFile, ParcelFileDescriptor.MODE_READ_ONLY);

        return desc;
    }

 <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="${applicationId}.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true"
            tools:replace="android:authorities">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_provider_paths"
                tools:replace="android:resource" />
 </provider>


<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <external-path name="external_files" path="."/>
    <external-path name="image_path" path="file:///sdcard/temporary_file.jpg"/>
</paths>

<!--<external-path name="image_path" path="file:///storage/emulated/0/Infogainify/Default"/>-->

来源:https://stackoverflow.com/questions/57112903/your-apps-are-using-a-content-provider-with-an-unsafe-implementation-of-openfi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!