我试图从/dev/graphics/fb0
服务路径中的设备文件中获取一些数据,U 具有 root 权限并执行chmod 777
命令,然后出现“权限被拒绝”错误。
然后我执行setenforce 0
了:,错误消失了,但文件的大小仍然为零
RandomAccessFile raf = new RandomAccessFile("/dev/graphics/fb0", "rw");
FileChannel fc = raf.getChannel();
logText.setText(raf.length() + " "); // length is 0
MappedByteBuffer mbb = fc.map(FileChannel.MapMode.PRIVATE, 0, 1024 * 1920 * 4);
raf.close();
FileInputStream fileInputStream = new FileInputStream("/dev/graphics/fb0");
logText.setText(fileInputStream.available() + " "); // available is still 0