Closed cheehongw closed 3 months ago
ADB is not a reliable method to figure out what unprivilegied apps can do.
You'll need to RE the binaries to find which methods are called by the stock app. If you look in open/closed tickets and previous implemented drivers you'll find a lot of info on how it can be done. See https://github.com/koreader/android-luajit-launcher/issues/344, for instance
I continued the investigation from here and from https://github.com/koreader/android-luajit-launcher/issues/344 using a device:
Manufacturer: xiaomi
Brand: xiaomi
Model: xiaomi_reader
Device: rk3566_eink
Hardware: rk30board
Android Version: 11
After decompiling SystemUI.apk
& MoaanSettings.apk
(preloaded settings app) it turns out that method forceGlobalRefresh()
is in fact a call to a system service "eink". There is a class android.os.EinkManager
which declares sendOneFullFrame()
trigerring a refresh.
The same class also declares setMode(String)
method allowing to set one of EPD modes:
EPD_A2 = "12"
EPD_A2_DITHER = "13"
EPD_A2_ENTER = "16"
EPD_AUTO_DU = "22"
EPD_AUTO_DU4 = "23"
EPD_DU4 = "15"
EPD_DU = "14" // Balanced mode & Quick mode
EPD_FULL_GC16 = "2"
EPD_FULL_GCC16 = "6"
EPD_FULL_GL16 = "3"
EPD_FULL_GLD16 = "5"
EPD_FULL_GLR16 = "4"
EPD_OVERLAY = "1"
EPD_PART_GCC16 = "11"
EPD_PART_GL16 = "8"
EPD_PART_GLD16 = "10"
EPD_PART_GLR16 = "9"
EPD_PART_GC16 = "7" // Clear mode
EPD_RESET = "17"
EPD_AUTO = "0"
EPD_NULL = "-1"
I have implemented "full-only" driver in https://github.com/koreader/android-luajit-launcher/pull/478
Can you point me to details describing methods from interface EPDInterface
?
I would like to get a better understanding if "all" driver is possible.
Decompiling SystemUI.apk
also allowed me to understand how lights & warmth is handled. There is a class android.os.MoanLedControl
with several methods allowing to set and get light & warmth levels. Getting values using reflection works fine, however setting values is trying to write to /proc/aw99703/led_brightness
& /proc/aw99703/led_current
and it fails with "Permission denied". I assume it requires admin rights.
Lights driver is also included in the PR mentioned above.
Can you point me to details describing methods from interface EPDInterface? I would like to get a better understanding if "all" driver is possible.
The "all" driver requires a system that doesn't refresh at all or a way to inhibit the refreshes of the system. Otherwise we end up with a bunch of partial refreshes done twice, and that's quite a mess :/
Thanks for clarification.
In that case I assume all Xiaomi-based devices triggering android.eink.force.refresh
intent will remain "full-only".
Out of date, please repeat the EinkTest
Brightness/warmth controls currently don't work at all for this e-reader.
Commercial Product Name:
Xiaomi Duokan Pro II
/Xiaomi Ereader Pro II
Model:miduokanreaderproii
Product:moaan
Device:rk3566_eink
Hardware:rk30board
Platform:rk356x
Android Version: 11I have tried my hands at making a driver for it, but have encountered a roadblock, so this is me sharing my findings.
The brightness/warmth can be controlled through the adb shell, but it appears that these values are located under
Settings.Global
, which means only system apps can set these values. If anyone has any tricks to setSettings.Global
, please let me know!I also investigated
/sys/class/backlight
but the files there are rather inconclusive and dont contain any real values.