Ok, this is ridiculous:
SELinux basically gives NO READ ACCESS AT ALL to the app's own directory!
I unzipped the zip file into its own directory inside getFilesDir(), and
its still not happening.
//Unzipped Test.zip containing a "Test.json".
//fileName is Test.json.
String contentName = fileName.substring(0, fileName.length() - 5); //".json"
is 5 char.
Log.d("Target file is", sourceContext.getFilesDir() +"/"+ contentName +"/" +
fileName);
File file = new File(sourceContext.getFilesDir() + "/"+ contentName +"/" +
fileName);
Now it gives me
01-04 16:14:33.372 1046-1046/package_name D/DOH:
/data/user/0/package_name/files/Test/Test.json: open failed: EACCES (Permission
denied)
01-04 16:14:33.356 1046-1046/package_name W/package_name: type=1400
audit(0.0:22152): avc: denied { search } for name="Test" dev="mmcblk0p29"
ino=57184 scontext=u:r:untrusted_app:s0:c512,c768
tcontext=u:object_r:app_data_file:s0 tclass=dir permissive=0
Once again the documentation for internal storage says I do not need to
give the app any permissions to read or write to the app's own
getFilesDir() directory!
(http://developer.android.com/reference/android/content/Context.html#getFilesDir())
Any help?
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/0b4b5fdc-2a1b-4480-b584-ce9a0eb2252d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.