yashsingh1/xdaforums huggingface dataset:
[Nook Touch General] SJT75:
OK. We can at least for NST say with certainty that pressing both lower side button that trigger factory reset are on hardware level treated as two different input which I presume are read as states of reserved/fixed memory addresses by boot loader in that case. Aside from B&N choice for key mapping there should have be nothing to prevent us to exploit the same approach. Unless those hardware inputs are not later during Android boot up transformed from fixed memory addresses maps to something more like dynamic links I still think there is a way to exploit it. Gee I hardly remember when was the last time I used assembler command.

I guess that we can safely assume that key combo input is theoretically possible question is how reliable/needed it can be.

My idea is that key layout should allow the input to be app specific in a meaning that screen/front running application gets hardware key input goes through the table and see what of the- codes are understandable / specific for them and act according to it. On another hand that might be a problem when we have multiple running apps like browser or reader and radio or audio player. In this case PAGE_DOWN/VOLUME_DOWN input would act on both apps running and that is not acceptable. That is certainly something to think about. I like what Renate have wrote about how Onyx have approached that problem.
[Nook Touch General] Renate:
Yes, u-boot often has multiple hardware key detection built in. Yes, Android often has goofy combinations for screen grab or bug report builtin. No, the only purpose of keylayouts is to map single scancodes to other (or the same) single scancodes. If you want you could certainly write something in Java to allow Morse code to be input on a push button.

When I mentioned user controls and the Onyx per-app user controls I was referring to Eink display modes, not physical controls. I would think that people would want physical buttons to do basically the same thing with any app. I would. Foreground apps get the first chance to "eat" keystrokes. If they are not consumed it goes to the system. There is no standard way to check background app if they want the leftover keystrokes. Yes, there are ways and things to do. I had a foot pedal interface that did not go though the Linux/Android input system. It directly received Bluetooth and sent out broadcast intents. Any app that implemented the corresponding broadcast receiver could grab the push button intents, even if it were in the background.

It's easy to come up with some complicated scheme for pushbutton control but in the end you only have 4 buttons. Unless you want to write a bunch of code and modify I bunch of apps, I don't know what the point is. If you are building a car system, fine, put in a USB interface with 20 buttons, modify all your apps to use broadcast receivers and then you have nice dedicated buttons that will work directly on apps even if they are in the background.
[Nook Touch General] Windsor1959:
From the "why not try?" department -

Last night, I tried to install Google Play...

I installed Google Account Manager, Google Services Framework, Google Play Services, and Google Play Store. I then rebooted my Nook. Once my Nook fully rebooted, I was greeted with a continuous stream of popup windows telling me that one or the other had crashed. It may not be possible to install Google Play on this Nook. Or, I may have to tweak some things if it's going to work. In any case, I deleted the Google apps for the time being. Getting Google Play on my Nook isn't a biggie for me, so it's not worth a whole lot of time and effort, but it would be convenient if I found a way. Moreover, others may be very interested if a way could be found to do this.
[Nook Touch General] nmyshkin:
I suggest microG and perhaps the Aurora store or Yalp store fork. You can get some idea of the microG installation by following the link in my signature. There may also be a Magisk module out there.
[Nook Touch General] SJT75:
:D This put a smile on my face because as kid I did make some Morse code programs. I doubt that they are still around my house but in case they are...will BASIC run on this one? (joking)

Nice to see that at least part of my idea is possible although since it can not be standardized is bound to realm of futile experiments.

If you remember earlier in this thread I supported your position to modify apps instead of OS. All this later posts are more of a academic discussion of "what if...then" type. Since you said that short/long press are something to be set inside framework and that you disabled that since it slows the reaction on buttons since it actually detects release of a button I asked myself could two-button approach replace it without lag in reaction because in theory we could make that to act on button press not release. After realizing that to has to be done somewhere in framework I am more then willing to abandon that idea because most likely if I try that will broke something up. Consider that topic closed.

Windsor1959 thanks for trying even if I do not approve that way because it is always good to know what is possible and what work on the device. Most e-book consumers do not like walling inside the garden (Amazon) or tracking reading habits (everyone on the map) so bringing into that heavy weight tracking champion of the web will not have lot of followers. Most of us wants just to lay back and read book maybe sip some wine. :)

I think that as far as app installation goes nmyshkin is right microG and Aurora store are way to go on modern Android devices. I am also interested about way screen work/responds still I do not understand why scrolling is of such importance? Isn`t page down good enough? I think it can be set in some browsers to go to down 75% of screen length or something.
[Nook Touch General] Windsor1959:
I don't plan to have many apps on my Nook. What I would like is the ability to update my apps from my Nook and the ability to install apps I have paid for from another device on my Nook and have those apps "think" that they are connecting to Google Play Services so they will function on the Nook. If any of these solutions can do this, I'd be interested.

I'm not so sure about using my Google user name and password on any such option, though. Would that be necessary or even secure?
[Nook Touch General] nmyshkin:
Well, that was a quick breakfast reply. Here's a little more.

There are perhaps 3 levels of "need" or "desire" in this, increasing in complexity and demand on the device.

1. Easy access to PlayStore apps.

This can be accomplished with either the YalpStore fork or the Aurora Store (both from F-droid) and no other changes. The YalpStore fork is friendlier to e-ink devices. Depending on the diligence of the developer, these might be up-to-date enough to successfully log in anonymously. I found that this could even be different with different ROMs. So you just need to try. When that was not possible, I opened a Google account for the express purpose of logging in to these apps and nothing else.

Drawbacks: I don't think you can purchase apps or do exactly what you describe above. I might be wrong about the Aurora Store. The biggest drawback is that many apps demand the presence of GSF (Google Services Framework) and refuse to run without it. That takes us to the next level.

2. Spoofing GSF without GApps

This is what microG was intended for. At its most basic level of install it allows apps that demand GSF to run without complaint--there's no login to Google, so no "risk" to you. It can also provide Location services through third-party back-ends. It is light on system resources (unlike GApps). It can be escalated to provide Google account sign-in on the device to allow running various Google apps like Books, Drive, etc. Still less system overhead than GApps. This is not its reason for existence, but it does work, except for Contacts and Calendar (although there is an older version that still works for Calendar).

3. Gotta have Gapps

Well, you can't install GApps by putting a bunch of apps on the device. It's much more complicated than that. Typically a GApps zip is flashed from recovery. There may be a Magisk module for doing this sort of thing. A pico package from OpenGapps is definitely the way to go, if you must. My guess is that you would regret it.

For sure, if you pursue either 2 or 3 you really need some way to make a nandroid backup before you start. @Renate may know if her recently updated noogie application will work for the NG4
[Nook Touch General] Renate:
+1

I've got Wilkie Collins, "The Dead Secret" (1873) and a cabernet sauvignon.
[Nook Touch General] Windsor1959:
Don't need GApps for my Nook. Besides, trying to install GApps without TWRP would not be pleasant! I found the Aurora Store forum in XDA. I've looked at the OP and some of the posts. I don't know if it will spoof apps into thinking that GSF is there. It looks like microG might be the way to go.

Of course, I can always try Aurora and see if it will work for the apps I want on my Nook. If so, problem solved. If not, then microG.

Thanks!

Edit: Turns out that microG needs signature spoofing to be fully effective. I'm not sure if any of the signature spoofing hacks on offer will work on this device - certainly not without still more time and effort. I think I just want to read for a while!!

Edit #2: Using a signature spoofing hack requires that I can do adb pull/adb push for files out of and into the system directory. This requires running adb as root, which the Nook isn't set up to do. That option isn't in developer options. There are hacks for this, but they work either for older versions of Android or for Pie and up. It's the domino effect, in a sense! To do a, I must do b; to do b, I must do c; and so forth. I'm learning more about Android, but I haven't lined up every necessary duck yet.
[Nook Touch General] SJT75:
Just read on reddit that new patch for Calibre incorporate driver for GL4. That was darn fast if you ask me. Since I do not have device can not check that one out myself but thought you might be interested to know.
[Nook Touch General] nmyshkin:
There are two methods that I know, one using an Xposed module (FakeStore). The other runs a Python script via adb (with root) to make the change allowing signature spoofing.

If you're still going duck hunting, don't leave without a Google search: https://github.com/Magisk-Modules-Repo/microG_installer

I'm sure there's more out there.
[Nook Touch General] Windsor1959:
The driver works. I checked it out. In fact, I requested it on the Calibre Mobileread forum the day I bought the Nook!
[Nook Touch General] Windsor1959:
I've done the microG installer for Magisk. That installed fine. But microG requires signature spoofing for some of its features. At least two of the signature spoofing hacks require ADB root access. I have root, but not ADB root. I need to get ADB root to do the signature spoofing that will allow microG to function fully. Thus the domino effect. My quest now is for a way to enable ADB root. If I get that, all the dominoes fall into place!

That's where I am now.
[Nook Touch General] Windsor1959:
Signature spoofing works only on custom ROMs that have that feature enabled. It doesn't work on stock ROMs. Besides, it seems that the only way I might be able to have ADB root is to unpack boot.img or recovery.img and change the ro.debuggable setting there. If I change that ro setting in build.prop or default.prop, the changes are overridden when the device reboots.

I don't think that messing with either boot.img or recovery.img is something I want to do. I've learned a few more things in the process, so it hasn't been a waste of time. But it looks like my quest for a fully enabled microG ends here.
[Nook Touch General] SJT75:
I do not know about root but as far as ADB my money is that Renate will get there. She do not care about root yet she likes to have ADB enabled on her devices
[Nook Touch General] Windsor1959:
I've settled upon a solution that will take care of what I want to do on my Nook, at least for the time being. : )

I'm using Aurora Store for any free apps I want, and Amazon Appstore for the couple of paid apps I want.
[Nook Touch General] Renate:
I don't know what this great new Calibre modification was, it seems to me to be just adding the VID/PID 2080/000d to all the others.

I don't know anything about Google Apps or system compliance or spoofing.

Isn't su over ADB on a Magisk'd system good enough for what you want?

Yes, I have:

ADB

with root

without authorization (for recovery)

kernel

with permissive

with exploitable

usbcfg - adb setup without init.usb.rc, init.usb.configfs.rc for recovery or even boot
[Nook Touch General] Windsor1959:
It's simply my usual pattern when I get a new device. I spend some time finding out what it can do and what I can get it to do, even if some of what I try may be more than what I will actually need or even want for my own use. Once I've done that, then I feel that I know the device and can settle in and simply enjoy it for what it is.

Think of a cat that happens upon some new kind of food or a place where it might take a nap. That cat may sniff around, walk around it, leave, come back, and finally decide to eat it or nap there (or both). My brain works like that!

I'm pretty close to the point where I can just settle down and enjoy this Nook. I had the GL3 and I already like the 4 much better.

I have root with Magisk, a working ADB, and the apps I want on the GL4. I may think of some other app, but my 4 is pretty much where it will be.

As for the Calibre driver - for people who use Calibre and will use the GL4 as B&N intended (yes, VID/PID in all its 'glory') - this driver allows Calibre to connect with the GL4 and for the user to transfer books from Calibre to the GL4 with little fuss. Those who don't use only the stock reader may have little need for this driver, but even for them, it's a convenient way to connect the Nook with Calibre.
[Nook Touch General] Renate:
I was working on adding some options to stock recovery. The really difficult part is the graphic layout.
[Nook Touch General] SJT75:
I understand that Calibre is single man project. So to add support for new device on the market in few weeks after the release deserve respect in my book. Calibre is very good project. Its a bummer that it does not support full integration for ancient device as NST because of its 2.3+ Android requirements for that so its kind a shame B&N did not pushed at least OS upgrade to 2.3 before ditching the NST on the sidewalk.

Windsor1959 I respect your line of reasoning. Had ereaders were more accessible in my country I would probably very much do the same. Just remember whatever you do try to make it not interfere with expected upgrades/updates from B&N. At least we can hope that with project trebble even enthusiasm of the ereader community can push it up to Android 10 version even if B&N does nothing to further support this device.

Renate once again your work never stops to amaze me. Hat off to the master!
[Nook Touch General] Renate:
I'm almost getting ready for an Alpha or so:

C:\>sdcard /r g C:\nope
SD card G, disk #3, 31,293,702,144 bytes, 512 sector size
C:\nope
Copy SD card G to image (Y or N)? n
Aborting

("SD card" is the UMS mount of the new Glow.)

I just had to hack the kernel, init, adbd, write a new utility and adjust a few files in the ramdisk.
[Nook Touch General] Windsor1959:
This is looking good! I'd be happy to try it out as a tester once you have something that's ready for it!
[Nook Touch General] Windsor1959:
@Renate -

Feedback on your recovery hack!

The buttons appear to be working correctly. When I press the "No USB" button, I lose ADB connection. Pressing the "ADB" button restores ADB. I haven't had occasion to see if the other two work as advertised. "Reboot normally" brings me back to my launcher after a long press. That button seems a bit finnicky. It may take two or three tries.

When in recovery mode, ADB root is working. ADB root isn't working in normal mode.

Rebooting to recovery - adb reboot recovery - brings me back to your menu.

Pressing the Home button when in normal mode does what it always does - gives me my two launcher options first. It does not restore factory recovery. I can reboot back to your recovery menu.

Looks pretty good!

Anything else you want me to try?
[Nook Touch General] Renate:
The Home button in recovery should at least give you the option to wipe everything.

If you select UMS in recovery it will give you a chance to save 32 GB of data on your desktop.
[Nook Touch General] Windsor1959:
I'm on my Mac now, if that makes a difference.

When I click either of the UMS buttons, I get a popup window telling me that the disk I attached is not readable by this computer. When I choose the "ignore" option, the popup goes away but I still have adb access.

When I press the Home button, the next screen asks me if I'm sure I want to wipe everything.
[Nook Touch General] Windsor1959:
Switching to Linux...

Pressing either of the UMS buttons shows me seven volumes in the Files window: two 17MB volumes, one 29 GB volume, one 537MB volume, system, vendor and Volumn. All else is the same!
[Nook Touch General] Windsor1959:
Switching to Windows...

Pressing either UMS button shows no effects.
[Nook Touch General] Renate:
Well, when I hit a UMS button when connected to Windows I get a zillion popup windows offering me to format things.

In any case, there really is only one 32 GB raw volume shared. As I showed, you can read/write that.

The MIDI is more a joke/proof of concept.

diskmgmt.msc or diskpart.exe will show you more stuff on Windows.

(In diskpart, stick to the "list" command.)
[Nook Touch General] Renate:
So? Did you find it on Windows? Have you tried using UsbView.exe?

Did you see 08:06:50 for class/subclass/protocol?
[Nook Touch General] Windsor1959:
Yes to all of the above. The Nook shows up in usbview.exe. Attached is what I find...

I don't see 08:06:50 for class/subclass/protocol his time. The first time I tried, I thought I saw that after I pressed the ADB,UMS button but not when I pressed the ADB button...
[Nook Touch General] Windsor1959:
I don't see my attachment. I'll try again.
[Nook Touch General] Windsor1959:
Once more...
[Nook Touch General] Windsor1959:
Maybe now?
[Nook Touch General] Renate:
08:06:50 is UMS (mass storage). You said that you weren't seeing it.

ff:42:01 is ADB
[Nook Touch General] Windsor1959:
First time I use USBView! I'll have a better sense of what I'm looking for next time...
[Nook Touch General] Renate:
Oh, I remembered why Windows is balky on the UMS.

Windows (unlike other OS'es) caches USB configurations.

Sometimes it loses its mind when something with the same VID/PID shows up with a different number/different types of interfaces.

That's why Google does all that stuff with 18d1/(4ee0, 4ee1, 4ee2, etc).

I'll make some different VID/PID for that.

Sigh. Now if I could only stop Windows from offering to format everything.
[Nook Touch General] Renate:
I've been working on a tiny wrinkle on the whole USB configuration bit. It's the question of configuring the USB while you're connected over USB. It's a bit like sawing off the tree limb that you're sitting on. Sure, it's going to disconnect, but you have to make sure that the disconnection doesn't disturb the ongoing reconfiguration process. Ok, it's easy to just throw another service or trigger in init.rc and I may end up just leaving it at that. Still, I eventually figured it out. A bit more polishing and I'll have something for general use.
[Nook Touch General] Windsor1959:
I'm interested in seeing what the polished product will look like!

A question about your "flash factory image" option. Is it exclusively for factory images, or could someone also flash add-ons, such as a Magisk module, using this option?
[Nook Touch General] Renate:
The recovery is just the stock recovery with a few more options thrown on.

You can always flash things using dd in ADB or fastboot.

The buttons work fine, the biggest change is that you can configure the USB from the USB.

C:\>adb shell
# usbcfg 18d1 4ee0 midi,adb
... disconnect ...
C:\>adb shell
#

I've got to work on making the mounts easier/possible.

But if you want to extract boot.img for magisk, that's easy:

# dd if=/dev/block/mmcblk0p4 of=/p4
# ^D
C:\>adb pull /p4
[Nook Touch General] Windsor1959:
I've installed your new p8mod. Everything, including UsbView, responds as the first version did.

Is there anything in particular that you'd like me to test/try?
[Nook Touch General] Renate:
Nah. I'm just wondering if I should figure out the permissive errors or fix the fstab before I make it more generally available.
[Nook Touch General] sergzver85:
Can you please tell me why Dropbox is not working?
[Nook Touch General] Windsor1959:
Though I don't need boot.img now, I tried the method you gave to extract boot.img. I went into your Neo Noogie recovery and then into adb shell. The first line seemed to work as expected. When I entered ^D, what came up was /system/bin/sh: ^D: not found

Did I miss something? I'm only trying this out in case I need to extract boot.img in the future. Thanks!
[Nook Touch General] Renate:
There is something strange going on where the ADB shell gets locked up somehow. Wait until the menu shows up on the screen before trying to connect to ADB or typing at it.
[Nook Touch General] Windsor1959:
Thanks. I'll give that a try. I've noticed these ADB hiccups occasionally.
[Nook Touch General] Windsor1959:
ADB commands seem to work better on my Ubuntu VM than on my macOS Terminal. I don't know why that is, as I have set things up on my Mac for ADB and fastboot!

Another question: other than keeping WiFi off as much as possible, is there a way to prevent the Nook stock firmware from updating? There was an automatic update today, which means I needed to re-root with Magisk and edit the keylayout once again. It's not a big deal, but it would be good to disable automatic updates. Turning WiFi off except when needed may work, but that would only delay updates and not stop them.
[Nook Touch General] Renate:
Here you go:

pm disable com.nook.partner/.oobe.BlockForOtaActivity
pm disable com.nook.partner/.otamanager.OtaIntentService

To check your handwork:

dumpsys package com.nook.partner

What you want is at the end of the listing, "disabledComponents".

I went looking for something. Have you seen this? It's not the normal B&N settings, is it? I just use the stock Android one.

$ am start -n com.android.ntxsettings/.NtxSettings

Most of it seems broken, but that may be my fault.

There is "Erase Deregister Device".
[Nook Touch General] Windsor1959:
I tried the NTX settings code you gave first. That brings up a list of settings almost identical to the Quick Settings you get in stock Nook by tapping the upper right hand corner - only those settings work and these seem mainly broken, as you say.

Edit: By the way, your instructions on disabling automatic updates appear to have worked just fine!
[Nook Touch General] fasterpy:
@Renate Can I ask where I can get TRWP recovery images or root guides for new nook glowlight 4? I'm searching for this thread but I can't find your link
[Nook Touch General] Renate:
Mmm, there is no TWRP recovery.

Oh, I forgot that I did have a recovery. I just blew the dust off it and uploaded it.

It's on the NeoNoogie page from my signature.

It gives you rooted ADB and even UMS if you want it.

Warning, don't hit the home button when it says "Flash factory image!" unless you mean it.
[Nook Touch General] Windsor1959:
If you need a root guide, check out this post. Different name, but it's also me! There's no TWRP for the GL4 yet. However, Renate could have something brewing. We will see.
[Nook Touch General] fasterpy:
@Renate Thx I got installed magisk and I made my own keymaps. BTW I want to use Gboard instead of stock nook softkeyboard, but I think some nook system bloat app somehow blocking and reverting settings to prevent use of other keyboards. When I set Gboard to default keyboard, then gboard gets disabled in keyboard config and nook softkeyboard becomes default again. Can there be a workaround here?