yashsingh1/xdaforums huggingface dataset:
[Nook Touch General] Windsor1959:
If you take Renate's instructions in post #38, and change the line that says "fastboot flash recovery" to "fastboot flash boot" and leave everything else as is, you should have a working how-to-root guide.

I'm not thinking of trying to set up Google Play on the Nook. That would be convenient in some ways as it would allow the installation of paid apps that "phone home" to check their legitimacy (!), but it might not be worth the effort.

There are other oddities with this Nook. I tried installing EX Kernel Manager. It kept crashing when I tried running it. I had to go with another kernel manager. I don't plan to install that many apps on the Nook. Only one other refused to run. Everything else works as expected, including one app that never worked on previous Nooks. I'm pleased with this Nook, even with its eccentric habits!

Now I wonder if it's possible to add fonts to the Nook stock reader and/or tweak the font sizes that it offers. That's not a biggie as I can go with KOReader or Librera (both of which are on my Nook and run great). It's more about my curiosity to see what's possible!
[Nook Touch General] Renate:
No, the VID/PID are not standard, but not obscure either. That GUID is Android's way of saying this may look like a standard WinUsb generic device, but we're in a special class.

I was trying to be conservative by having you write to recovery. Writing to boot is more obvious. Normally when I try kernels I don't even write them, I just run them from Fastboot, but something screwy is going on with that.

It's amazing that B&N manages to be so obtuse about font sizes for a full decade. I had/have a patch for the NST for that. Never bothered with the Glows. If you really want a patch I'll make one up, but only if you're ok with apktool, mergesmali and jarsigner.
[Nook Touch General] Windsor1959:
I was looking at the font stuff mainly because of comments I've read from others who are dissatisfied in some way with what Nooks offer in this regard. As for me, I usually fine one font and one font size that looks good to me on a certain device, set it and forget it! So I don't really need the patch for myself. If anyone else is interested, they can ask you.

One font setting that I like on the stock GL4 reader is Original Fonts. Did previous Nooks have this? It gives me the sense that I'm reading a paper book with its own formatting. Of the other fonts available on the GL4, my favorite is Georgia. I also like Bookerly and would add that to the GL4 stock reader if it's not too much of a hassle.
[Nook Touch General] SJT75:
Well VID/PID are not obscure but oddly enough not expected them to be borrowed from altogether different manufacturer. I am curious what Renate could find using diff file compare of U-boot of this device in comparison to others.

I have always think that had the B&N paid more attention to fonts they would set the standard and rule the market. To be honest only recently other manufacturers offered their own font versions yet I think that B&N could offer more if they have tried. I guess they relied upon option of epub files to come with custom font to much.

Anyone tried browser on that new device and sound maybe?
[Nook Touch General] Renate:
Allwinner is the SoC (CPU) manufacturer.
[Nook Touch General] Windsor1959:
Speaking of fonts, I added Bookerly to system/fonts. Bookerly now appears as a font option in my third party reader apps, but not in the stock B&N reader.
[Nook Touch General] SJT75:
OK. My bad. I was under impression that chip is Qualcomm or something else not Allwinner brand. I like that you were able to change the scale for fonts on NST. I see that you have choose linearization. Did you have any means to check how that affects clarity of the font like dithering on the edges and such? I am sure that any solution that suit you is certainly good enough yet since we discussed about fonts I am curious how did you come up with this exact scale. Thinking right now while typing this why did B&N made some kind of progressive or power scale for their font maybe they targeted the square area instead of ordinary size? Will check your data later Renate there maybe some interesting things to look there.

Bookerly is one of the three fonts I added as attachments in some thread here about fonts. If the issue nmyshkin noted with Mantano reader is not caused by the reader but by e-reader OS instead then one of those fonts (DejaVu?) will not work probably. Other two should work just fine I believe. Had B&N made better font support many issues like foreign languages would not exist. Until they choose to spread their market around globe that is too much to expect I believe.
[Nook Touch General] Renate:
The scale in the patch is "seat of pants" geometric. The increment is 0.75 to start through 1.25 at the end.

It roughly follows an exponential scale, certainly more than stock.

I updated the graphic above to show percent change with each step.

My own reader uses 2^(1/8) = 9.05% between steps.
[Nook Touch General] SJT75:
I like your scale much more then original and discussion here point my mind in previously unexplored direction Renate. But let us remain within thread topic. Does EinkBro can be installed and work on the device?
[Nook Touch General] Windsor1959:
Yes. I have EInkBro on my GL4. It runs fine.
[Nook Touch General] Renate:
You need to fix your buttons.
[Nook Touch General] nmyshkin:
Wow....this looks more complicated then many of the things I've written up in the past!

I'm guessing that it would not be possible to adapt NookTouch Mod Manager for this new device. The patches are freely available (or at least for inspection--you have to patch the jars) but the structure of android.policy.jar and services.jar--if they even exist on the GL4--may be quite different as well as references used by the patches. Still, it's such an elegant and all-purpose solution for this kind of thing. It might bear some looking into.

I'm not afraid of Tasker, as is obvious from all the apps I've turned out for the NST. It can be used to synthesize a keypress but not replace one, unless you install/purchase one of the now many addons. At least that has been my experience on the NST. I played around with one of the addons when I was working with the CM 11 ROM for the NST. They work more or less as advertised but there are some issues with buttons that were unexpected. Also, you are left with Tasker running in the background all the time. That's one reason I've chosen to convert all my Tasker routines to apps (AppFactory is free, unlike Tasker). It also makes them easy to share with people who do not have/want Tasker. But, in the scenario you describe, I don't think you could pack all that up into an app.

I must admit that the lack of control over the hard and soft buttons is a deal-breaker for me. I've been spoiled by the NST in this respect, and others.
[Nook Touch General] Windsor1959:
Part of me wonders if trying to get the page turn buttons to work on third party apps is worth the effort. Another part of me is thinking that if I manage to do this - however I do it - I will have learned more about Android and my Nook in the process.

I'd be happy to try out your NookTouch Mod Manager on the GL4 and see if it will still work. We may be pleasantly surprised. The stock reader hasn't changed much in appearance since the early days, so who can say?

I'd be happy to find a simpler solution to my scenario. I doubt that I would use Tasker or Xposed for anything else. The button remapping apps that I have seen don't appear to be able to do what I'm looking for.
[Nook Touch General] Windsor1959:
The other possibility is to find a way to remap the three apps I am looking at to accept page up/page down commands. That could be easier.
[Nook Touch General] nmyshkin:
If you could extract and post android.policy.jar and services.jar from system/framework I'll take a look at them tomorrow. I was going to see if the old app would even install on my Oreo tablet but the developer doesn't seem to have posted the compiled app, just the components. I'll check that tomorrow also when I fire up my PC.
[Nook Touch General] Renate:
It easy to hack 3rd party apps because you can just resign them without any consequences.

That's what makes things a bit more difficult with B&N readers, they are priv-apps.

Changing the framework to fix an app is crazy.

If you mod the app then a system updates will not require any changes.

Just decide what you like, PgUp/PgDn or VolUp/VolDn or F9-12 for all I care.

Then stick to it.
[Nook Touch General] SJT75:
I sort of remember that at least on NST they had strange codes registering in hardware for side buttons and that created a lot of problems as it was out of standard or not mainstream accepted way of doing things. Did they abandoned those strange ways or still sticking to it?

If they still sticking to a doubling the side buttons on device it is little archaic. I bet that they could from start make buttons to be registered as separate and make customization part of the rotate/flip kind if the allowing right/left handed user to be happy with it was the goal.

I am with Renate on this one. Modding the app makes more sense for device that is bound to receive OTA updates in the future.
[Nook Touch General] Renate:
Yes, but the Glow buttons (for a while now, Glow2, 3, 4, new Glow) are F9, F10, F11, F12.

It makes sense to modify that in /system/usr/keylayout/Vendor_0001_Product_0001.kl

key 116 POWER
key 102 HOME

key 191 APP_SWITCH # top left
key 192 PAGE_UP # top right
key 193 BACK # bottom left
key 194 PAGE_DOWN # bottom right

(Those are my choices.)
[Nook Touch General] SJT75:
That is good to know! Is it that also .kl file that could be modified to achieve short/long press functions? Button combo action would also be nice but I am not aware it is possible on NST.
[Nook Touch General] Renate:
Short/long is part of framework (if implemented at all).

I took it out of my Onyx Poke 3 because it made page flips occur on release of the button.

(Obviously you can't differentiate long/short until they release.)
[Nook Touch General] SJT75:
Thanks Renate! It make sense what you wrote. I was under impression that function works on lower level because in theory power button have short/long press although people complain that it works funky sometimes. I am more and more impressed with this GL4 you describe here. Now I have to find money and way to purchase it as I do not see an option of shipping outside of USA in the web shop.
[Nook Touch General] nmyshkin:
There are lots of kinds of crazy. This whole conversation is "crazy" to any number of people who might buy/use the GL4 as-is. What a thought!

So if patching a couple of jars is more crazy than editing a .kl file (which will also be overwritten in an OTA) then it can be uncrazied easily since ADB is always there to push the patched files back into place. It's my understanding that is how some people prefer to do their updates, in any case :) And how often are OTAs expected?

I personally find the use of analog buttons to turn pages "crazy". Too much energy expended on a mechanical device which will eventually wear out. A simple, gentle tap on the left or right edge of the screen suits me.

But. The buttons are valuable--to some of us--for other potential uses. Being able to use the buttons for other tasks, even non-keyboard tasks, might be just the kind of crazy for which someone is looking.

FWIW, the old NTMM app installs on my Oreo tablet, although it's difficult to know what all of the GUI looks like since it stops at the opening screen and complains that the patched jars have to be installed. There might be potential there.
[Nook Touch General] Windsor1959:
From the crazy files:

Attached is services.jar. Android.policy.jar is not in system/framework. Could it go by another name in Oreo?

Whatever you - or anyone else - can do with this will be good. Getting the page turn buttons to work with a couple of reading apps is not the be-all and end-all of my life! Still, if it can be done without sacrificing one's firstborn, so much the better.
[Nook Touch General] nmyshkin:
Since my Oreo device is not rooted (can't even get Magisk going so my familiarity with that whole universe is by name only) I have no way to poke around and see. But, by looking at the patches for android.policy.jar I can see that a few are non-essential (things to do with controlling the lock screen behavior) while others are very important (capturing button presses, timing for long-presses, etc.).

So that's that. As I had suggested earlier, probably not adaptable to the GL4. Way too many electrons gone by between Eclair and Oreo.
[Nook Touch General] Renate:
A keylayout is a 6 line, unsigned text file that will have validity for the forseeable future.

Since you just put it in your Magisk module directory you'll never have to touch it again.

Getting into modding frameworks and/or add some random tool is overkill.

Moreover, nobody has checked yet if PgUp/PgDn don't work correctly on the stock or 3rd party readers.

It's easy enough to check:

$ input keyevent 93
$ input keyevent 92
[Nook Touch General] SJT75:
Keyboard layout is possible to edit in simple editor. Framework .jar files I do not know where to start at this moment I am sure it is doable yet I doubt it can be done with such simple tool. I do not see updates per se as problem they keep the device updated and running it is the bloody lack of control over it that I have trouble with. Simple notification that there exist new update would be fine so that we can choose time, place and method of applying the update (OTA or over USB).

Buttons are physical but not quite analog. It is in essence digital or binary change of state from zero to one. You can argue that we could call short/long press "analog" since there exist some reference measure of time duration against the clock though. I agree mechanical buttons can wear out yet we all prefer mechanical keyboard because we are all "crazy" :).

Also Renate is it possible to define in .kl file button combo like home+top_right does something like toggle through active apps (I am inventing action out my a** here does not need to be that)? Or that one must be done in framework?
[Nook Touch General] Windsor1959:
Both keyevents work correctly in Librera and KOReader on the GL4. That's encouraging!

Edit: Of the app I've installed, these inputs work with all but one of them. That one is unique in a number of ways in its setup, so that is not surprising.
[Nook Touch General] SJT75:
Those are two excellent e-book reader applications. I heard also that Moon+ is very good and by looking the description it is but I can not confirm as I did not use it. Just hack/modify the app that fail to accept the button input and all will be just fine.
[Nook Touch General] Windsor1959:
I've never worked with modifying apps before. I'm guessing that this involves first decompiling the apk, then doing the editing, and then recompiling and signing the apk. I am also guessing that there are tools I can use to facilitate this process. I have a Mac with an M1 chip, but I also have Windows and Ubuntu VMs. My googling has unearthed references to apktool. Would you recommend that, or are there others?

If I recall correctly what Renate said (either here or on Mobileread), the modifying I'll need to do is found in the smali files.

I also haven't written a keylayout before. It sounds short and simple. I know I want to associate keyevent 93 and keyevent 92 with the appropriate physical buttons. But I don't know quite how to put it in code. Google searches aren't helping me, for some reason!

Yes, Moon+ is very good as well.
[Nook Touch General] Renate:
If you're talking about the new Glow, the text I posted will work fine for a keylayout.

Yes, apktool is what you want. That's Java so it runs on everything.

When it comes to boot and recovery images I use some of my tools in Windows.

I also patch kernels and ELF executables.
[Nook Touch General] Windsor1959:
I am taking the scenic route through not one, not two, but three OSes! Apktool won't work on my Mac because I can't touch usr/bin (where apktool is supposed to go) due to security measures in newer versions of macOS. Apktool won't work on Windows because it doesn't like the file/folder setup for some reason. My guess is that this has something to do with this being a Windows VM with a fair amount of integration with macOS. Apktool installs and runs fine on Ubuntu, however! I downloaded a previous version of an apk of one of the apps I have installed to try this out. The apk decompiled as expected.

Next steps: (1) Figure out where in the decompiled app I can find the place where I would make the needed modifications for the app to work with my page turn buttons; (2) find out where my Magisk module directory is located so I know where the keylayout goes. I can't find any place on in the app itself where we could access that directory.

That's enough for this evening! If anyone can help me with my next two steps, feel free! Thanks again, as always!
[Nook Touch General] Windsor1959:
After running into a number of walls, I finally found something that gives me what I want on my GL4! I tried out Renate's button settings, which did the trick for my third party apps, save one. That had the effect of eliminating F9-12, which meant that the buttons no longer worked on the Nook stock reader. After trying a number of options, I found an app that works very well with this Nook and brings added options if you have root. It's called Key Mapper. That app gave me the ability to make a long press of a button simulate a tap on the screen. That did the job for that lone third party app and works fine for the Nook stock app. I stayed up later than usual, but it ended up as a success. Wednesday is a quiet day for me anyway, so that works fine.
[Nook Touch General] SJT75:
I like that Windsor1959 solved its problem. I know about Key Mapper and have installed it once on another device but have see no point in using it and frankly forgot about it. However I am curious how exactly changing keylayout disabled buttons to work in Nook stock reader. That should not have happen if I understand the way how this work correctly. Any thoughts about this?
[Nook Touch General] Windsor1959:
My best guess is that the Nook stock reader is designed to look for button input from F9-F12. Nothing else that I have seen assigns these values to the buttons. When I switched to keys 191-194, as Renate did, I canceled out the F9-F12 commands, assuming that this would confuse things. That caused the Nook stock reader to no longer recognize button input. Renate can comment on this, but that's how it looks to me.
[Nook Touch General] nmyshkin:
Can I infer from this that the NGL4 has functioning Accessibility settings?
[Nook Touch General] Renate:
Mmm, I've been so busy on other stuff that I haven't even looked at the stock B&N reader.

Normally an app tries to make sense of any buttons it get. I accept PAGE_DOWN, MEDIA_NEXT, VOLUME_DOWN as page turners. I probably should add DPAD_DOWN to that too in case I want to you a PS4 controller as a remote!

The new Glow has a setup where you can swap the sense of the buttons. I'm not even sure if they are always mirrored, i.e. there are only two commands that you can send.

So, yeah, changing those buttons has apparently broken the stock reader page turn. If the buttons are used by B&N only in one specific application (the reader) then you may be able to patch it easily. If they are trying to use those buttons in settings and other usages it might take a bit of work to change everything.

Accessibility settings are in the Android settings. What specifically?
[Nook Touch General] Windsor1959:
Yes. That app would not function properly without those settings. I can access them by using the alternate launcher I have installed and tapping on Settings there. The Accessibility settings cannot be "accessed" from the Nook stock launcher.
[Nook Touch General] Windsor1959:
Seeing that the Key Mapper app has allowed me to use the buttons in the stock reader, I'm fine with my setup as it now is. With Key Mapper, I have set up the buttons to simulate screen taps in the stock reader with a long press of the appropriate button. That tap simulation also solved the problem for my one third party app that didn't respond to the changed key codes as you have them in your device. I don't see the need to put in the time/work to seek another solution!
[Nook Touch General] Windsor1959:
If anyone is interested, there's a forum on that app here: https://xdaforums.com/t/free-open-source-keyboard-button-mapper-no-ads-4-4.3914005/
[Nook Touch General] SJT75:
key 116 POWER
key 102 HOME

key 191 APP_SWITCH F9 # top left
key 192 PAGE_UP VOLUME_UP MEDIA_NEXT F10 # top right
key 193 BACK F11 # bottom left
key 194 PAGE_DOWN VOLUME_DOWN MEDIA_BACK F12 # bottom right

Could something like this do the job? I forgot should it be separated by comma or semicolon or slash.

Also can kaylayout define something like key 102+ key 192 toggle app or bring settings or start glowlight or anything.
[Nook Touch General] Renate:
Sorry, no. It's all a bit complicated.

In the case of a USB keyboard (I know that's not the case, just an explanation.):

You hit the A key. That generates a USB HID usage page 7, usage 4. (The codes 5, 6, 7, 8 are B, C, D, E)

That gets translated by the HID driver into a Linux scan code of 30. (The codes 31, 32, 33, 34 are S, D, F, G)

That 30 is the left column of some keylayout and it gets translated to a single Android keycode of 29. (The codes 30, 31, 32, 33 are B, C, D, E)

That result gets fed into a keychars and depending on shift keys could be upper- or lowercase A.

Now, usually those left hand column numbers are the Linux scan codes, but they don't have to be. I made a hardware key injector and it used 1, 2, 3, 4 as codes. The hardware (or GPIO) keys on all the Nooks have always been arbitrary numbers based on some X/Y scanning or GPIO banks.

Also of note, the usual Linux auto repeat settings are set off and the auto repeat is done inside Android (which usually doesn't have settings).
[Nook Touch General] nmyshkin:
Here's what I hope is my last annoying question about the GL4, and I think it has to go to @Renate.

What about A2 mode (if that's still a thing)? Can it be invoked/sustained on this device? Any application involving scrolling or panning is made hugely better by using this display mode, IMO.

So.....?
[Nook Touch General] Renate:
Mmm, I haven't seen any user controls, but I've hardly touched any of the stock features. The Onyx software had many user controls on a per-app basis. It also subclasses standard scrolling views so that it does a full update after you scroll. Unfortunately what I see is that it uses a timeout? A half second after you quit scrolling the screen refreshes. Or maybe it's doing it directly after you pull your finger but the delay is inherent?

Edit: I've been working more on adding rooted ADB to the stock recoveries on the new Glow and the Onyx Poke3. I don't know why they don't make that standard. I've managed to get rid of a ton of that gobble-dee-gook in init.usb.rc, init.usb.configfs.rc