Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android是否可以编写保护我使用StorageAccessFramework创建的纯文本文件?_Android_Storage Access Framework - Fatal编程技术网

android是否可以编写保护我使用StorageAccessFramework创建的纯文本文件?

android是否可以编写保护我使用StorageAccessFramework创建的纯文本文件?,android,storage-access-framework,Android,Storage Access Framework,我在一个文本编辑器工作,希望能够写保护文件。这可能吗?我可以使用游标和(列\u标志和标志\u支持\u写入)从其URI获取其权限,但我找不到更改其权限的方法 我还找到了一种使用ParcelFileDescriptor的proc fd获取SD卡上物理文件位置的方法,但是file.setWriteable(false,true)不起作用 谢谢史蒂夫S 这可能吗 不,对不起 我可以使用游标和(列\u标志和标志\u支持\u写入)从其URI获取其权限,但我找不到更改其权限的方法 这些不是真正的“权限”FLA

我在一个文本编辑器工作,希望能够写保护文件。这可能吗?我可以使用游标和(列\u标志和标志\u支持\u写入)从其URI获取其权限,但我找不到更改其权限的方法

我还找到了一种使用ParcelFileDescriptor的proc fd获取SD卡上物理文件位置的方法,但是file.setWriteable(false,true)不起作用

谢谢史蒂夫S

这可能吗

不,对不起

我可以使用游标和(列\u标志和标志\u支持\u写入)从其URI获取其权限,但我找不到更改其权限的方法

这些不是真正的“权限”
FLAG\u支持写入
仅表示内容是只读的。例如

我还找到了一种使用ParcelFileDescriptor的proc fd获取SD卡上物理文件位置的方法,但是file.setWriteable(false,true)不起作用


正确,这是不受支持的。

@stevensmith:Android从未真正支持将文件标记为只读。他们的理念通常是“如果用户能看到它,用户可以用它做用户想做的事情”。如果要在设备上保存内容,但不希望用户修改,请将其放在用户无法访问的位置(例如,
getFilesDir()
)。然后,考虑一个“保存AS”、“导出”、“备份”或类似的选项,以在公共场所(例如,使用<代码> ActhOnCytAtdioDeals/<代码>),在用户请求的情况下,对该内容进行读写拷贝。在这种情况下,我更担心意外地踩上我创建的文件。