You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
While testing and refactoring the code for #3624, I was thinking of accessing the zim file with file descriptor without any permission(MANAGE_EXTERNAL_STORAGE). I can read the file without permission if I select the file via the existing file picker in the Play Store variant. I have tested it on Android 11 and Android 12.
Why we had failed to access the ZIM files in the past without special permission
We were trying to access the File which is the basic requirement of our application to function, and we can not access the files without special permission.
We had some options at that time e.g. copying the content in a temp file from inputStream but it did not fit in our requirements, since it used twice the storage for the same ZIM file.
With the file descriptor approach in Storage permissions are unnecessarily required #3265. In this PR we are trying to access the fileDescriptor from a file, which gives us the permission denied message for fileDescriptor. We did this with old-libkiwix
In the past, we were using the java-libkiwix which had the issue opening the ZIM files via file descriptor that we saw while we were introducing the ASSET_FILE_DELIVERY for custom apps.
Expected behavior
We should add the file picker in the Play Store variant and if possible we should move our functionalities to rely on fileDescriptor instead of file. Since we have more access to a file descriptor instead of a file, Android limits direct access to files without special permission on Android 11 and above.
What if we use file descriptor instead of file
It did not work for scanning the storage.
It will work for opening the ZIM files with the file picker without any special permission.
It needs refactoring to make the application properly work with the file descriptor.
Additional notes to remember
We can show the ZIM file inside the library section if possible since at that time we have the URI of that ZIM file once opened with fileDescriptor.
vidma_recorder_22122023_152225.mp4
The text was updated successfully, but these errors were encountered:
@MohitMaliFtechiz This seems a very positive direction to me. Not being able to pick archives is the biggest disadvantage of the PlayStore variant of the Kiwix Android app (which, like it or not, is always going to be the main variant for the average user).
We can not support opening on filehandle of ZIM files on many architectures. Reason is not very clear, but is linked to restriction on files. Therefore this can not be implemented straight.
Describe the bug
While testing and refactoring the code for #3624, I was thinking of accessing the zim file with
file descriptor
without any permission(MANAGE_EXTERNAL_STORAGE
). I can read the file without permission if I select the file via the existingfile picker
in the Play Store variant. I have tested it on Android 11 and Android 12.Why we had failed to access the ZIM files in the past without special permission
File
which is the basic requirement of our application to function, and we can not access the files without special permission.inputStream
but it did not fit in our requirements, since it used twice the storage for the same ZIM file.file descriptor
approach in Storage permissions are unnecessarily required #3265. In this PR we are trying to access the fileDescriptor from a file, which gives us the permission denied message for fileDescriptor. We did this withold-libkiwix
java-libkiwix
which had the issue opening the ZIM files via file descriptor that we saw while we were introducing theASSET_FILE_DELIVERY
for custom apps.Expected behavior
We should add the
file picker
in the Play Store variant and if possible we should move our functionalities to rely on fileDescriptor instead of file. Since we have more access to afile descriptor
instead of a file, Android limits direct access to files without special permission on Android 11 and above.What if we use file descriptor instead of file
Additional notes to remember
vidma_recorder_22122023_152225.mp4
The text was updated successfully, but these errors were encountered: