Commit Graph

526 Commits (master)

Author SHA1 Message Date
NiLuJe d6eefe18ef Kindle: Stop/start a bunch of services on FW 5.x to reclaim a sliver of
RAM

Like, really not a lot, but, oh, well.
3 years ago
Martín Fdez e708a47cca bump luajit-launcher 3 years ago
NiLuJe 5310381106 Kobo: Various other minor 4.28/Elipsa stuff 3 years ago
NiLuJe 94b0e974e1 Kobo: Kill new stuff from FW 4.28 on startup 3 years ago
Martín Fernández b2ee95be63
fix storage permissions on android 11+ (#7846)
* bump luajit-launcher
3 years ago
Martín Fernández 2408c17175
bump luajit-launcher (#7842) 3 years ago
Martín Fernández 9f097da4f0
Bump android backend (#7813)
* Bumps the target Sdk to Android 11 (API30)
* Add a crash handler
3 years ago
Frans de Jonge 600c2bcf81 Debian package: skip the set -e for now 3 years ago
Frans de Jonge ae544b741d
[fix] Debian package: ensure failure is caught (#7804)
fakeroot was missing from the Docker image.
3 years ago
Frans de Jonge 039947886f
Revert "Hyphenation: add custom hyphenation rules (#7746)" (#7785)
This reverts commit f25da5d0d5.
3 years ago
zwim f25da5d0d5
Hyphenation: add custom hyphenation rules (#7746)
The hyphenation of a word can be changed from its default
by long pressing for 3 seconds and selecting 'Hyphenate'.
These overrides are stored in a per-language file, i.e:
koreader/settings/user-German.hyph.
3 years ago
NiLuJe 5d82907e3c PocketBook: Avoid arithmetics expansions in startup script
Because everything is terrible.

Fix #7732
3 years ago
tjader b938f312a6
Enable bomb crash screen on Cervantes (#7731) 3 years ago
Martín Fernández fdb0539aae
Bug report changes (#7709)
* android: dump logcat to file
* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
3 years ago
Martín Fernández 939fcf7f0e
android: avoid downloading the APK again if there's one download in progress + fix signature error (#7657) 3 years ago
Martín Fernández 247166b3df
android: keep bundled version in a dedicated text file (#7649) 3 years ago
Martín Fernández d303fdf694
android: Prompt for install updates when they're downloaded (#7632) 3 years ago
NiLuJe e0a67bb656
OTA: Handle tar checkpointing visual feedback w/ an FBInk daemon (#7588)
Instead of forking it on every checkpoint.

Won't change much in the grand scheme of things, but FIFOs are fun.
3 years ago
NiLuJe b0336e9982
PocketBook: Workaround platform shenanigans when aplying an OTA (#7585)
We can't avoid hitting a few permission errors, so, just filter them out.

Fix #7581
3 years ago
NiLuJe 6d752f32c0 Update android-laujit-launcher
https://github.com/koreader/android-luajit-launcher/pull/302
https://github.com/koreader/android-luajit-launcher/pull/301
https://github.com/koreader/android-luajit-launcher/pull/300
3 years ago
Martín Fernández 53234fcdc1
add hasSystemFonts device property (#7535)
Add system + user paths to the ReMarkable (has normal linux paths)
3 years ago
NiLuJe 1ac0ad2f1a Android: More input handling tweaks
* Android: Fix #7552 by simply ensuring we drain the input/cmd queue first, simply by scheduling the task to the next tick, instead of locally re-implementing part of the event loop ;). (Requires https://github.com/koreader/koreader-base/pull/1356 for extra safety).
* Android: Clear input state when the window loses focus. (Related to the above fix).

* Bump base:

https://github.com/koreader/koreader-base/pull/1356
https://github.com/koreader/koreader-base/pull/1357

* Bump android-luajit-launcher:

https://github.com/koreader/android-luajit-launcher/pull/293
https://github.com/koreader/android-luajit-launcher/pull/298
https://github.com/koreader/android-luajit-launcher/pull/299
3 years ago
NiLuJe bbe197bd4b
Bump base (#7527)
* Bump android-laujit-launcher

https://github.com/koreader/android-luajit-launcher/pull/297

* Bump base

https://github.com/koreader/koreader-base/pull/1351
https://github.com/koreader/koreader-base/pull/1350
https://github.com/koreader/koreader-base/pull/1349
https://github.com/koreader/koreader-base/pull/1348
3 years ago
gbyl 5b996c8ab7
remarkable FW 2.6: use explicit busybox for 'sync' (#7509) 3 years ago
zwim 6d6760c2b3
bump luajit-launcher (#7480) 3 years ago
Martín Fernández 4a89c93290
Remarkable1 wifi (#7216)
* add wifi support to Rm1
* remarkable: common suspend for all models
3 years ago
NiLuJe f4f8820575
Bump the things for 2021.01.1 (#7202)
* Bump base

https://github.com/koreader/koreader-base/pull/1293
https://github.com/koreader/koreader-base/pull/1294

Fix #7187

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/289
https://github.com/koreader/android-luajit-launcher/pull/292

Fix #7193
3 years ago
Glen Sawyer 34b177aa69
Wifi toggle for reMarkable 2 (#7122)
reMarkable 1 is no-op for the moment
3 years ago
Frans de Jonge 4b02edc4e1
Bump luajit-launcher (#7142)
For https://github.com/koreader/android-luajit-launcher/pull/288
3 years ago
NiLuJe 3060dc81af
Revamp "flash_ui" handling (#7118)
* Wherever possible, do an actual dumb invert on the Screen BB instead of repainting the widget, *then* inverting it (which is what the "invert" flag does).
* Instead of playing with nextTick/tickAfterNext delays, explicitly fence stuff with forceRePaint
* And, in the few cases where said Mk. 7 quirk kicks in, make the fences more marked by using a well-placed WAIT_FOR_UPDATE_COMPLETE

* Fix an issue in Button where show/hide & enable/disable where actually all toggles, which meant that duplicate calls or timing issues would do the wrong thing. (This broke dimming some icons, and mistakenly dropped the background from FM chevrons, for example).
* Speaking of, fix Button's hide/show to actually restore the background properly (there was a stupid typo in the variable name)
* Still in Button, fix the insanity of the double repaint on rounded buttons. Turns out it made sense, after all (and was related to said missing background, and bad interaction with invert & text with no background).
* KeyValuePage suffered from a similar issue with broken highlights (all black) because of missing backgrounds.
* In ConfigDialog, only instanciate IconButtons once (because every tab switch causes a full instantiation; and the initial display implies a full instanciation and an initial tab switch). Otherwise, both instances linger, and catch taps, and as such, double highlights.
* ConfigDialog: Restore the "don't repaint ReaderUI" when switching between similarly sized tabs (re #6131). I never could reproduce that on eInk, and I can't now on the emulator, so I'm assuming @poire-z fixed it during the swap to SVG icons.
* KeyValuePage: Only instanciate Buttons once (again, this is a widget that goes through a full init every page). Again, caused highlight/dimming issues because buttons were stacked.
* Menu: Ditto.
* TouchMenu: Now home of the gnarliest unhilight heuristics, because of the sheer amount of different things that can happen (and/or thanks to stuff not flagged covers_fullscreen properly ;p).

* Bump base
https://github.com/koreader/koreader-base/pull/1280
https://github.com/koreader/koreader-base/pull/1282
https://github.com/koreader/koreader-base/pull/1283
https://github.com/koreader/koreader-base/pull/1284

* Bump android-luajit-launcher
https://github.com/koreader/android-luajit-launcher/pull/284
https://github.com/koreader/android-luajit-launcher/pull/285
https://github.com/koreader/android-luajit-launcher/pull/286
https://github.com/koreader/android-luajit-launcher/pull/287
3 years ago
yparitcher dc964f3941
reader.lua: rework file/directory argument handling. (#7053)
platform: do not pass a directory on the command line.
The home directory will be properly set by Device.home_dir.

It was sometimes crashing when opened with no args.

Fixes: #7049
3 years ago
NiLuJe 5ae5c99197
Legacy Kindle: Unbreak screensavers (#7112)
* The K2 & DXg cannot be SO, so, bypass the check there

* Handle native screensavers on FW 3.x & 4.x
3 years ago
NiLuJe 5756f1f43e
LuaJIT on Android fixes (#7094)
* Don't flag Android as should_restrict_JIT

And allow disabling the C blitter, to put the workaround to the test...

* Add a -d, --debug flag to the log function

Catches KOReader's debug, as well as (our) dlopen & luajit logging

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/283
https://github.com/koreader/android-luajit-launcher/pull/282

* Bump base

(https://github.com/koreader/koreader-base/pull/1279)
3 years ago
NiLuJe f1f439d08b
More Android trickery (#7059)
* Modernize jit syntax

It's built-in, no need for a require anymore.

* Flag Android should_restrict_JIT again

It's mildly helpful at putting off the inevitable.
(very, very, very, very mildly).

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/281
3 years ago
NiLuJe f534e08ad1
Bump android-luajit-launcher (#7055)
https://github.com/koreader/android-luajit-launcher/pull/280
3 years ago
NiLuJe 39c60ada20
Android: Avoid the Lua blitter (#7042)
* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/279

* Bump base

https://github.com/koreader/koreader-base/pull/1265
https://github.com/koreader/koreader-base/pull/1267
https://github.com/koreader/koreader-base/pull/1268
3 years ago
NiLuJe d845741b15
Android: Don't mark the platform as should_restrict_JIT (#7024)
* Android: Don't mark the platform as should_restrict_JIT

And see how much stuff breaks \o/

* Prevent Android users from disabling the C blitter, regardless of the
restrict flag

* Update android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/278
https://github.com/koreader/android-luajit-launcher/pull/275
3 years ago
NiLuJe 7dd94b348f
rM: Switch to plain dumb sleep during the crash screen (#7038)
The seven billion different input devices on an rM make this trickier in practice.
Plus, rM1 vs. rM2 platform differences...
3 years ago
NiLuJe 8e3a117c68
Rejig CBB toggling on startup to avoid an extra jit.flush (#7023)
* When the CBB is disabled, attempt to apply the JIT tweaks earlier,
avoiding the JIT code flush in the process

* Drop debug prints

* Bump base

https://github.com/koreader/koreader-base/pull/1263
https://github.com/koreader/koreader-base/pull/1264
3 years ago
NiLuJe cffdd40c1a
macOS: Linting in do_mac_bundle (#7014) 3 years ago
NiLuJe 49e0e535b5
macOS: Comment the brew shenanigans (#7013)
* Comment the brew shenanigans
  (And support non-standard brew prefixes, just in case)
* Bump base to pickup https://github.com/koreader/koreader-base/pull/1260
* Handle libsodium, too
Co-authored-by: Martín Fernández <paziusss@gmail.com>
3 years ago
poire-z daefdc96e9 Remove PNG icons, add koreader.svg
Also move Mac specific resource in platform/mac/.
3 years ago
Frans de Jonge db9b485e2d
[chore] Minor formatting fixes (#7009)
Cf. <https://github.com/koreader/koreader/pull/6992>.
3 years ago
ddvk 77ac32d4ac
remarkable2 support (#6992)
Fixes https://github.com/koreader/koreader/issues/6792
3 years ago
NiLuJe 17356bbb2a
Kindle: Make ReaderActivityIndicator a stub (#7002)
And only actually flesh it out and register it in the very few cases
where it can actually do something (i.e., old FW 5.x with KPV).
3 years ago
Martín Fernández 222e752f59
bump luajit-launcher: fix for some dict downloads (#6990)
Follow up: #6959
3 years ago
Martín Fernández febb8e11a6
bump base (#6978)
* LuaJIT
* cURL 7.74.0
* OpenSSL 1.1.1i
* OpenSSH 8.4p1
3 years ago
Martín Fernández 4345201e0e
[CI] Mac OS app (#6955)
* use 7z instead of dmg
* osx: use always writable paths
3 years ago
Martín Fernández c481c5aa04
move unpackArchive to Device, use native version on android (#6959) 3 years ago
Martín Fernández 89e1c406f2
android: downgrade targetSdk to 28 (#6961)
Fixes #6953
3 years ago
Martín Fdez 9df5d17a6c bump luajit-launcher 3 years ago
Martín Fdez c0b71d0899 bump luajit-launcher and APK to API30 3 years ago
NiLuJe 931f01ef26
Kobo: Warn on restart if the startup script is outdated (#6916)
* Warn on restart if the startup script has been updated, because a restart will not reload it.

* Also warn right after the update if it contained a startup script update...
3 years ago
NiLuJe cb2314d11b
Kobo, Mk.5: Tweak CPU frequency scaling (#6905)
* Run grep against /proc/modules directly instead of forking to lsmod

* Revamp the CPUFreq governor choice logic

I finally figured out why the scaling on the H2O was so wonky:
Because it relies on an obscure i.MX hardware feature called DVFS,
and it gets flipped for mysterious workaround-y reasons depending on
Wi-Fi state...

* Start playing with conservative, because just staying pegged at max
clock is entirely stupid.

And DVFS is extremely conservative, it needs somewhat sustained load to
clock up...

* Take care of the DVFS switcheroo in the Wi-Fi scripts
3 years ago
NiLuJe 510ea5963c
[Kobo] Don't attempt to restart Nickel when asking for a reboot/shutdown (#6880)
* Don't attempt to restart Nickel when asking for a reboot/shutdown

Use a magic exit code to ID those cases.

* Limit this to Kobo, to avoid breaking potentially existing assumptions
with other platform's startup scripts
4 years ago
Martín Fernández 1468646aa5
Android bundle update (#6870)
- adaptative icons
- minify + shrink
- remove unused assets to save a few KBs
- install apk by clicking on notification after download (doesn't apply to F-Droid)
4 years ago
zwim 926e7dd402
coverimage plugin (#6813)
* Plugin for saving the cover image to file. Useful in some e-ink android devices.
4 years ago
Galunid 5ed240077e
OnyxEPDController (#6853)
Includes:

new QualcommOnyxEPDController for Onyx Boox Nova 2 (and possibly others)
refactoring and support for qualcomm epd modes
Includes new eink test, that should work on Qualcomm Onyx devices.
4 years ago
Martín Fernández 91708e25d0
android-luajit-launcher refactor (#6821)
- Lcd devices won't use the SurfaceView, just the good old native content/window (except AndroidTv and ChromeOS)
- All android dialogs will be presented with Material Design on recent devices.
- Added an option to device settings to manage application battery optimization.
- Permissions that require the user to go to a settings page will be presented with a native android dialog.
- bump android-luajit-launcher

- Changes under the hood: koreader/android-luajit-launcher#257
4 years ago
ezdiy ac3c97af49
Pocketbook: Use a single launcher (#6814)
* Pocketbook: Use a single launcher and make the system one a "symlink"
4 years ago
NiLuJe d9b658034d
Ensure the SD card is actually detected in Nickel on exit. (#6800)
* Ensure the SD card is actually detected in Nickel on exit.

Regression since #6522
4 years ago
ezdiy 893909146d
Pocketbook: use raw input I/O (#6791)
This allows for better energy efficiency (no more 50Hz tick poll),
as well as lower input lag / higher precision - touch events are
native linux ones.

In addition, auto off/suspend plugin is used in this mode, as we need
to trigger (timed) sleep / poweroff on our own, since the OS ones
will no longer work whenever koreader has focus.

This is for rooted devices only, and possibly somewhat FW
specific, so enabled only on PB740-2 where it's reasonably tested.
4 years ago
Martín Fdez 4fb59e2253 bump LuaJIT, fix android native orientation logic 4 years ago
NiLuJe d2f533e5b7
A couple of hotfixes for 2020.10.1 (#6781)
* PB Crash Screen:
	* We don't actually support the "tap to restart now" behavior, it's a
	  plain sleep.

* Remove CBB toggling leftovers missed in #6696

Fix #6780
4 years ago
NiLuJe ba927fe4b5
Don't grab input devices on Kobo (#6705)
* Don't grab input devices on Kobo

(... as long as we're started via KFMon/NM.
... and MiniClock is not running ^^).

* Bump base

(https://github.com/koreader/koreader-base/pull/1197)
(https://github.com/koreader/koreader-base/pull/1199)
4 years ago
NiLuJe 9cddd9cf58
[PB] Crash screen & OTA feedback (#6686)
* Add progress feedback to OTA updates
* Also, install OTA updates on restart
* Display the crash screen

* Bump base

https://github.com/koreader/koreader-base/pull/1193
https://github.com/koreader/koreader-base/pull/1192
4 years ago
raisjn 221b71062a
reMarkable: add environment variable to tell koreader.sh to not set bpp (#6685)
* reMarkable: add environment variable to tell koreader.sh to not set bpp
4 years ago
yparitcher eecdf5bb9b
kindle: honor --asap (#6662) 4 years ago
NiLuJe 14e7e270c3
Bump android/luajit-launcher (#6661)
(https://github.com/koreader/android-luajit-launcher/pull/251)
4 years ago
Thomas Spurden 0eaae807ce
remarkable: fix fbdepth use in startup script (#6658)
The reMarkable version of fbdepth doesn't support the -1 rotation so
this was actually not setting the rotation at all. I didn't notice this
as I was always launching koreader from xochitl so the rotation was
already set correctly.
4 years ago
NiLuJe 051c8c0d95
Update KoboUSBMS for CJK support (#6639)
* Making the startup script even more tortuous in the process...

* Bump base

https://github.com/koreader/koreader-base/pull/1179
https://github.com/koreader/koreader-base/pull/1180
4 years ago
ezdiy 91ebe56b20
Pocketbook: launcher script: please shfmt (#6621) 4 years ago
ezdiy 4857e97e30
Pocketbook: Launcher OS integration (#6620)
* Bring in restart koreader & shutdown device exit options
* Existing instance reused for opens via native book explorer
4 years ago
ezdiy c9a339ead0
Pocketbook: File handling OS integration (#6617)
* Show opened file in task manager
* Remember file to open on power-off
* Perform file associations
4 years ago
NiLuJe 12df296b90
Detect early KoboUSBMS returns, and just restart KOReader (#6603)
We know onboard is safe in these cases.
4 years ago
Galunid cc42265a67
Bump luajit-launcher (#6595)
Includes native frontlight for onyx nova 2 (koreader/android-luajit-launcher#248)
4 years ago
NiLuJe e402c9d6f3
More KoboUSBMS related tweaks & cleanups (#6590)
* 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
4 years ago
Martín Fdez 454ed0ebeb enable usage of system fonts 4 years ago
NiLuJe 1919764825
Some more KoboUSBMS tweaks (#6566)
* 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
4 years ago
zwim 66e8087c66
[android]: fix backlight toggle (#6520)
* check on startup if frontlight can be changed.
* Init fl_min if necessary not to use intensity==0
4 years ago
NiLuJe 6e3a3e8069
[Kobo] Support USBMS exports (#6552)
* \o/

* Make sure the (debug) event log doesn't end up in the fd table of our child processes...
Otherwise, it breaks USBMS.

* Close suspicious fds in the Wi-Fi scripts
To prevent any and all issues w/ USBMS down the road...

* Minor USBMS UI tweaks

* Always ask for confirmation to start on USBMS session on plug

* Bump base

https://github.com/koreader/koreader-base/pull/1161
https://github.com/koreader/koreader-base/pull/1162
https://github.com/koreader/koreader-base/pull/1163
https://github.com/koreader/koreader-base/pull/1165
https://github.com/koreader/koreader-base/pull/1167
4 years ago
Martín Fernández ae19cafe84 check OTA updates on restart 4 years ago
NiLuJe b14cabb6de
[Kobo] Unbreak Wi-Fi on FW >= 4.23 (#6522)
* 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.
4 years ago
Martín Fdez 9037a1f4f2 bump luajit-launcher and remove frontlightwidget leftovers 4 years ago
Martín Fdez bdbebb9e08 standalone osx application bundle 4 years ago
NiLuJe 4a3d5f3d66
Fix a minor snafu in the Kobo startup script. (#6466)
Oops, too much Python/Lua ^^.
4 years ago
zwim a6763465b4
[Android]: Native light dialog (#6426)
* Adds support for Tolino Epos 2 warmth light
4 years ago
NiLuJe 2ad976387d
More #6424 cleanups (#6442)
* Simplify logic, and more detailed debug logging
* Kill Nickel's FIFO on startup
Avoids udev/udhcpc scripts hanging when trying to open() it.
4 years ago
NiLuJe 37a01100b7
Various Wi-Fi QoL improvements (#6424)
* 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.
4 years ago
Martín Fernández fa55152465
Handle all possible Android configuration changes without recreating the activity (#6416) 4 years ago
Martín Fernández 9bee4e495a mac app fixes 4 years ago
Thomas Spurden 201d3d8ad1
remarkable: add more detail to README about launcher (#6397) 4 years ago
Frans de Jonge a0e563858e
Bump base & luajit-launcher for new LuaJIT (#6389)
Also for Nia support, cf. <https://github.com/koreader/koreader-base/pull/1142>.
4 years ago
Martín Fernández 1adea4a497 Add macOS target
Co-authored-by: Jason Benwell <jbenwell@hotmail.com>
4 years ago
Martín Fdez 7094519e1b android: support for native surface rotation 4 years ago
Martín Fdez 8e61a8f285 disable runtime behaviour changes on fdroid 4 years ago
Martín Fernández 699ee3efc1
[Android] Migrate user directories after update (#6287)
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
```
4 years ago
NiLuJe 416c1c7356
More robust way to detect our own path on Kobo (#6283)
* 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
4 years ago
zwim 488721e62e
[Android] Add support for custom startup scripts (#6275)
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
4 years ago
Martín Fernández 765b35a7bf
android: add a toggle to ignore back button events (#6269)
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)
4 years ago
Martín Fdez 835f9f62c6 fix ANRs in Kosync plugin login/register 4 years ago
NiLuJe 1f994f8ede
Floor dimension computations (mul/div). (#6264)
* floor most every dimension computations involving MUL or DIV
Should avoid passing nonsensical floating point coordinates/dimensions
to the UI code.

* Update base

* https://github.com/koreader/koreader-base/pull/1113
* https://github.com/koreader/koreader-base/pull/1114
* https://github.com/koreader/koreader-base/pull/1115

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/230
https://github.com/koreader/android-luajit-launcher/pull/231
4 years ago
NiLuJe 21847dfb40
Don't exit KUAL on the Voyage (#6233)
This should allow WhisperTouch support to stay enabled, allowing
consistent button behavior.

c.f., https://github.com/koreader/koreader/issues/6038#issuecomment-612564693

Fix #6038

(Requires today's KUAL build, Booklet only).
4 years ago
Martín Fernández 879f8a7624
[Desktop] Fix missing glyphs by packaging freefonts again (#6218)
Also disable battery completely from defaults/option in desktop linux as it always return 0%
4 years ago
NiLuJe dd0cdb9dcb
[Kindle] Don't resize the titlebar on FW >= 5.12.4 (#6204)
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
4 years ago
NiLuJe 799a68ef59
Kill the RMSDK, too. (#6179)
It's a big pile 'o RAM we could use.
Plus, it might be causing bad interactions with DRM if we keep it around.
4 years ago
NiLuJe e4d3b266ef
Some more Kobo startup script tweaks (#6147)
* 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!
4 years ago
Martín Fernández 4d8cf983e2
Debian - fix some lintian errors (#6099) 4 years ago
NiLuJe 12675be065
Minor Kobo startup script cleanups (#6144)
* Minor tweaks to Kobo env setup

* Bump base

(Pickup https://github.com/koreader/koreader-base/pull/1099)
4 years ago
NiLuJe f9889cef22
Tweak the post-OTA warning on Kindle (#6120)
Because everything is terrible, and the fuse proxy can apparently still
manage to screw us over.
4 years ago
NiLuJe be72203b83
Minor Kobo startup script cleanups (#6102)
* Start re-factoring the launcher detection code in order to future-proof
it
4 years ago
Martín Fernández 9a789335c3
mobiscribe: add full screen update support (#6051) 4 years ago
NiLuJe bb39853521
[Kindle] Try harder when restoring the title bar (#6009) 4 years ago
NiLuJe 0b898624ac
[Kindle] More accurate on/off FL detection/toggle (#5989)
* 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...
4 years ago
Martín Fernández e7b191ca6a
android: same version code for all archs (#5972)
+ new Boyue model
4 years ago
NiLuJe 9ce22f53b9
[Kindle] Hide the status bar on current FW, too. (#5943)
Via wmctrl
4 years ago
Martín Fernández 69f4144dc1
[Android] Prevent previous book reopening in some situations (#5880)
Fixes #5877.
4 years ago
Frans de Jonge 5f10e8d6df
Bump luajit-launcher for Package refactor + LuaJIT bump (#5868)
https://github.com/koreader/android-luajit-launcher/pull/224
4 years ago
Matias Nitsche 1417ea94c2 PRSTUX: wifi/suspend fixes 4 years ago
NiLuJe de15ab3a87
Unbreak OTA on crappy shells (#5850)
* 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
4 years ago
NiLuJe 24f1f435de
Log zsync2's output, too. (#5842)
Thanks to our good friend tee ;).

As suggested by @Frenzie on gitter ;).
4 years ago
NiLuJe e49198cef8
Don't bypass fbdepth when starting KOReader @ 8bpp (#5841)
* [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
4 years ago
NiLuJe 73659b6bd6
Print zsync2's output on screen (#5824)
* 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
4 years ago
Thomas Spurden 6f849c5285
A couple of minor remarkable port fixes (#5834)
* 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
4 years ago
Martín Fernández 67627ce2d9
Remarkable port (#5828)
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>
4 years ago
Martín Fernández 3856f04445 android: switch to connectivity manager
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
4 years ago
NiLuJe 9a20fb5836
Switch to zsync2 (#5810)
* Switch to zsync2

Requires https://github.com/koreader/koreader-base/pull/1036

* Simplify FBInk syntax

The weird-ass workarounds for -s's subopts handling are
no longer needed w/ FBInk >= 1.21.0

* Update base

* Re-enable HW dithering on Kindle
  (https://github.com/koreader/koreader-base/pull/1034)
* Update SQLite to 3.31.1
  (https://github.com/koreader/koreader-base/pull/1035)
* reMarkable port
  (https://github.com/koreader/koreader-base/pull/1023)
* zsync2
  (https://github.com/koreader/koreader-base/pull/1036)

* zsync2 means we can finally have nice things

(OpenStack backed storage)

* We also no longer need that insane workaround on ARM

* And comment out @chrox's mirror, which appears to be down.

* Warn that a malformed URL will horribly blow up in fun and interesting
ways
4 years ago
Frans de Jonge 668eee97fa
[CI] Add curly braces check (#5809)
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
```
4 years ago
Martín Fdez f60b4c36ce fix #5781 4 years ago
Martín Fernández b111ccc2b8 bump android, fixes ntx landscape tearing, thanks to @char11 4 years ago
NiLuJe 72fd93c4dd
Unbreak OTA on Kindle (#5758)
* Deref hardlinks in tarballs
* Ensure an OTA won't break the launcher script, which'd screw the user on exit.
4 years ago
Martín Fernández 081825285f bump luajit-launcher 4 years ago
Martín Fernández 51ed411ee4 android: OTA fallback using the browser
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
4 years ago
Martín Fernández 419b42cf2c
android: call EPD test from within KOReader (#5737)
* android: call EPD test from within KOReader

Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
4 years ago
Martín Fernández 9c120c6d7a bump luajit-launcher 4 years ago
NiLuJe 47da0ae1cd
Unbreak the KUAL extension (#5715)
* 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
4 years ago
Martín Fernández 7fb2db8f02 android: fix app crash when a bluetooth keyboard is connected/disconnected, (#5702)
use the freescale surfaceview on Crema devices
add support for nook 510
4 years ago
NiLuJe 70b2564c4b
Ensure we flush everything to disk after an update. (#5685)
WIll stall for longer, but with a visible message (vs. less stalling on
a white screen during the startup and a laggy FM for a while).
4 years ago
Martín Fernández c6f553a1bd bump luajit launcher 4 years ago
Martín Fernández bd793d1ddd bump android-luajit-launcher 4 years ago
Frans de Jonge 0cbceca98a
Bump luajit-launcher (#5637)
For eink: more devices https://github.com/koreader/android-luajit-launcher/pull/197
5 years ago
Martín Fernández 87334801ea android: fix ko paths when primary storage is a SD card 5 years ago
Robert a71b6250e2 Use system font in Pocketbook (#5486) 5 years ago
Frans de Jonge 63dd2ec0c0
[chore] Make ShellCheck happy (#5484)
Cf. https://github.com/koreader/koreader/pull/5477#discussion_r334234063
5 years ago
NiLuJe fe90a8febe [Kobo] Log the FW/kernel version on crash (#5477)
(Because it gets tedious asking for it in every bug report ;p).
5 years ago
Martín Fernández 5530a36bb1 android: fix clipboard copy/paste 5 years ago
Martín Fernández e131443834 bump android-luajit-launcher: migration to kotlin and more...
splashscreen with ko icon
    e-ink friendly spinner while uncompressing assets
    reworked timeout settings, explicit WRITE_SETTINGS request
    ...
5 years ago
NiLuJe 4363576066 Support the Kobo Libra
(Hopefully?).
5 years ago
Frans de Jonge 4da512ce4e
Bump luajit-luancher for overwrite files, show resume at the end of extraction (#5357)
https://github.com/koreader/android-luajit-launcher/pull/182

Fixes <https://github.com/koreader/koreader/issues/5355>.
5 years ago
Frans de Jonge 3fa4087fe2
[fix, Android] Set executable bit (#5349)
Partially reverts d2536d8b7e.

Fixes <https://github.com/koreader/koreader/issues/5347>.
5 years ago