C#xamarin - rooted android write / data / sytem [英] C# xamarin - rooted android write /data /sytem
本文介绍了C#xamarin - rooted android write / data / sytem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想修改/ data / data或/ system中的数据,我们称之为file.bin
var sdcardPath = Android.OS .Environment.RootDirectory.Path;
var files = Path.Combine(sdcardPath,/ data / data / com.xyz / file.bin);
Java.Lang.Runtime.GetRuntime()。exec(chmod 777+ files);
BinaryWriter bw = new BinaryWriter(File.OpenWrite(files));
i可以读取该文件,但无法读取,因为System.UnauthorizedAccessException我认为它必须具有SDCard写权限等清单中的权限,但我找不到任何文档来获取/数据写入。
我有什么试过:
将make / data挂载到rw但仍无法写入
Java。 Lang.Runtime.GetRuntime()。Exec(su+mount -o rw,remount,rw / data);
解决方案
< blockquote>你看过Xamarin论坛了吗?谷歌快速搜索发现: UnauthorizedAccessException创建目录 - Xamarin论坛 [ ^ ]
i want to modify data in /data/data or /system lets call it file.bin
var sdcardPath = Android.OS.Environment.RootDirectory.Path; var files = Path.Combine(sdcardPath, "/data/data/com.xyz/file.bin"); Java.Lang.Runtime.GetRuntime().Exec("chmod 777" + files); BinaryWriter bw = new BinaryWriter(File.OpenWrite(files));
i can read that file, but cant read because System.UnauthorizedAccessException i think it must have permission in manifest like SDCard write permission, but i cant find any documentation to get /Data Write.
What I have tried:
tying with make /data mount to rw but still cannot write
Java.Lang.Runtime.GetRuntime().Exec("su " + "mount -o rw, remount, rw /data ");
解决方案
Did you look in the Xamarin forums? A quick Google search found this: UnauthorizedAccessException Creating Directory — Xamarin Forums[^]
这篇关于C#xamarin - rooted android write / data / sytem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文