I am trying to get an update ANE (Adobe native extension) to work with my Adobe AIR application on Android and it looks like I can't get the correct FILE_PROVIDER_PATHS for the files.
I download the file to the File.applicationStorageDirectory of the app in my Adobe Flex App.
My FileProvider in the Android manifest looks like this:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="air.MY_APP_ID_HERE.files"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/fileproviderpaths" />
</provider>
fileproviderpaths.xml:
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<files-path name="files" path="." />
<external-path name="files" path="." />
<external-files-path name="files" path="." />
</paths>
And then in the ANE (Java) code I am trying to access the file like this:
newFile = new File(urlString);
// newFile.getPath() debugs as "/data/user/0/air.MY_APP_ID_HERE/MY_APP_ID_HERE/LocalStore/myFileName.apk"
// the file really exists there - i see it on newFile.exists() and newFile.length()
// context.getActivity() just returns the Android Context - this is Adobe AIR specific
// context.getActivity().getPackageName() debugs as "air.MY_APP_ID_HERE"
Uri fileUri = FileProvider.getUriForFile(context.getActivity(), context.getActivity().getPackageName() + ".files", newFile);
No matter what I try in the fileproviderpaths.xml I am always getting an exception
Failed to find configured root that contains /data/data/air.MYAPP_ID_HERE/MYAPP_ID_HERE/Local Store/myFileName.apk
Now my main question is why it is called "/data/user/0/air.MY_APP_ID_HERE..." in the newFile.getPath() and "/data/data/air.MYAPP_ID_HERE..." in the FileProvider exception?
The second question is how do I reach the "/data/user/0/air.MY_APP_ID_HERE/MY_APP_ID_HERE/LocalStore/myFileName.apk" with the Fileprovider or how do I set the paths in the fileproviderpaths.xml for it
Thank you for your time!