Commit Graph

32 Commits (master)

Author SHA1 Message Date
zwim 41e78b6ed3
userpatch: allow monkey-patching KOReader (#9104)
Supersede old android-only patch.lua.
2 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
Martín Fernández d303fdf694
android: Prompt for install updates when they're downloaded (#7632) 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
Martín Fernández c481c5aa04
move unpackArchive to Device, use native version on android (#6959) 3 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
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
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
Martín Fernández 87334801ea android: fix ko paths when primary storage is a SD card 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
Martín Fernández d2536d8b7e android: fix some warnings on launcher script,
no need to chmod binaries as they are uncompressed on each update,
A becomes android
5 years ago
Martín Fernández dca24e0ac5 patch.lua is not needed for screen height workarounds, but can be useful as it is the only file that allow us to change KOReader behaviour on Android without rebuilding the application 5 years ago
Martín Fernández a69c09a275 [Android] do not log verbose blitbuffer messages on release builds, unless specified in settings.lua. Keep debug builds as they are (#4933) 5 years ago
Martín Fernández dde301e765 [Android] use the same tag for all logs (#4862) 5 years ago
NiLuJe b72a2000b1
A few minor fixes after #4847 (#4850)
* 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).
5 years ago
Frans de Jonge 365a5ad876
[chore] Deprecate Android OTA code (#4636)
Fixes #4632.
5 years ago
Martín Fernández 2093bf6d94 use getIntent from luajit-launcher 5 years ago
Martín Fernández dbea29b139 do not print intent file path if file == nil 5 years ago
NiLuJe 5871132c25
UI Behavior tweaks (#3983)
* Switch all initial highlights to "fast" update

i.e., everything that does an invert
Plus a few other things that refresh small UI elements onTap
Re #3130

* Tweak refreshtype for a number of widgets:
  * Fix iconbutton dimen
  * Make touchmenu flash on close & initial menu popup. Full-screen on close.
  * Use flashing updates when opening/closing dictionary popup. Full-screen on close.
  * Switch FileManager to partial.
    It's mostly text, and we want flash promotion there.
  * Make configdialog & menu flash on exit
  * Make FLWidget flash on close
  * virtualkeyboard: flash on layout change & popup.
  * Potentially not that great workaround to ensure we actually see the
highlights in the FM's chevrons
  * Flash when closing BookStatus Widget
  * Optimize away a quirk of the dual "fast" update in touchmenu

* Promote updates to flashing slightly more agressively.

* Document what each refreshtype actually does.

With a few guidelines on their optimal usecases.

* Switch remaining scheduleIn(0.0) to nextTick()

* Tighter scheduling timers

Shaving a hundred ms off UI callbacks...

* Cache FFI C Library namespace

* Ask MuPDF to convert pixmaps to BGR on Kobo

Fix #3949

* Mention koxtoolchain in the README

re #3972

* Kindle: Handle *all* fonts via EXT_FONT_DIR instead of bind mounts insanity

* Make black flashes in UI elements user-configurable

(All or nothing).

* Jot down some random KOA2 sysfs path
6 years ago
Frans de Jonge 94c0e01b7f [fix, Android] restore patch.lua and fix odd anonymous function issue
See https://github.com/koreader/koreader/issues/3214#issuecomment-332218408 and https://github.com/koreader/koreader/issues/3118#issuecomment-332633481
7 years ago
Huang Xin a4e1a3ba5e reflect changes in koreader/android-luajit-launcher#62 (#3254) 7 years ago
chrox 687b6df4f2 add support of screen brightness settings for Android
and use standrad Android API to query battery level and charging status
This should fix #2025, fix #1759 and fix #1415.
8 years ago
Qingping Hou 55fa046d49 android: set android log tag to KOReader 8 years ago
chrox 3a9cb659d1 add OTA update on Android 8 years ago
chrox 34ea9ac574 add datastorage module to handle data directory on various platform
On kindle, kobo and pocketbook the data directory is the current
running directory but on Android the app is installed in system
defined location and users may have no access to that location.
The same circumstances should be true for the upcoming Koreader for
Ubuntu touch, so the data directory (in which tessdata, dictionaries,
global settings, persistant defaults and probably history data are
stored) could be stored in another place.
9 years ago
chrox d345f21c39 Fix sdcv on Android cannot handle morphological changes 9 years ago
chrox 402806d32b Dictionary on Android
Stardict dictionary files should be copied to
/sdcard/koreader/data/dict/ directory.
9 years ago
chrox a38d851a15 mcode force allocation on Android is now optional
Anyone who encounters random freeze of koreader for Android
is encouraged to enable this by adding a file at
"/sdcard/koreader/patch.lua" with the content of:
```
require("jit.opt").start("sizemcode=256","maxmcode=256")
for i=1,100 do end  -- Force allocation of one large segment
```
The sizemcode and maxmcode could be adjusted from 196 to 512 to
make koreader best fit on your Android device.
9 years ago
chrox f2f2833b6a fix #1048 10 years ago
chrox 64b102ebc9 fix #992 by creating fake command line arguments 10 years ago
chrox 2d3c502948 move platform dependent files into 'platform' directory 10 years ago