* Be even more defensive around KoboUSBMS handling in the startup script
And add some more logging. To the log before a session, to the syslog
after, because we can't be sure onboard is viable.
* Display a short version string straight in the Version label
* Move system statistics inside the Help menu
* Move Version inside Help
* Bump base
https://github.com/koreader/koreader-base/pull/1173
* Enable i18n in KoboUSBMS
* Rejig the "No confirmation" USBMS setting:
In now *only* affects the USB plug in event.
The menu entry will never show the popup (clicking on it should already
be confirmation enough, that, yes, we really would like to do that,
please ;)).
Also, enable said plug in behavior on Cervantes, too ;).
* Add an option to disable USBMS entirely
* Bump base
https://github.com/koreader/koreader-base/pull/1170
* Unbreak Wi-Fi on Kobo w/ FX >= 4.23+
Stop relying on WIFI_MODULE_PATH, it's no longer exported by the init
script.
Fix#6500
* Resync the nickel restart script w/ upstream
Let udev handle the SD card, and actually allow nickel to see those events by re-creating the FIFO ourselves, to avoid races.
* Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback).
* Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental.
* Consistently use "Wi-Fi" everywhere.
* On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery.
(i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again).
* Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic).
* restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it).
* We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed.
* Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state.
* Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing.
* Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix#6421
Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results).
* For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
I've played a bit with #6275, to make the iterator available for non-power users too.
this PR automate user data migration (which happens once per update). If the folder `koreader/scripts.afterupdate` contains a file `migrate` then files will be copied to internal dir preserving their relative path. Thus user data **needs** to have the same hierarchy as internal directories.
Shell scripts will be find and run if the folder `koreader/scripts.afterupdate` exists and has no `migrate file`.
In the case of `koreader/scripts.always` there's no migration available, just shell scripts.
Digging a bit seems not possible to create new directories on app internal storage (it just crashes on the emulator since API25). So very fancy extensions are not supported, but it is ok to override files and create new files if dir already exists.
Tested with:
```find scripts.afterupdate/
scripts.afterupdate/
scripts.afterupdate/data
scripts.afterupdate/data/hyph
scripts.afterupdate/data/hyph/Roman.pattern
scripts.afterupdate/data/example.css
scripts.afterupdate/migrate
```
Results:
```
06-20 16:16:33.590 3584 3597 I KOReader: after-update: running migration
06-20 16:16:33.596 3584 3597 I KOReader: command cp /storage/emulated/0/koreader/scripts.afterupdate/data/hyph/Roman.pattern /data/user/0/org.koreader.launcher/files/data/hyph/Roman.pattern returned 0
06-20 16:16:33.600 3584 3597 I KOReader: command cp /storage/emulated/0/koreader/scripts.afterupdate/data/example.css /data/user/0/org.koreader.launcher/files/data/example.css returned 0
06-20 16:16:33.604 3584 3597 I KOReader: command rm /data/user/0/org.koreader.launcher/files/afterupdate.marker returned 0
```
* More robust way to detect our own path on Kobo
Should take care of all the weird and interesting ways people manage to
find to break it...
NOTE: "$(dirname $(realpath "${0}"))" works, too, but I'm not sure if
really old devices ship with the realpath applet...
* Abort early if KOREADER_DIR is null
Add the possibility to run *.sh scripts:
After an update of koreader all *.sh scripts in /sdcard/koreader/scripts.afterupdate
are executed.
On every start of koreader run all *.sh scripts in /sdcard/koreader/scripts.always
Requires koreader/android-luajit-launcher#233
Requires koreader/koreader-base#1117
It is a workaround for #6263 but can be useful on some devices with erratic back key behaviour too (yep, Onyx)
This apparently fatally upsets the WM on FW >= 5.12.4
I don't have the HW to test it, and I've been saying FW 5.12.x is evil
from the get go, so, eh.
Re #6117
* Simplify env siphoning some more
* Nope, shellcheck, quoting this breaks it.
(it preserves the LNs instead of abusing them as free field separators with word splitting).
And, while this does break on env vars with spaces (since they'll be
unquoted), that was already the case of the xargs approach.
If we had read -d & printf %q, we could go with a pure shell approach,
but we don't ;).
* Document a working quoted variant.
For science!
* Kindle FL shenanigans
Either fix#5986, or break a whole crapload of weird corner-cases.
Possibly the insane AutoFrontLight checks.
* Make fl step 0 usable on devices where 0 doesn't turn the light off.
By fudging an extra step on our own side.
* Also, add some debug logging around wmctrl to try to figure out what's
happening there...
* Unbreak OTA on crappy shells
Very, very old ash versions abort on set -o failures (as mandated by
POSIX, granted). This makes it impossible to reliably catch failures in
a single step.
So do it from the Lua side instead.
Should fix#5844
* Launch the zsync wrapper through bash on Cervantes
* [Kobo/reMarkable] Don't skip fbdepth when launching KOReader @ 8bpp
I'm not quite sure how that can happen unless you really want to, but
apparently it did on @Frenzie's H2O ;p
* Also remove the temporary files when doing a full retry
* Bump base
Pickup the required zsync2/FBInk updates
(https://github.com/koreader/koreader-base/pull/1038)
* Actually does what it says on the tin for Abort
i.e., cleanup temporary files
* remarkable: remove unnecessary screen invalidate on resume
This is handled in uimanager if needsScreenRefreshAfterResume is enabled
(which is the default).
* remarkable: pass a path argument to reader.lua
Otherwise if lastfile is not set in the settings (e.g. install and then
exit without opening a file) koreader will just refuse to start.
* remarkable: pass koreader.sh args (if any) through to reader.lua
Touchscreen is mirrored in X & Y and has a different resolution from the eink panel.
Uses systemd for time/date/suspend/poweroff/reboot
Two systemd units for platform integration. button-listen is a very
simple launcher.
to-do: add support for wifi by implementing a wpa supplicant dbus client.
Authored-by: Thomas Spurden <tcrs@users.noreply.github.com>
Update shellcheck and shfmt to the latest version.
Fixes <https://github.com/koreader/koreader/issues/5152>.
Btw, you can apply shellcheck suggestions with a command like:
```
shellcheck --include=SC2250 -f diff *.sh | git apply
```
* Prefer our own FBInk binary
* Get rid of the CRe config tweaks
* Oops, actually ship libkohelper in the KUAL extension.
* Bump extension version
* Flush to disk before printing final status message
* Restart KOReader after a crash, after showing a fancy crash recap screen (our very own Gray Screen of Death!).
Kobo only, because it's possibly the platform where getting booted out
of KOReader is the most annoying.
Keeps track of crashes, to be able to give up after a while, in order to
avoid boot loops in the unlikely event of a crash loop on startup.
Adds a dev option to *always* exit KOReader after the crash screen.
Although the current hard-coded paths work on debian, they may fail on many other distros. Other distros may pack koreader based on the released deb file. I personally have problem using current script on nixos, as it does not use the paths `/bin/bash` and `/usr/lib/`.
* Try to make sure restoreWifiAsync eventually sends a NetworkConnected
event...
re: #5109
* Take a page from @shermp's book, and make sure wpa_supplicant managed to
connect to the AP before acquiring an IP.
Tear down WiFi modules in case of failure.
c.f., https://github.com/shermp/Kobo-UNCaGED/pull/21
* Don't let restore-wifi-async.sh enable WiFi behind our back when we're
killing it to start Nickel...
* Don't even call ping if there's no default gw
add support for runtime permissions on api23+
add support for devices with a notch on api28+
fix some potential memory leaks
do not check luajit-launcher shell scripts
* Add a toggle to disable the C blitter in the Dev menu (depends on https://github.com/koreader/koreader-base/pull/882) (never shown if the JIT is disabled, grayed out if the C blitter is not installed)
* Fix a few sizeUtf8Text call sites that were doing a nil check in order to account for the new return type.
* Tweak statusbar handling to avoid spurious sizeUtf8Text warnings when it's hidden, and unify its behavior between being hidden via toggle, and hidden on book open (at least when all-at-once is not enabled).
* c.f., https://github.com/koreader/koreader-base/pull/882 (Android, PB, RGB32 & Legacy Kindle regression fixes).
* Enforce Portrait rotation on the Forma *everywhere*, KSM included.
KSM is currently emulating a bogus rotation, which causes issues with
FBInk, but also happens to be insidiously quirky in weird corner-cases.
* The Great 8bpp Experiment
Swap to 8bpp on Kobo, because we're 'effing grayscale, for pete's sake!
* Always swap to 8bpp, no matter the launch method.
Because it turned out that, even when restarting Nickel, we had to
restore the expected bitdepth ourselves, because pickel/Nickel didn't do
the job completely.
(I'm going to guess the grayscale flag wasn't getting flipped properly).
* Dither every non-transparent icon to the eInk palette
* Make sure hasBGRFrameBuffer is only enabled when the Kobo fb actually is
@ 32bpp...
* Re-process badly grayscaled icons
* And re-grayscale that one w/ gamma correction so the squares show up
better.
* Allow the fbdepth switch to be disabled (in Developer settings).
Also, allow setting debug mode that way.
Also, forcibly disable verbose logging when disabling debug.
* Update setting name to piggyback on the existing check in reader.lua
* Update icons postprocessing info
Includes "set android versionCode and android versionName at buildtime" (<https://github.com/koreader/android-luajit-launcher/pull/106>)
* versionCode uses the number of Git commits, because Google doesn't like values larger than `2100000000`
* versionName uses our existing version string
References #2040.
* On zsync delta failure, offer to retry OTA update with a full download
Fix#4429
* Bring the "this may take a while" popup back up before full DL
Don't rebuild the local tarball for a full dl, we're ignoring it anyway
;)
Co-Authored-By: NiLuJe <ninuje@gmail.com>