You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
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
.ci [CI] Add curly braces check (#5809) 4 years ago
.circleci [CI] Docker koreader/koappimage:0.1.7 for ragel (#5753) 4 years ago
.github Add Liberapay link (#5770) 4 years ago
base@2210b65f5a android: add a toggle to ignore back button events (#6269) 4 years ago
doc [fix] Ignore sha2.lua in doc generation (#6229) 4 years ago
frontend [plugin] Dispatcher: for profiles & gestures (#6106) 4 years ago
l10n@c1c917ad0e Update translations for 2020.06 release (#6271) 4 years ago
metadata@98fd6c8fe0 add metadata, to be used by fdroid 4 years ago
platform [Android] Migrate user directories after update (#6287) 4 years ago
plugins [plugin] Dispatcher: for profiles & gestures (#6106) 4 years ago
resources Update bundled fonts (#6242) 4 years ago
spec/unit unified calibre plugin (#6177) 4 years ago
test@86eeb0b43d various test/coverage optimization 8 years ago
tools [fix] Add CanvasContext to wbuilder (#5287) 5 years ago
.busted Travis update 9 years ago
.codecov.yml [CI] Add .codecov.yml (#4695) 5 years ago
.editorconfig experimental port to Mac OSX 8 years ago
.gitignore [feat] Allow message to be overlaid on other screensavers (#6238) 4 years ago
.gitmodules add metadata, to be used by fdroid 4 years ago
.luacheckrc unified calibre plugin (#6177) 4 years ago
.luacov [CI] Also run coverage on plugins (#3447) 7 years ago
.shellcheckrc [CI] Add curly braces check (#5809) 4 years ago
.travis.yml quickstart fix (#2804) 7 years ago
COPYING switch license to AGPLv3 10 years ago
Makefile [Android] Add support for custom startup scripts (#6275) 4 years ago
README.md Add Remarkable to README.md (#5839) 4 years ago
datastorage.lua android: unbreak KO on scoped storage devices 4 years ago
defaults.lua unified calibre plugin (#6177) 4 years ago
kodev Get rid of the old PB TC (#5860) 4 years ago
reader.lua Warn if color rendering is enabled on a grayscale device. (#5871) 4 years ago
setupkoenv.lua A few minor fixes after #4847 (#4850) 5 years ago

README.md

KOReader

KOReader is a document viewer primarily aimed at e-ink readers.

AGPL Licence Latest release Gitter Mobileread Build Status Coverage Status Weblate Status

DownloadWikiDeveloper docs

Main features

  • portable: runs on embedded devices (Cervantes, Kindle, Kobo, PocketBook, reMarkable), Android and Linux computers. Developers can run a KOReader emulator in Linux and MacOS.

  • multi-format documents: supports fixed page formats (PDF, DjVu, CBT, CBZ) and reflowable e-book formats (EPUB, FB2, Mobi, DOC, CHM, TXT). Scanned PDF/DjVu documents can also be reflowed with the built-in K2pdfopt library.

  • full-featured reading: multi-lingual user interface with a highly customizable reader view and many typesetting options. You can set arbitrary page margins, override line spacing and choose external fonts and styles. It has multi-lingual hyphenation dictionaries bundled into the application.

  • integrated with calibre (search metadata, receive ebooks wirelessly, browse library via OPDS), Evernote (export hightlights), Wallabag, Wikipedia, Google Translate and other content providers.

  • optimized for e-ink devices: custom UI without animation, with paginated menus, adjustable text contrast, and easy zoom to fit content or page in paged media.

  • extensible: via plugins

  • and much more: look up words with StarDict dictionaries / Wikipedia, add your own online OPDS catalogs and RSS feeds, share ebooks with other KOReader devices wirelessly, online over-the-air software updates, an FTP client, an SSH server, …

Please check the wiki to discover more features and to help us document them.

Screenshots

Installation

Please follow the model specific steps for your device:

AndroidCervantesKindleKoboLinuxPocketbookreMarkable

Development

Setting a build environmentCollaborating with GitBuilding targetsPortingDeveloper docs

Support

KOReader is developed and supported by volunteers all around the world. There are many ways you can help:

Right now we only support liberapay donations, but you can also create a bounty to motivate others to work on a specific bug or feature request.

Also if you have and old Pocketbook device you don't want, we might find it useful to tinker a bit with that platform. Please contact us through the forum or GitHub.

Contributors

Last commit Commit activity

0 1 2 3 4 5 6 7