07-03-2022, 07:00 PM | #1 |
Enthusiast
Posts: 38
Karma: 58
Join Date: Jan 2019
Device: Kobo, Kindles, Sony DPTs, QQ-Read
|
How to open NeoReader (and Notes app) using adb?
I recently noticed that the OneNote app is finally usable on Lumi 2 (palm rejection has been improved in 3.2.3), and looked for ways to "send" a specific OneNote page to Lumi 2. I ended up learning a bit more about adb, and the solution is here.
Now, I'd like to look into more possibilities to use the Boox tablets more efficiently. Namely, I'm looking for ways to activate certain programs via adb. Per my limited experience, I'm completely lost. (Well, I tried to look for the list of apps using "adb shell pm list packages", but then was not able to find, say, the NeoReader app.) Please advise if there are quick ways to open (or switch to) the following apps over adb connection:
To make this post future-proof, let me ask another obscure question: are there more precise ways to interact with both the Notes app and the NeoReader to achieve the following?
Please excuse me for posting all these overly demanding requests here. Compared to contacting Boox and learning again how ignorant they are towards these types of requests, I consider this forum as the most productive place to discuss those things. (Well, to play it fair, I'll ask the same four questions to Boox support on push.boox.com, and see how they respond.) |
07-04-2022, 09:42 AM | #2 |
Onyx-maniac
Posts: 3,205
Karma: 12537601
Join Date: Feb 2012
Device: Nook NST, Glow2, 3, 4, '21, Kobo Aura2, Poke3, Poke5, Go6
|
Don't send 26 (Power). Send 224 (Wakeup). FWIW 223 (Sleep).
|
07-04-2022, 10:51 PM | #3 |
Zealot
Posts: 110
Karma: 120918
Join Date: Nov 2013
Device: Onyx Boox Nova
|
This adb shell command should open the NeoReader
Code:
am start -n com.onyx.kreader/com.onyx.kreader.ui.ReaderHomeActivity Last edited by winstonma; 07-06-2022 at 03:00 AM. |
07-06-2022, 12:38 PM | #4 | |
Enthusiast
Posts: 38
Karma: 58
Join Date: Jan 2019
Device: Kobo, Kindles, Sony DPTs, QQ-Read
|
Quote:
Though, how did you figure out the "/com.onyx.kreader.ui.ReaderHomeActivity" bit? When I went into the adb shell, tab-completion never worked, and I wonder what's the proper procedure to "discover" the proper command to issue. Oh, one funny thing - I also tried to contact Boox support asking them to complete the list of intents. They asked me to read their GitHub repo for the SDK instead ... lol |
|
07-06-2022, 01:17 PM | #5 |
Onyx-maniac
Posts: 3,205
Karma: 12537601
Join Date: Feb 2012
Device: Nook NST, Glow2, 3, 4, '21, Kobo Aura2, Poke3, Poke5, Go6
|
You can disassemble using apktool. It will show you the AndroidManifest.xml
I use my own binxml.exe to get a quick look at AndroidManifest.xml without doing a whole disassembly. It shows it as a tree instead of literal XML. (This is somewhere around 3.2.2) Spoiler:
|
07-06-2022, 01:33 PM | #6 |
Enthusiast
Posts: 38
Karma: 58
Join Date: Jan 2019
Device: Kobo, Kindles, Sony DPTs, QQ-Read
|
Now I see where the magic string "com.onyx.kreader.ui.ReaderHomeActivity" came from.
Just to confirm: 1. That the scope of the long formatted XML content in "spoiler" are meant solely for NeoReader? I did a quick search and did not find any mentioning of the "save" feature. 2. And, before using apktool, I need to get my hands on the apk file first? Lastly, to draw apk from the device, I need to root the thing, am I right? If so, I really appreciate the help I have received in my Boox related threads thus far! |
07-06-2022, 03:10 PM | #7 |
Onyx-maniac
Posts: 3,205
Karma: 12537601
Join Date: Feb 2012
Device: Nook NST, Glow2, 3, 4, '21, Kobo Aura2, Poke3, Poke5, Go6
|
No, you don't need to root to drag a system/priv-app out into the sunlight.
You do need to be rooted to get a Google Play app out. Obviously, if it's sideloaded you already have it! Usually you can only affect an app through an Intent or an injected keystroke. Whether an app responds to "F7" is not as apparent as how it responds to an Intent. |
07-07-2022, 12:35 AM | #8 | |
Zealot
Posts: 110
Karma: 120918
Join Date: Nov 2013
Device: Onyx Boox Nova
|
Quote:
Code:
dumpsys package | grep Activity | grep com.onyx.kreader Last edited by winstonma; 07-07-2022 at 01:14 AM. |
|
07-07-2022, 06:42 PM | #9 | |
Enthusiast
Posts: 38
Karma: 58
Join Date: Jan 2019
Device: Kobo, Kindles, Sony DPTs, QQ-Read
|
A collection of adb shell commands for activating Note/NeoReader/OneNote
Quote:
* Open the `App Store`: `adb shell am start -n com.onyx.appmarket/.activity.AppMarketActivity` * Activate OneNote: `adb shell am start -n com.microsoft.office.onenote/.ui.EntryActivity` * Switch to Notes (this is not the normal notes interface, but usable): `adb shell am start -n com.onyx.android.note/.note.ui.InsertImagesActivity` * Open "Wiktionary" (or ther search tools) that happens to be part of NeoReaderd: `adb shell am start -n com.onyx.kreader/com.onyx.android.sdk.translate.ui.web.WebQueryWord Activity` (I don't see a good way to typeset inline code, so I kept the raw Markdown markers.) |
|
07-07-2022, 07:42 PM | #10 | |
Enthusiast
Posts: 38
Karma: 58
Join Date: Jan 2019
Device: Kobo, Kindles, Sony DPTs, QQ-Read
|
Cannot write in NeoReader with the adb switch command
Quote:
* Note 1: by "focus", here is what I observe - when switching back to NeoReader for the first time, the whole PDF file will be covered by a grayish color, indicating that the focus is shifted to a UI element that spans the whole screen; * Note 2: upon executing the command for the second time, pen inputs were treated as touch inputs. I tried two ways to launch the NeoReader, but the pen is equally useless in either cases - when NeoReader is summoned with the adb command, the pen won't work as a writing device until I **launch** NeoReader again. 1. With Files by Google, I was able to directly open a PDF in NeoReader. Yet, when I go to the "Recent Programs" view, NeoReader is not there. Though, the adb command was able to recover the viewing session if I revisit it within a few hours; 2. With the native Library tool, I can open PDF in NeoReader for sure. This time, NeoReader 3.0 does exist in the "Recent Programs" view. Still, should I launch the adb command for once, summoning the NeoReader using the "Recent Program" list won't get me pen-input. I need to launch NeoReader again by going back to the Library app and tapping on the file again. Mainly, I'd like to document how things behave on Lumi 2. If there is another adb magic, please let me know. Among the list of programs printed with "dumpsys package", I only find one thing that has to do with "pen" and nothing has to do with "focus". And, this particular entry, "com.onyx.android.note/.note.test.PenTestActivity", is actually for a standalone pen test. |
|
07-07-2022, 08:45 PM | #11 | |
Onyx-maniac
Posts: 3,205
Karma: 12537601
Join Date: Feb 2012
Device: Nook NST, Glow2, 3, 4, '21, Kobo Aura2, Poke3, Poke5, Go6
|
I dunno. Why don't you give it a file to open?
Code:
am start -n com.onyx.kreader/.ui.ReaderHomeActivity -d file:///sdcard/whatever.pdf Quote:
Code:
activity android:name=com.onyx.kreader.ui.ReaderHomeActivity android:excludeFromRecents=true |
|
07-08-2022, 10:31 AM | #12 |
Enthusiast
Posts: 38
Karma: 58
Join Date: Jan 2019
Device: Kobo, Kindles, Sony DPTs, QQ-Read
|
Thanks a lot for helping me understand why there are times when I cannot find NeoReader (or kreader) in Recent Programs view. I assume there should be another activity entry in AndroidManifest.xml, where the NeoReader is set to be visible? The happens when I open a PDF file using the Library app.
Question about opening a file by its full path: I tried three variants for the full path, and I would be stuck with the following view regardless of which spelling of the full path I use. The texts read "BOOX Neo Reader Loading document", with a cancel button. The variants are Code:
am start -n com.onyx.kreader/.ui.ReaderHomeActivity -d /storage/emulated/0/ScratchBox/PDF_2022-07-08-091146.pdf am start -n com.onyx.kreader/.ui.ReaderHomeActivity -d file://storage/emulated/0/ScratchBox/PDF_2022-07-08-091146.pdf am start -n com.onyx.kreader/.ui.ReaderHomeActivity -d file:///storage/emulated/0/ScratchBox/PDF_2022-07-08-091146.pdf Oh, per the lack of pen-input when the NeoReader does get resumed with the previous file loaded, any quick fix? Say, is there something that may switch to a most recent app even when it is not "visible" in the Recent Programs view? (On a Samsung phone, when I summon the Recent Programs view twice, the previous app gets loaded in full-screen mode.) |
07-08-2022, 12:24 PM | #13 |
Onyx-maniac
Posts: 3,205
Karma: 12537601
Join Date: Feb 2012
Device: Nook NST, Glow2, 3, 4, '21, Kobo Aura2, Poke3, Poke5, Go6
|
Sorry, I've just been shooting from the hip because I don't use the NeoReader and I can't be bothered to pm enable it.
It could be that they never correctly implemented the file: scheme and that they only use the content: scheme. Does this execute happily? Code:
am start -a com.onyx.android.sdk.data.IntentFactory.ACTION_EXTRACT_METADATA -c android.intent.category.DEFAULT -d file:///sdcard/whatever.pdf |
07-08-2022, 03:41 PM | #14 |
Enthusiast
Posts: 38
Karma: 58
Join Date: Jan 2019
Device: Kobo, Kindles, Sony DPTs, QQ-Read
|
Here is what I have, after correcting the file path to something that does exit locally. Are we done trying to ask NeoReader to load a specific file? (There should be a secondary challenge that the "focus" is shifted elsewhere, such that the pen tip should act as a touch input.)
Code:
$ adb shell am start -a com.onyx.android.sdk.data.IntentFactory.ACTION_EXTRACT_METADATA -c android.intent.category.DEFAULT -d file:///storage/emulated/0/ScratchBox/PDF_2022-07-08-091146.pdf Starting: Intent { act=com.onyx.android.sdk.data.IntentFactory.ACTION_EXTRACT_METADATA cat=[android.intent.category.DEFAULT] dat=file:///storage/emulated/0/ScratchBox/PDF_2022-07-08-091146.pdf } Error: Activity not started, unable to resolve Intent { act=com.onyx.android.sdk.data.IntentFactory.ACTION_EXTRACT_METADATA cat=[android.intent.category.DEFAULT] dat=file:///storage/emulated/0/ScratchBox/PDF_2022-07-08-091146.pdf flg=0x10000000 } |
Tags |
adb, intent, neoreader, onyx boox |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Open PDFs in neoreader from other software | tdehaeze | Onyx Boox | 9 | 06-14-2020 12:02 PM |
Opening web pages within Notes or Neoreader app? | Faeryink | Onyx Boox | 3 | 11-30-2018 02:03 PM |
Handwritting notes on NeoReader on devices without pen | Germanc | Onyx Boox | 0 | 09-29-2016 08:01 PM |
Neoreader epub notes save location | fuli42 | Onyx Boox | 5 | 04-29-2015 05:42 AM |
How to open pdf file with e-ink reader from the shell/adb? | Regiomontanus | enTourage Archive | 0 | 09-01-2010 12:56 PM |