Screencap not working on Android 7.1 RC2 running on VirtualBox

197 views
Skip to first unread message

Company Joe Security

unread,
Jan 17, 2018, 4:20:26 AM1/17/18
to Android-x86
Execution screencap -p 1.png via ADB or directly via console emulator results in a file with 0 bytes. The issue seems to be related to SELinux:

01-17 10:19:19.528  4845  4845 I screencap: type=1400 audit(0.0:554): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:init:s0 tclass=binder permissive=1
01-17 10:19:19.529  4845  4845 I screencap: type=1400 audit(0.0:555): avc: denied { transfer } for scontext=u:r:shell:s0 tcontext=u:r:init:s0 tclass=binder permissive=1

Is there a way to fix this via SELinux tools? 

Chih-Wei Huang

unread,
Jan 17, 2018, 4:34:04 AM1/17/18
to Android-x86
2018-01-17 17:20 GMT+08:00 Company Joe Security
<stefan.b...@joesecurity.org>:
The selinux mode is permissive.
That means it's only logged, not denied.

I think it's due to pixel format mismatch.
There is no easy fix.

Currently screencap only works in i965 GPU.


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Company Joe Security

unread,
Jan 17, 2018, 5:01:04 AM1/17/18
to Android-x86
It works on all earlier Android x86 version. 

Company Joe Security

unread,
Jan 22, 2018, 6:53:41 AM1/22/18
to Android-x86
Is there any way to fix this? We could even sponsor the development costs & efforts!

Mauro Rossi

unread,
Jan 23, 2018, 4:15:26 AM1/23/18
to Android-x86
If I recall correctly, reverting the RGBA/RGBX commits in mesa 17.1.x state_trackers/dri,
should restore Printscreen functionality

By the way are available only for Intel and BGRA is also available there and EGLmanager is able to fallback to BGRA (as before).

The tradeoff maybe that some apps, strictly requiring RGBA/RGBX may not work, but I don't know how many there are,
so I can't judge on impact of this workaround.
M.

TianJian Wu

unread,
Jan 23, 2018, 11:33:35 PM1/23/18
to Android-x86

Can you try command screenrecord and cat /dev/fb0 > [bmp_file] ?   As I remember one of them is correct.

Command screencap implementation used to check fb0 and dri driver and grab framebuffer from the right device but it seems not be that way anymore.

Company Joe Security於 2018年1月17日星期三 UTC+8下午5時20分26秒寫道:

James Withers

unread,
Jan 30, 2018, 1:33:27 AM1/30/18
to Android-x86
Screencap and screenrecord don't work, but dumping /dev/graphics/fb0 to a file (and the converting from raw format) does on 7.1RC2.
Reply all
Reply to author
Forward
0 new messages