Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect timezone on some devices; bump version #251

Merged
merged 1 commit into from
Dec 24, 2022

Conversation

dae
Copy link
Contributor

@dae dae commented Dec 23, 2022

The timezone dependency Anki uses recently changed the way they gather timezone info. They used to rely on a libc call, which could cause crashes if env vars happened to be modified in another thread at the same, so they decided to reimplement the functionality in Rust instead to address a CVE: chronotope/chrono#602

Android appeared to be supported (https://github.com/chronotope/chrono/releases/tag/v0.4.21), but it seems that this only applies to some devices, or was not tested. On a Pixel 2/API 31 sim, the /system/usr/share/zoneinfo path it refers to exists, but it does not have the individual timezone files that the library expects to find.

Until a better solution can be found, this commit reverts to an earlier version of the library where TZ lookup was working. It depends on ankidroid/anki#7

Edit: issue reported on chronotope/chrono#922

The timezone dependency Anki uses recently changed the way they gather
timezone info. They used to rely on a libc call, which could cause crashes
if env vars happened to be modified in another thread at the same, so
they decided to reimplement the functionality in Rust instead to address
a CVE: chronotope/chrono#602

Android appeared to be supported (https://github.com/chronotope/chrono/releases/tag/v0.4.21),
but it seems that this only applies to some devices, or was not tested.
On a Pixel 2/API 31 sim, the /system/usr/share/zoneinfo path it refers
to exists, but it does not have the individual timezone files that the
library expects to find.

Until a better solution can be found, this commit reverts to an earlier
version of the library where TZ lookup was working. It depends on
ankidroid/anki#7
dae added a commit to ankitects/Anki-Android that referenced this pull request Dec 23, 2022
Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified cargo.lock changes are the ones I'd expect from the different dep lists in the Cargo.toml, verified the commit SHA of the anki submodule is the one I fast-forward merged (to maintain the stable SHA...) and pushed out, version looks great. Good to go

@mikehardy mikehardy merged commit 9f54825 into ankidroid:main Dec 24, 2022
mikehardy pushed a commit to ankidroid/Anki-Android that referenced this pull request Dec 24, 2022
dae added a commit to ankitects/anki that referenced this pull request Dec 30, 2022
dae added a commit to ankitects/anki that referenced this pull request Jan 3, 2023
* Relax chrono specification for AnkiDroid

ankidroid/Anki-Android-Backend#251

* Add AnkiDroid service and AnkiDroid customizations

Most of the work here was done by David in the Backend repo; integrating
it into this repo for ease of future maintenance.

Based on ankidroid@5d9f262
with some tweaks:

- Protobuf imports have been fixed to match the recent refactor
- FatalError has been renamed to AnkidroidPanicError
- Tweaks to the desktop code to deal with the extra arg to open_collection,
and exclude AnkiDroid service methods from our Python code.

* Refactor AnkiDroid's DB code to avoid uses of unsafe
KendallPark pushed a commit to KendallPark/Anki-Android that referenced this pull request May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants