Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Boyue S62 #404

Merged
merged 1 commit into from
Feb 9, 2023
Merged

Add Boyue S62 #404

merged 1 commit into from
Feb 9, 2023

Conversation

RamKromberg
Copy link
Contributor

@RamKromberg RamKromberg commented Feb 8, 2023

Boyue Likebook LemonRead S62A

Just the basic place holder.

I've written a wip frontlight controller too. But, although it reads fine, to write the brightness it needs system write so I haven't tested or added it to the pull. Attached here for reference: BoyueS62Controller.zip

References:

  1. PhoneStatusBar.java from SystemUI.apk (deodox and decompile with jadx) showing the frontlight logic: PhoneStatusBar.zip
    It also mentions /sys/class/backlight/rk28_bl_warm/brightness but permissions are required there as well.
  2. RK3368Impl.java from Boyue-Launcher.apk (deodox and decompile with jadx) showing mostly the EPD entries (EPD_FULL_DITHER isn't the same but we don't use it anyhow): RK3368Impl.zip
  3. FunctionUtil.java from Boyue-Launcher.apk (deodox and decompile with jadx) showing an alternative method to modify the brightness (that's also requires root): FunctionUtil.zip

This change is Reviewable

@pazos
Copy link
Member

pazos commented Feb 8, 2023

Thanks for the contribution! Looks good.

I've written a wip frontlight controller too. But, although it reads fine, to write the brightness it needs system write so I haven't tested or added it to the pull.

It also looks good.

Write settings permission check/prompt isn't wired into the frontlight widget yet. Mostly because no driver was using it. Now it sounds like a good idea to implement.

If you want to test your driver now you can grant the permission going to "settings->screen->timeout" and requesting custom timeouts.

If everything works it should be a matter of implementing a similar logic (maybe without that warning message) on the frontlight widget.

Feel free to open a separate ticket in this repo to keep track of it, in case it takes time, so we can merge this and move conversation there

@RamKromberg
Copy link
Contributor Author

@pazos regrettably it doesn't work. Basically, I get "Lights : java.lang.IllegalArgumentException: You cannot keep your settings in the secure settings." when trying to toggle the lights regardless of the api. Closest I got is to update SCREEN_BRIGHTNESS after the user manually turns the light on but toggles the manual mode (so the light turn off). Then, it's possible to modify SCREEN_BRIGHTNESS without a permission error. But, to actually turn the light on to that value, the user needs to toggle manual mode again... So, useless.

Maybe there's a way to workaround the issue like tricking systemui to redraw or something that I'm missing... But the difference between tap-tap-slide-tap (Frontlight in koreader) and slide-slide-tap-tap-tap/slide-tap is just not worth the fragility unless it's an officially supported API. So, I'm giving up here.

regards

@pazos
Copy link
Member

pazos commented Feb 9, 2023

Indeed, secure settings are reserved for system apps. Maybe there's an intent or some other workaround but I agree with you it doesn't worth out time!

Thanks again!

@pazos pazos merged commit 51f7d12 into koreader:master Feb 9, 2023
@RamKromberg RamKromberg deleted the add/boyue_s62 branch February 9, 2023 18:39
@RamKromberg
Copy link
Contributor Author

It's quite annoying too since the apis for SCREEN_BRIGHTNESS and SCREEN_OFF_TIMEOUT shouldn't be treated differently by default so boyue/rockchip/someone clearly changed it deliberately for some reason.

Anyhow, since Boyue went out of business and this particular model didn't even come with an app store, there's no disadvantage to modifying the system partition. So, I've already replaced the default webview with a new one (had to modify framework-res.apk) and I'm looking up how to modify permissions so I'll be able to put SCREEN_BRIGHTNESS back under the system write permission and get the generic controller to work...

Anyhow, thanks for the review and the trick about the timeout. The latter might help with getting the generic brightness controller up and running once I figure out the permissions thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants