645 Commits
main ... dev

Author SHA1 Message Date
7c08119ebc remove l10n submodule
include translation files directly
2026-11-28 21:12:46 +01:00
945d698f4c fix(wear): sync lessons and grades to the watch 2026-11-28 21:12:42 +01:00
f19d8cd387 feat(theming): share and import themes with qr codes 2026-11-28 21:12:41 +01:00
bc605dde0d fix(theming): make Dave stylized 2026-11-28 21:12:41 +01:00
f2317c1fe5 feat(theming): m3 dynamic color scheme 2026-11-28 21:12:41 +01:00
b41fc7ec08 feat(theming): background gradients 2026-11-28 21:12:41 +01:00
368545dc24 feat(theming): theme editor 2026-11-28 21:12:41 +01:00
b933e1e7b8 feat(theme): add grade color customization screen 2026-11-28 21:12:41 +01:00
fd909ade1d feat: initial color themes 2026-11-28 21:12:41 +01:00
dceeed25a3 feat(theme/preview): improve test pages 2026-11-28 21:12:41 +01:00
9c06a87001 feat(theme/preview): make one of the lessons dismissed on the tt 2026-11-28 21:12:41 +01:00
02b2043b5c feat(android): add progress centric notification support 2026-11-28 21:12:41 +01:00
77af5acba3 Merge pull request 'chore: drop the fallback rules from CLAUDE.md' (#51) from chore/claude-md-no-fallback into dev 2026-11-28 02:24:10 +01:00
85dbc6d373 Merge pull request 'ci: build and publish a release apk on main' (#50) from ci/release-apk into dev 2026-11-28 02:24:01 +01:00
zypherift
e008325e53 chore: drop the fallback rules from CLAUDE.md 2026-11-28 02:22:43 +01:00
zypherift
facb3326de ci: build and publish a release apk on main
The website's .apk button links to the newest main build, and main only published an .aab, which phones can't install.
2026-11-28 02:19:03 +01:00
eb196e9f60 Merge pull request 'chore: point CLAUDE.md at the style guide's CLAUDE.md' (#48) from chore/claude-md-chain into dev 2026-11-28 01:21:23 +01:00
zypherift
744fcbf233 chore: point CLAUDE.md at the style guide's CLAUDE.md 2026-11-28 01:21:20 +01:00
4334ed095e Merge pull request 'chore: add CLAUDE.md pointing at the style guide' (#47) from chore/claude-md into dev 2026-11-28 01:16:30 +01:00
zypherift
ed55ed6226 chore: add CLAUDE.md pointing at the style guide 2026-11-28 01:05:19 +01:00
8645e7d4c7 feat(debug): add verbose stats for nerds to lesson and message views
Persist raw Kreta UIDs in LessonCacheModel and MessageCacheModel, extract StatsForNerdsTable into a shared component, and render debug info cards in showLessonBottomSheet and MessageScreen when Settings.statsForNerds is enabled.
2026-09-17 06:28:13 +02:00
6a058f5166 fix(bottom_sheet): make text expanded to avoid overflow 2026-09-16 22:28:55 +02:00
76fa644ccd fix(icon): match Szakmai Idegen Nyelv (and it's variations) as lang 2026-09-16 19:52:14 +02:00
74064054e1 chore: update lib/l10n 2026-09-16 15:28:09 +02:00
1373fef4af test: add month timetable flicker regression test 2026-09-16 14:31:37 +02:00
2082bdbdbc test: add timetable cache regression tests 2026-09-16 14:31:29 +02:00
c1d677b4df fix: cover full visible grid on month view refresh 2026-09-16 14:31:14 +02:00
34d386c033 fix: reset lesson cache on refresh instead of merging 2026-09-16 14:31:06 +02:00
69ec627762 fix: avoid resyncing on quick app resume 2026-09-16 14:30:59 +02:00
6cb461654e fix: reuse kreta client across quick app resumes 2026-09-16 14:30:51 +02:00
fdf350c2c6 fix: migrate lesson cache after cachekey fix 2026-09-16 14:29:31 +02:00
857fa5e230 fix(api): derive lesson cache key from full uid hash 2026-09-16 14:27:55 +02:00
5a15894833 fix(cache): fix off-by-one in timetable range delete 2026-09-16 14:27:40 +02:00
609f79c3b9 fix(cache): trim renewTimetable chunks instead of skipping 2026-09-16 14:26:39 +02:00
e42298d32a fix(cache): dedupe concurrent init and renewCache calls 2026-09-16 14:25:35 +02:00
de4e8339a1 fix(cache): serialize kreta client writes 2026-09-16 14:24:46 +02:00
62d6a829bf fix(cache/tt): replace full cache when fetched 2026-09-14 23:21:16 +02:00
9dcf04e32d fix(tests): update tests to cover bugs 2026-09-14 23:21:12 +02:00
checkedear
5e757d9afd fix: wrong order on homepage 2026-09-10 17:31:12 +02:00
checkedear
fff41d95d7 fix: apply title formatting for subject names 2026-09-10 09:46:56 +02:00
checkedear
93b1d78fd2 fix: display omission bar even if no lesson available 2026-09-10 09:46:56 +02:00
checkedear
717b4b27aa fix: lesson bottom sheet subject navigation 2026-09-10 09:46:56 +02:00
a097c80516 Bump version string to 1.2.0 2026-09-09 17:07:20 +02:00
ec2b22c825 fix(cache): reconcile stale rows on resync instead of only upserting 2026-09-09 15:33:35 +02:00
d8ee1d8073 fix(android): resolve ProGuard configuration path in release builds 2026-09-09 00:09:03 +02:00
280b5142a5 ci: add staging branch pipeline and dynamic versioning trick 2026-09-08 21:02:36 +02:00
31b9d86ed9 chore: update codegen, build configs 2026-09-08 19:51:00 +02:00
ff297bf4b8 feat(notifications): add multi-backend notification delivery with FCM and AlarmManager fallback
- Add Google Play Services (GMS) availability check via MainActivity platform channel
- Add AlarmNotificationService using android_alarm_manager_plus for periodic background checks
- Add NotificationDeliveryService coordinator to resolve delivery method and sync backends
- Add NotificationDeliveryMethod setting (auto, fcm, alarm) with automatic fallback when GMS is unavailable
- Update en/hu localization strings for notification delivery method selection
- Add unit and integration tests for alarm scheduling, settings effects handoff, and e2e wakeup diffing
2026-09-08 18:53:05 +02:00
0f0b7c0c8b test: add e2e tests for widget screenshot comparison and notification diffing 2026-09-08 08:12:42 +02:00
394b7bfd70 fix: load settings on startup and set lesson cache createdAt 2026-09-08 07:20:37 +02:00
95b6af52c2 fix: restore timetable widget and fix async glance updates 2026-09-07 23:47:52 +02:00
fcf6a08e79 ci: clone mock_kreta_server and run kreta_api tests against it 2026-09-07 22:30:31 +02:00
705d1fee4e chore: remove iOS support, keep Wear OS 2026-09-05 00:21:00 +02:00
6290c27a7e chore: update l10n 2026-09-04 19:55:20 +02:00
a3a036440a fix: bold monochrome icon and notification tray icon silhouettes
Both were derived from a thin, mostly-transparent outline stroke.
Android renders adaptive monochrome icons and notification-tray icons
using only the alpha channel (system applies its own tint), so thin
strokes read as illegible scribbles when shrunk, and any opaque fill
sharing alpha with the outline collapses into one shapeless blob.

Regenerated monochrome_logo.png as a bold filled silhouette (derived
from the existing colored logo art) that keeps the eye holes as
transparent negative space, and rebuilt the ic_notification drawables
from the same source so the status-bar icon isn't a solid blob either.
2026-09-04 17:44:58 +02:00
062f1afe67 feat(notifications): add FCM debug status panel to developer settings
Adds an FcmStatus row + refresh-notification toggle to the Developer
settings subgroup: shows init state, token presence (last 6 chars),
notification permission (non-prompting), subscribed wakeup topic, and
last token-refresh time. Also registers on resumed sessions (app
reopened while already logged in), which previously only got FCM
registration via the explicit login/logout flow.
2026-09-04 16:26:23 +02:00
6d30767cb0 feat(notifications): add Firebase Cloud Messaging push support
Firebase project config, topic subscriptions synced to
login state and per-category settings, a client for the Go FCM
backend, and a settings UI to toggle push and its wakeup interval.
2026-09-04 16:17:34 +02:00
0e3c3c421f feat(notifications): add local notification diffing for FCM wakeups
Diffs grades/homework/tests/absences/lessons/messages against a
separate last-seen namespace on each silent FCM wakeup, and shows a
local notification per category for genuinely new items. Adds a
headless bootstrap so the background isolate can populate the
minimal app state KretaClient needs.
2026-09-04 16:17:32 +02:00
b6d1b221b8 ci: publish appbundle/apks to gitea package registry 2026-09-03 17:44:29 +02:00
e79c489de6 ci: release appbundle on main only 2026-09-03 17:41:00 +02:00
c9a034c0f8 ci: build an appbundle instead of an apk 2026-09-03 17:39:50 +02:00
4dbe0b71e6 fix(ci): persist PUB_CACHE across woodpecker steps
Each step runs in a fresh container from the builder image, so the
default /root/.pub-cache doesn't survive from `flutter pub get` into
the codegen/build steps. Point PUB_CACHE at a workspace-local path
instead, which is shared across steps.
2026-09-03 17:23:23 +02:00
eddfe52a51 ref(ci): switch to woodpecker ci 2026-09-03 17:20:03 +02:00
1f2f7e9d4e Merge pull request 'fixin maybe pt 2' (#43) from checkedearrabbit/firka:dev into dev
Reviewed-on: firka/firka#43
2026-09-02 11:09:07 +02:00
checkedear
5766eb6675 fixin maybe 3 2026-09-02 10:08:39 +02:00
b28bebcce1 Merge pull request 'fixin maybe' (#42) from checkedearrabbit/firka:dev into dev
Reviewed-on: firka/firka#42
2026-09-02 09:05:34 +02:00
checkedear
8fb5d5c89b fixin maybe 2 2026-09-02 07:56:35 +02:00
checkedear
f22ab629bc fixin maybe 2026-09-02 07:48:39 +02:00
zypherift
09ac4b7f61 delete mock from this repo 2026-08-28 13:16:42 +02:00
zypherift
5320625d83 add copy jwt 2026-08-28 13:12:40 +02:00
zypherift
eccdf90fd8 change mock data 2026-08-28 13:12:33 +02:00
zypherift
b4ccd52321 change gitignore 2026-08-28 10:57:10 +02:00
zypherift
4658366fd4 chore: bump l10n submodule 2026-08-28 10:50:09 +02:00
zypherift
aa77e25fe4 fix: mock server fills grade links and keeps sessions across restarts 2026-08-28 10:47:18 +02:00
zypherift
8984f8a915 feat: settings screen redesign with extras page and toggles 2026-08-28 10:47:10 +02:00
zypherift
4c28999d10 feat: surprise grades card and hide new grades until opened 2026-08-28 10:47:01 +02:00
zypherift
50274575f6 fix: mock server token claims and omission data 2026-08-27 20:44:05 +02:00
zypherift
fb8fad142a feat: clear account data and fix login redirect on logout 2026-08-27 20:43:48 +02:00
zypherift
2dccb59f7f fix: read grade kind from the correct api field 2026-08-27 20:43:42 +02:00
zypherift
7c9ade35f0 feat: add epic grades reveal screen 2026-08-27 20:43:33 +02:00
zypherift
ca9e6c3efa feat: add mock kréta server + login-screen mock mode toggle
Adds a standalone Go mock server (mock_kreta_server/) with an admin
GUI for editing student/grade/timetable/etc data, plus a login-screen
long-press toggle to point the app at it instead of the real e-Kréta
service for local testing. Also pulls in updated translations from
the firka-localization submodule.
2026-08-26 22:07:21 +02:00
a4af924653 ref: split core / grade themes up into multiple files 2026-08-16 15:16:41 +02:00
8bc52aadcb feat: groundwork for customization
- Bring customization page up to par with design
- Add a font picker
- Add a themes page
- Add theme previews
- Add a theming system
- Split built-in theme into core/grade themes
2026-08-16 15:02:37 +02:00
6101513a43 fix: make corner radius up to par with design 2026-08-16 12:41:07 +02:00
16e7ca49ca feat: initial customization screen
- Most buttons are stubs
2026-08-16 12:29:01 +02:00
dd05320346 update l10n 2026-08-16 11:39:02 +02:00
1f9512d03a fix: assign icons to all subjects with missing icons 2026-08-16 09:59:38 +02:00
d36992c7bc feat: track "Érettségi Felkészítő" as a subject 2026-08-16 09:55:41 +02:00
fd57184f99 fix(debug_screen): make test icons white 2026-08-16 09:51:32 +02:00
fa31c0d7a3 feat(home/tt): change transition animation to monthly tt 2026-08-16 09:51:05 +02:00
47e9047873 feat(home/tt): nav animations 2026-08-16 09:45:19 +02:00
7319878cb8 fix(home/tt): one haptic feedback per tap 2026-08-16 00:56:37 +02:00
3dc902b4cf fix: certain messages crashing flutter_html 2026-08-16 00:34:19 +02:00
71e1250932 fix: make error toasts dismissable 2026-08-16 00:23:43 +02:00
39651c2ab7 feat(home/*): add poll-to-refresh to each page 2026-08-16 00:15:44 +02:00
bffd1d66d9 feat(home/home): add a fade-in animation for cards 2026-08-15 23:52:20 +02:00
3480fb2ac0 fix: sync data in background if cache exists 2026-08-15 23:37:22 +02:00
f5a16da72d feat(timetable): seemless scrolling between weeks 2026-08-15 23:18:23 +02:00
04a441cd08 fix(settings): developer icon and stats for nerds icon 2026-08-15 23:05:21 +02:00
80856d1e8d fix: text overflow for developer options 2026-08-15 22:56:45 +02:00
9a74bd5178 fix: fix spacing around bottom nav icons 2026-08-15 22:54:18 +02:00
05c1cce469 fix: address all issues found by flutter analyze 2026-08-15 22:45:26 +02:00
0b1313d0be feat: refactor settings ui system 2026-08-15 22:15:47 +02:00
5a79c48e6d chore: update l10n 2026-08-15 21:39:17 +02:00
7bf9351b22 feat: refactor settings system
- Rename SettingsStore to SettingsRepository
- Migrate the `data.settings.group("settings").subGroup("customization")["theme"]`
pattern to use `Settings.themeBrightness.value`.
- Move settings definitions to SettingsSchema
- Use annotations for declaring metadata for settings
2026-08-15 21:28:39 +02:00
checkedear
368ad86f71 fix: timetable cache optimalizations 2026-08-02 21:06:52 +02:00
checkedear
46a508cc33 fix: refresh data on login 2026-08-02 21:05:53 +02:00
checkedear
2923d868e6 ref: reauth_cubit -> toast_cubit 2026-08-02 21:05:05 +02:00
checkedear
7f33b50822 ref: cache system rewrite 2026-08-01 11:09:28 +02:00
checkedear
54d792eb01 chore: update translations 2026-06-15 13:55:53 +02:00
checkedear
c8b402118c feat: omission card icon 2026-06-15 12:14:52 +02:00
checkedear
c0f3e61b90 fix: home_omissions icon and title 2026-06-15 11:58:04 +02:00
checkedear
9aaf43892f fix: omission info card 2026-06-15 11:50:46 +02:00
checkedear
a64a7f7509 feat: omissions 2026-06-15 11:39:20 +02:00
zypherift
1225e6763f remove crowdin file 2026-06-13 19:37:13 +02:00
zypherift
b159530de9 add copy to error screen 2026-06-13 19:36:21 +02:00
zypherift
5fb1f6cc30 fix debug build 2026-06-13 18:32:30 +02:00
checkedear
670968247a chore: update translations 2026-06-13 09:39:47 +02:00
5847301e70 Update README_de.md
Updated README_de.md to fit with the current README.md and README_en.md.
2026-06-13 03:19:53 +02:00
checkedear
6342f16d80 fix: build 2026-06-13 02:30:07 +02:00
checkedear
7167bf8da4 fix: grade chart design and indicate latest average 2026-06-13 02:08:01 +02:00
checkedear
7747e5d90b fix: grade card design 2026-06-13 01:16:29 +02:00
checkedear
49ec23c18e chore: update l10n 2026-06-13 00:18:41 +02:00
37e7cac61e Update README.md 2026-06-12 23:23:42 +02:00
d64ea1d2d6 Update README_en.md 2026-06-12 23:23:20 +02:00
d010544ff2 Update README_en.md 2026-06-12 23:10:38 +02:00
20d0cf9736 Update README_en.md 2026-06-12 23:09:03 +02:00
c8c299ba36 Update README_en.md 2026-06-12 23:00:53 +02:00
f3414499a7 Update README_en.md 2026-06-12 22:59:05 +02:00
4b1d113918 Update README_en.md 2026-06-12 21:59:50 +02:00
0e965a87b9 Update README_en.md 2026-06-12 21:01:25 +02:00
ead4dcd7b6 Update README_en.md 2026-06-12 20:59:10 +02:00
155d42d4d9 Update README_en.md 2026-06-12 20:57:00 +02:00
caa4db3254 Update README_en.md 2026-06-12 20:56:12 +02:00
4e64dd9959 Update README_en.md 2026-06-12 20:37:47 +02:00
07f6a5c562 Update README_en.md 2026-06-12 20:35:32 +02:00
f74ddb4c88 Update README_en.md 2026-06-12 20:23:04 +02:00
97b06044a4 Update README_en.md 2026-06-12 20:21:19 +02:00
2311556309 Update README_en.md 2026-06-12 20:19:25 +02:00
7a2bfb2cd8 Add CONTRIBUTING_de.md
A german version of CONTRIBUTING.md for all german speaking people.
2026-06-12 20:05:23 +02:00
39f683a0bf Update README.md 2026-06-12 20:01:58 +02:00
3576a3ab1e Update README_en.md 2026-06-12 20:01:27 +02:00
04af2c0402 Update README_de.md
Slight fix of boxes
2026-06-12 20:00:21 +02:00
70ff3ae8b9 Add README_de.md
Optional german README.md version for all german speaking people.
2026-06-12 19:58:35 +02:00
5a42884d20 Merge pull request 'Fixek + szöveg edit' (#31) from balint1414/firka:dev into dev
Reviewed-on: firka/firka#31
2026-06-11 18:13:02 +02:00
3fb0fd55de gitmodules: github>gitea 2026-06-11 16:00:36 +02:00
4c06daf02f Órarend szövegek szerkesztése 2026-06-11 15:52:50 +02:00
3d07b2b2ce Fordítás fix 2026-06-11 15:52:04 +02:00
9a45c5c456 Fix: Német órarend 2026-06-11 15:31:11 +02:00
checkedear
858d558cc3 feat: classroom name on lesson bottom sheet 2026-06-11 13:51:43 +02:00
checkedear
76f345cd6b fix: space under lesson slider 2026-06-11 13:29:55 +02:00
checkedear
e211d64ffb feat: shorten teacher's name 2026-06-11 13:29:20 +02:00
checkedear
c67ce7472a fix: event card on timetable 2026-06-11 12:25:13 +02:00
checkedear
2b9ac14d6e fix: active lesson on homepage 2026-06-11 11:50:12 +02:00
checkedear
eea10a4878 fix: lesson slider clipping 2026-06-11 11:27:13 +02:00
checkedear
1ef6ae6e87 fix: homework state update on homepage 2026-06-11 11:02:29 +02:00
checkedear
141431f378 fix: made whole homepage scrollable 2026-06-11 10:42:46 +02:00
checkedear
f0114e3976 fix: average calculations 2026-06-10 14:14:23 +02:00
checkedear
414a1ad254 feat: remove class average widget if there is no data 2026-06-09 13:21:41 +02:00
checkedear
d858c38bb1 fix: first lesson countdown 2026-06-09 12:49:52 +02:00
checkedear
87e3331428 revert: rounded subject average 2026-06-09 12:48:16 +02:00
checkedear
1d912abc7d tmp fix: themeless tests 2026-06-09 00:50:01 +02:00
3a2cdfce05 Update Jenkinsfile 2026-06-09 00:18:43 +02:00
c5ba318c3b Update Jenkinsfile 2026-06-09 00:15:02 +02:00
fe9a2b36f1 Update Jenkinsfile 2026-06-09 00:12:50 +02:00
80b05c1500 Update Jenkinsfile 2026-06-09 00:00:21 +02:00
2ed6a04bf5 Update Jenkinsfile 2026-06-08 23:40:57 +02:00
2d5ff89cad final shit 2026-06-08 23:13:11 +02:00
16b11564cc Update Jenkinsfile 2026-06-08 22:57:17 +02:00
1ca975f0bd Update Jenkinsfile 2026-06-08 22:50:44 +02:00
7985a11f99 Update Jenkinsfile 2026-06-08 22:32:02 +02:00
2cf95375cb jsdjsjsdjsdjsddjsdjsd 2026-06-08 22:24:34 +02:00
163b3a3135 i hate jenkins 2026-06-08 22:18:09 +02:00
e839b8fa70 Update Jenkinsfile 2026-06-08 22:12:48 +02:00
c6378c9d46 jsjsjdjjsjdj 2026-06-08 22:10:08 +02:00
51456b3b6e fuck you 2026-06-08 21:55:23 +02:00
checkedear
28f8f1d6f8 tmp fix: 50% weight grade style 2026-06-08 21:53:20 +02:00
d51c9d6411 Update Jenkinsfile 2026-06-08 21:52:12 +02:00
4ef2f479d6 Update Jenkinsfile 2026-06-08 21:42:18 +02:00
d81d261c52 Update Jenkinsfile 2026-06-08 21:35:15 +02:00
5baec2e65f Update Jenkinsfile 2026-06-08 21:33:52 +02:00
48ea97ecef Update Jenkinsfile 2026-06-08 21:33:02 +02:00
checkedear
1154997531 fix: gradle build 2026-06-08 20:55:55 +02:00
checkedear
dde05ce1db fix: navbar design 2026-06-08 20:40:57 +02:00
99ab6c07f7 update jenkins to that it only builds with developer keys for public access 2026-06-08 20:19:35 +02:00
checkedear
40c6b83627 fix: test bottom sheet design 2026-06-08 19:59:10 +02:00
checkedear
f4f6ddac72 fix: home_main 2026-06-08 19:57:46 +02:00
checkedear
938f2a56c6 fix: dismissed lesson design 2026-06-08 19:52:17 +02:00
checkedear
e1b571afa0 feat: test bottom sheet and design fixes 2026-06-04 12:20:43 +02:00
checkedear
729c281f1e ref: const constructors 2026-06-04 11:56:23 +02:00
checkedear
a61a41e677 ref: kreta_client 2026-05-17 19:40:49 +02:00
checkedear
e8f1f18725 feat: from, to params 2026-05-15 13:59:46 +02:00
checkedear
613b66bc22 ref: lesson widget 2026-04-29 21:21:36 +02:00
checkedear
1807d96895 fix: time left text for current lesson 2026-04-29 21:20:46 +02:00
checkedear
e06d2168c0 fix: display current lesson on homepage 2026-04-29 15:12:54 +02:00
checkedear
91603923bc fix: eplased lesson duration style pt. 2 2026-04-29 14:23:01 +02:00
checkedear
67e9ded2ed fix: dismiss modal by tapping on empty space 2026-04-27 17:08:27 +02:00
checkedear
e9aaa26e26 fix: currently viewed lesson indicator 2026-04-27 16:56:51 +02:00
checkedear
56f15a681c fix: timetable event overflow 2026-04-27 16:39:58 +02:00
checkedear
178ebf7271 fix: elapsed lesson duration style 2026-04-27 16:26:18 +02:00
checkedear
70c1397262 fix: subject grades overlap on switch 2026-04-27 16:20:18 +02:00
checkedear
a334901f84 fix: overall class average 2026-04-27 16:03:46 +02:00
checkedear
ddba6ad888 feat: show class grades 2026-04-27 15:49:31 +02:00
checkedear
780aaee1dd ref: grade utils 2026-04-26 23:53:51 +02:00
checkedear
09c408a6be feat: main page lessons carousel slider 2026-04-25 17:05:20 +02:00
checkedear
7847878551 feat: active and expanded lesson card 2026-04-25 17:04:32 +02:00
checkedear
09ef386eab fix: countdown widget design 2026-04-25 17:00:13 +02:00
checkedear
c19dd2f7eb feat: add borderColor to firka card 2026-04-25 16:58:33 +02:00
checkedear
39d4f49e99 fix: date format in test bottom sheet 2026-04-25 16:57:34 +02:00
checkedear
bbdbf406d4 fix: sun solid icon 2026-04-25 16:55:09 +02:00
checkedear
b17509f9db fix: timetable monthly view design 2026-04-21 22:41:48 +02:00
checkedear
9ec164daac ref: remove redundant files 2026-04-21 22:37:53 +02:00
checkedear
08f691d559 fix: subject card design 2026-04-21 22:36:30 +02:00
checkedear
ad9e2c6676 fix: grade subjects page design 2026-04-21 22:34:58 +02:00
checkedear
55dbf12a2f feat: main page with dates 2026-04-21 22:33:46 +02:00
checkedear
4fc13efc52 fix: bottom sheets 2026-04-19 16:30:26 +02:00
checkedear
5f16128bb0 feat: changable grade widget size 2026-04-19 15:53:56 +02:00
checkedear
4c8d73aa06 fix: B_16R font 2026-04-19 15:53:28 +02:00
checkedear
e4629d8489 fix: message content style and links 2026-04-19 15:52:33 +02:00
checkedear
f806dd8143 fix: test type alignment 2026-04-19 11:48:39 +02:00
checkedear
f653dc9fb4 fix: test type oveflow 2026-04-18 14:04:34 +02:00
checkedear
06249bfc3d fix: timetable style 2026-04-18 13:38:44 +02:00
checkedear
607f49bafc fix: test bubble style 2026-04-18 13:36:49 +02:00
checkedear
251e8de446 ref: lesson card 2026-04-18 13:36:09 +02:00
checkedear
21845f89a8 fix: firka_card margin and shadow 2026-04-18 13:32:19 +02:00
checkedear
25b1d06c06 fix: some fonts 2026-04-18 13:28:51 +02:00
checkedear
dd20aa6138 fix: get prev lesson 2026-04-15 22:17:45 +02:00
checkedear
9aa84c6fa1 fix: text grade title once again 2026-04-15 21:53:12 +02:00
checkedear
6c75acad66 fix: text grades title 2026-04-15 21:46:50 +02:00
checkedear
6311cafd51 fix: grade design 2026-04-15 18:57:03 +02:00
checkedear
1de32a35a4 fix: show grades by creation date 2026-04-15 16:29:02 +02:00
checkedear
f8a69a7561 feat: show tests on main home page 2026-04-15 16:26:35 +02:00
checkedear
f73c1127e7 feat: show notice board items as messages 2026-04-15 15:14:04 +02:00
checkedear
a369e4ab14 ref: kreta_api 2026-04-15 01:16:48 +02:00
checkedear
8b04b77327 ref: remove unused debug log 2026-04-15 01:00:37 +02:00
checkedear
d56db4fe3a fix: grade chart style 2026-04-14 14:58:18 +02:00
checkedear
e7c0a95638 fix: grade style 2026-04-13 15:30:32 +02:00
checkedear
fa66d9af14 ref: firka_card 2026-04-13 15:25:48 +02:00
checkedear
90c334d859 ref: getGradeColor and rounding accepts any num as grade 2026-04-13 15:23:34 +02:00
checkedear
cc9ebcf6b0 ref: kreta_api 2026-04-11 19:25:23 +02:00
checkedear
ac914aa02e Merge branch 'fix-long-message' into dev 2026-03-28 18:29:36 +01:00
checkedear
061f803f93 fix: long message overflow 2026-03-28 18:29:00 +01:00
checkedear
57c5e17b1c Merge branch 'fix-issue-29' into dev 2026-03-28 16:29:34 +01:00
checkedear
fa6f5390b1 Merge branch 'fix-issue-16' into dev 2026-03-28 16:27:18 +01:00
checkedear
21ff8f082f ref: firka_card 2026-03-28 13:23:51 +01:00
checkedear
3b09d072f0 feat: added 400% to the calculator 2026-03-27 20:15:01 +01:00
checkedear
84f8e75694 Merge branch 'fix-issue-16' into dev 2026-03-27 19:44:04 +01:00
checkedear
1a05cce49b fix: issue #16 2026-03-27 19:32:20 +01:00
checkedear
e732168a1b fix + ref: nav tap animation 2026-03-26 20:03:18 +01:00
zypherift
68035140b9 fix 2026-03-05 19:20:19 +01:00
zypherift
e004b7ee35 fix: higher res color wheel 2026-03-05 18:21:41 +01:00
zypherift
34718ed8ae Adjust webview loading fade timing 2026-03-05 18:19:37 +01:00
zypherift
03a5b5e767 feat: add disabled colors 2026-03-05 17:56:05 +01:00
zypherift
d30dc67626 push l10n 2026-03-05 17:55:50 +01:00
zypherift
d0a517ae1e feat: add privacy policy to domain browser, and add color change for url, and show url 2026-03-05 17:23:10 +01:00
32a6452c1b bump version string to 1.1.2 2026-03-05 14:52:55 +01:00
579bf6bcad firka(android): make room number chips have the same length
Closes: #13
2026-03-05 14:51:06 +01:00
4ecf0d1a3f firka_wear: fix RangeError in home_screen substring
Closes: #14
2026-03-05 13:29:02 +01:00
0675a5109a firka: ignore % grades and half year / end year grades
Closes: #22
2026-03-05 13:22:37 +01:00
bfb06d3e5f update l10n 2026-03-05 10:17:18 +01:00
71b4b6aec7 firka: ignore final and percent grades in averages 2026-03-05 10:15:55 +01:00
be6d28cfe3 firka: ignore subjects without grades in avg 2026-03-05 09:52:19 +01:00
8cfca13d1a firka: fix text style for hw bottom sheet
Closes: #19
2026-03-05 09:40:11 +01:00
632bb81408 firka: use textPrimaryLight for mark hw as done btn
Closes: #18
2026-03-05 09:33:47 +01:00
zypherift
f953dbd49f fix: null-safe percentage detection 2026-03-05 09:22:28 +01:00
zypherift
01e7e559ba fix: maybe fixed percentages being calculated into the grade? pls review 2026-03-05 09:22:28 +01:00
b6bfef7715 update docs 2026-03-05 09:06:26 +01:00
bf75f72bcd update codegen lock 2026-03-05 09:01:11 +01:00
zypherift
b0cb020d76 feat: smoother graph using 3 weighted avarages :O 2026-03-05 08:40:50 +01:00
zypherift
4239ffa00c chore: stream home data cache-first then refresh 2026-03-05 08:40:50 +01:00
zypherift
427b6f8086 fix: snap grade calculator weights to common percentages 2026-03-05 08:40:50 +01:00
zypherift
fbd2351073 fix: flashbang on new screen pushes 2026-03-05 08:40:50 +01:00
zypherift
150e90d19b edit: replace spinner with dave 2026-03-05 08:40:50 +01:00
zypherift
a6cf8b13c6 edit: fine tune wall collision vibration 2026-03-05 08:40:50 +01:00
zypherift
d8ae8471ab edit: l10n 2026-03-05 08:40:45 +01:00
zypherift
0e65f8e68c add: debug screen for acc 2026-03-04 23:02:25 +01:00
zypherift
3912ad593b edit: l10n 2026-03-04 23:02:25 +01:00
zypherift
1f6eaaeccc add: icons 2026-03-04 23:02:25 +01:00
40f188c2e2 codegen(firka): restore AndroidManifest.xml
flutter_launcher_icons replaces every icon inside
the AndroidManifest.xml which isn't ideal when having
multiple app icons
2026-03-04 21:34:27 +01:00
0aae3801b7 chore: update l10n for firka_wear 2026-03-04 21:17:17 +01:00
26902b7616 add build script for windows 2026-03-04 21:10:09 +01:00
ffaf2c77e0 bump version string to 1.1.1 2026-03-04 18:51:55 +01:00
23f7f7cd48 firka_wear: add error screen
Closes #12
2026-03-04 15:20:15 +01:00
c2879766eb build: run pub get and codegen 2026-03-04 10:55:40 +01:00
01cc08d5f3 codegen: generate missing .g.dart files 2026-03-04 09:56:52 +01:00
c386e1194b auto generate version code 2026-03-04 09:35:17 +01:00
67ed4e03eb firka: remov brotli again 2026-03-04 06:38:01 +01:00
c7d1f80e79 Merge pull request 'IOS Build fix' (#10) from devbeni/firka:dev into dev
Reviewed-on: firka/firka#10
2026-03-04 06:29:07 +01:00
7531e58114 Update project version to 1102 in Info.plist and project.pbxproj 2026-03-04 00:23:15 +01:00
c1e329cb5a Update subproject commit reference in l10n directory 2026-03-03 23:49:35 +01:00
dad52bf20e Merge branch 'dev' of https://git.firka.app/devbeni/firka into dev 2026-03-03 23:46:38 +01:00
5fb6d03d9c Remove Brotli subproject from Android app directory 2026-03-03 23:46:37 +01:00
1ef757d10f merge upstream 2026-03-03 23:46:10 +01:00
444abb83c2 Remove fmb_dart subproject from vendor directory 2026-03-03 23:44:24 +01:00
e835dcf6b1 firka: fix app icon changing
Closes: #9
2026-03-03 23:26:02 +01:00
e61a19fbbf Merge branch 'dev' of https://git.firka.app/devbeni/firka into dev 2026-03-03 23:23:30 +01:00
a937b854cd Update localization files and enhance build script for native assets handling 2026-03-03 23:22:43 +01:00
6d8f17ac00 Update object version and set development team for RunnerTests configuration 2026-03-03 23:11:25 +01:00
78dd4239cc merge upstream 2026-03-03 23:10:56 +01:00
39c5ca357e firka: remove package: 'firka'
Closes: #5
2026-03-03 23:08:45 +01:00
8249dbf03e remove dependency on brotli 2026-03-03 23:05:40 +01:00
c4e30ee4a6 Refactor project settings to improve folder exception handling and update object version 2026-03-03 22:31:16 +01:00
1291d20e55 Update app group identifiers to unify naming convention across the project 2026-03-03 22:14:04 +01:00
fb8d57c0ee Refactor entitlements and project settings to unify app group identifiers and update team identifiers 2026-03-03 22:11:16 +01:00
e79de0326c bump version codes for firka and firka_wear 2026-03-03 21:43:20 +01:00
de335af3c1 add build script 2026-03-03 20:29:56 +01:00
4be0bcd813 bump version to 1.1.0 and version code to 1100 2026-03-03 20:28:31 +01:00
zypherift
b3f46d8e84 Merge branch 'dev' of https://git.firka.app/firka/firka into dev 2026-03-03 20:17:38 +01:00
zypherift
e97246ee55 more vibration 2026-03-03 20:17:36 +01:00
zypherift
159fb73919 codegen 2026-03-03 20:17:01 +01:00
7c35a5675c Revert "accidentaly deleted"
This reverts commit 4c9eca217e.
2026-03-03 20:14:53 +01:00
45adddb7f7 add nix devshell 2026-03-03 20:11:10 +01:00
zypherift
4aad2bb292 l10n 2026-03-03 20:05:53 +01:00
zypherift
4c9eca217e accidentaly deleted 2026-03-03 20:05:46 +01:00
zypherift
ec6700e1cb Merge branch 'dev' of https://git.firka.app/firka/firka into dev 2026-03-03 20:00:42 +01:00
zypherift
b55595108f add assets to simulation 2026-03-03 20:00:24 +01:00
zypherift
8b3ab4a3a9 add colorwheel asset for new
loginscreen
2026-03-03 20:00:08 +01:00
zypherift
046b7926c4 nightmare: add simulation from scratch for collision and movement 2026-03-03 19:59:49 +01:00
zypherift
5626466107 disable drag bc login is fullscreen 2026-03-03 19:55:15 +01:00
zypherift
6c674bd596 finish webview 2026-03-03 19:53:34 +01:00
zypherift
9465a2b2a7 begin changing webview 2026-03-03 19:53:05 +01:00
484d8cf4cb codegen: add lock files 2026-03-03 18:40:59 +01:00
863f9c8077 firka_wear: add codegen script 2026-03-03 18:15:52 +01:00
a8983074dd firka: show weighted avg when adding ghost grades 2026-03-03 18:09:35 +01:00
e031c18ecb firka: fix Live Activity registration with fallback on resume and delayed retry 2026-03-03 17:37:39 +01:00
ba075c3b14 firka: add a section for ghost grades 2026-03-03 17:34:44 +01:00
32936c2aa5 firka: extract firka_common package with shared widgets (Isar kept separate)
- Create firka_common package with core helpers (debug, json, icon), theme,
  and shared widgets (FirkaCard, FirkaShadow, GradeWidget, GradeSmallCard,
  ClassIconWidget, FirkaIconWidget, DelayedSpinnerWidget, CounterDigitWidget)
- Keep Isar models (GenericCacheModel, TimetableCacheModel, HomeworkCacheModel,
  DatedCacheEntry, util) in firka and firka_wear - not moved to firka_common
- Update firka and firka_wear to depend on firka_common for shared UI only
- Add configurable roundGrade thresholds for firka settings
- Add package param to FirkaIconWidget for app asset paths
2026-03-03 15:33:11 +01:00
zypherift
ad75a80805 change text 2026-03-03 15:30:02 +01:00
zypherift
0ce7db23de add new padding 2026-03-03 15:16:47 +01:00
zypherift
0317f47b88 change height to fullscreen 2026-03-03 15:14:53 +01:00
zypherift
5a2616bf71 l10n 2026-03-03 15:14:34 +01:00
zypherift
9753717a25 add webview file for later use 2026-03-03 15:14:22 +01:00
zypherift
cf4e27ad30 add route 2026-03-03 15:12:22 +01:00
d96c4b66bb firka: show ghost grades on the chart and in the grades list 2026-03-02 21:40:01 +01:00
68ddffd808 firka: add GradeChartWithInteraction helper, use on grades and subject screens 2026-03-02 21:21:23 +01:00
483c8de0c0 firka: add grade calculator bottom sheet from Figma 2026-03-02 21:16:29 +01:00
4850923305 firka: add grade/:subjectId settings modal 2026-03-02 20:56:11 +01:00
489a3a1d24 firka_wear: add rotary support 2026-03-02 20:34:02 +01:00
4b0bf5a22d firka_wear: add LessonCardSmall and dynamic lesson pages
Implements the small lesson card from Figma.
2026-03-02 20:25:13 +01:00
e07b0264b8 firka_wear: trim the next lesson too 2026-03-02 19:19:44 +01:00
32d8481217 firka_wear: put the "..." in the correct place 2026-03-02 19:18:22 +01:00
d0c3938510 firka_wear: extract home body to part, add vertical scrollable PageView with placeholders 2026-03-02 19:17:40 +01:00
636c2ea68d firka_wear: fix overflow if the lesson's room name or name is long 2026-03-02 18:22:55 +01:00
b986d8b660 firka_wear: centralize app state, add logging, remove unused routes, add Bloc for sync state 2026-03-02 15:48:11 +01:00
613db488b1 firka_wear: pass model number to phone when pairing 2026-03-02 15:07:51 +01:00
5d5c3c4c6f fix wearos pairing and syncing 2026-03-02 14:54:00 +01:00
9f36569d2a firka_wear: refactor lib folder structure to match firka 2026-03-01 15:13:51 +01:00
9fc73e3c5c firka_wear: use kreta_api for API models 2026-03-01 14:57:24 +01:00
bd53ba6c9b firka: use kreta_api for API models and types 2026-03-01 14:56:09 +01:00
8d95c71fae chore: add kreta_api shared package 2026-03-01 14:52:54 +01:00
befaa45cdf firka(android): use app icon for Wear sync foreground service notification 2026-03-01 14:39:27 +01:00
5570f73cb4 firka: extract startWearSyncServiceWithFreshCache for Wear OS 2026-03-01 14:31:23 +01:00
59b470a64c firka_wear: local sync store, 1h rule, remove KretaClient; data from phone only 2026-03-01 14:31:23 +01:00
4811519ced firka_wear: sync API models from firka (Lesson, Grade, Subject, generic) 2026-03-01 14:31:23 +01:00
3580dc2ef8 firka(android): Wear sync foreground service, getLocalizedString, no Android strings 2026-03-01 14:31:23 +01:00
eb1312398d firka: add Wear sync cache, payload, helper and background entrypoint 2026-03-01 14:31:23 +01:00
a70457528b firka(android): add Wear OS support toggle in settings 2026-03-01 14:31:23 +01:00
6bbdbadac4 firka: update l10n 2026-03-01 14:31:22 +01:00
911a1970e4 firka_wear: make it buildable again 2026-03-01 10:59:05 +01:00
65ab5caa69 firka: update l10n 2026-03-01 10:18:09 +01:00
a9624df915 firka: unify grade widget 2026-02-28 23:32:55 +01:00
52f6ebcfd3 firka: add grade summary bar with dropdown under subjects chart 2026-02-28 23:12:24 +01:00
635fdd5497 firka(android): lesson/room badge sizing, centered text, uniform room width 2026-02-28 22:31:46 +01:00
a11f118861 firka(android): timetable widget responsive layout, resize handling, centered lessons 2026-02-28 22:05:30 +01:00
5c205a9844 firka(android): widget refresh via broadcast + updateAll, Glance IO off main thread 2026-02-28 17:55:14 +01:00
f620bfe76c firka(android): fix widget refresh via GlanceAppWidget.updateAll 2026-02-28 16:04:29 +01:00
b99051dbfc firka: add Generate widget state for date to developer options 2026-02-28 15:51:05 +01:00
c58f34f499 firka: rewrite Android widget and fix refresh 2026-02-28 15:45:04 +01:00
1e7dceb995 firka: fix logout button to refresh app like login 2026-02-28 13:42:34 +01:00
022915378e firka: pop login sheet and navigate to home after OAuth 2026-02-28 13:26:16 +01:00
589e722310 firka: fix login webview not receiving touches 2026-02-28 12:59:51 +01:00
12cce27e9d firka: highlight current value on grade chart left axis 2026-02-28 12:06:18 +01:00
826312b503 firka: give chart higher gesture priority over page swipe 2026-02-28 11:18:24 +01:00
e071fc15d1 firka: stream home items in progressively, keep spinner until all fetch 2026-02-28 11:12:25 +01:00
94b819ffbd firka: add debug button to clear all cache 2026-02-28 11:04:06 +01:00
299a769f74 firka: migrate state management to Bloc
- Add flutter_bloc dependency
- Create ThemeCubit, SettingsCubit, ProfilePictureCubit, ReauthCubit, HomeRefreshCubit
- Replace UpdateNotifier/ValueNotifier with Bloc across app
- Remove update_notifier.dart and FirkaState globalUpdate listener
- Provide cubits via MultiBlocProvider at app root
2026-02-28 10:46:11 +01:00
4abf995fde firka: add haptic feedback to bottom nav icons 2026-02-28 10:04:04 +01:00
e261f73c30 switch to go_router 2026-02-28 09:03:01 +01:00
fc9907f33d firka: refactor file structure 2026-02-28 07:47:33 +01:00
2d2c2fbef9 chore: dart format + remove unused imports 2026-02-27 23:23:56 +01:00
Horváth Gergely
d5c3d02dfa Remove onAppOpened and related LiveActivity state
Remove the _lastActivityRecreation field and the onAppOpened(...) method from LiveActivityService, which previously handled ending/creating activities, refreshing push tokens, fetching the week's timetable and scheduling background fetch. Update home_screen to call LiveActivityService.checkAndUpdateTimetable(...) instead of onAppOpened, and tweak related log messages to clarify the behavior. This simplifies LiveActivity lifecycle on app resume and stops forced activity recreation/token refresh performed by the removed method.
2026-02-27 23:23:56 +01:00
Horváth Gergely
40a1e8f459 Improve Watch sync, token, and live activity handling
Multiple fixes and improvements for watch <> phone sync, token recovery, and live activity behavior:

- WatchSessionManager: add mergeApplicationContext to avoid clobbering app context, add thread-safe pending auth queue and flush, add sendMessageToWatch API, ensure message handling runs on main thread, add reply-timeout logic for language requests, support fire-and-forget messages, and improve enqueue/flush logic.
- WatchConnectivityManager & SettingsView: publish shared session state on force-logout/logout and improve account-switch/token handling; clear DataStore error and reset recovery state after token updates.
- DataStore & WatchL10n: add recovery-in-progress guard to avoid duplicate recovery runs, reset language version tracking on account switch, make WatchL10n.setLanguage main-thread safe.
- TokenManager & SharedKeychainManager: remove old keychain observer plumbing and instead publish shared session state when active token changes or is deleted.
- UI tweaks: reduce icon/text sizes and spacing in pairing view; only show sync button when paired; Settings logout now also publishes shared state.
- Watch sync wiring in Flutter: replace direct watch_connectivity usage with a MethodChannel-backed WatchSyncHelper.sendMessageToWatch and onWatchMessage callback; main and pairing UI updated accordingly.
- Kreta client: replace simple boolean mutex with a Completer-based mutex and timeout handling to avoid busy-waiting.
- LiveActivityService: throttle/avoid frequent activity recreation (cache last recreation time), skip placeholder creation when called from background, and minor cache-clearing adjustments.
- HomeScreen: add WidgetsBindingObserver to manage lifecycle, prevent prefetch while backgrounded, debounce prefetch, ensure LiveActivity registration runs once and refresh on resume after first prefetch.

These changes increase robustness of token sync and account switching, reduce race conditions and duplicate work, and avoid conflicts between WCSession and Flutter plugin delegates.
2026-02-27 23:23:56 +01:00
0c4bc4cd40 firka(android): fix splash screen 2026-02-27 23:23:56 +01:00
28fb054571 fix warnings, reformat files 2026-02-27 23:23:56 +01:00
b0c8f1f4b3 firka(android): optimize build time 2026-02-27 23:23:56 +01:00
2ea0549258 add codegen script 2026-02-27 23:23:56 +01:00
c0ea4fde7a update lib/l10n 2026-02-27 23:23:56 +01:00
d56422ba0d update pubspec and rebuild isar files 2026-02-27 23:23:56 +01:00
3fa00fa6b6 grafikon javítgatás? 2026-02-27 23:23:56 +01:00
ef14b9dc0e HW fix 2026-02-27 23:23:56 +01:00
Pearoo
9238869568 feat: add error page (+pubspec merge fix) 2026-02-27 23:23:56 +01:00
6f04f9e9b8 Tantárgy megjelenítése 2026-02-27 23:23:56 +01:00
b6c8bb3267 grade chart próbálkozgatás 2026-02-27 23:23:56 +01:00
5ef21222aa Hiba fix (-1-es óraszám) 2026-02-27 23:23:56 +01:00
c0a8c696a3 Összátlag 2026-02-27 23:23:56 +01:00
f4a7fe7923 showSubjectBottomSheetSettings belekezdés (?) 2026-02-27 23:23:56 +01:00
c2f3af7be1 Átlagszámláló segéd 2026-02-27 23:23:56 +01:00
3440ea2eef gradeDefault svg hozzáadása 2026-02-27 23:23:56 +01:00
34475f35b0 Update firka/lib/ui/phone/screens/home/home_screen.dart 2026-02-27 23:23:56 +01:00
091647dbe4 chart folytatás 2026-02-27 23:23:56 +01:00
36ca357392 chart megjelenítése 2026-02-27 23:23:56 +01:00
dbbc119fd5 Hiba fix: nincs középen az óraszám 2026-02-27 23:23:56 +01:00
448be1ae10 pici fix 2026-02-27 23:23:56 +01:00
23beb6e31f Extras menü átalakítása dizájn alapján 2026-02-27 23:23:56 +01:00
c122eb4ff9 asszem hiba fix 2026-02-27 23:23:56 +01:00
8568aa5678 Holnapi órák megjelenítése, amennyibe nem lesz dolgozat (Félkész) 2026-02-27 23:23:56 +01:00
12dea89cd4 HTML házinál 2026-02-27 23:23:56 +01:00
67965610ce Óraszámok megjelenítése 2026-02-27 23:23:56 +01:00
7cede065c3 Kéthetes órarend 2026-02-27 23:23:56 +01:00
ae4862a653 Holnapi dolgozat megjelenítése 2026-02-27 23:23:56 +01:00
30f493ddc4 Értékelésnél tantárgy megtekintése gomb 2026-02-27 23:23:56 +01:00
50eb96377e pici szerkesztés 2026-02-27 23:23:56 +01:00
61c795e362 Jegy dátum formázás 2026-02-27 23:23:56 +01:00
7c65a696aa Tantárgy dizájn alapján szerkesztés 2026-02-27 23:23:56 +01:00
a341833441 nyelv 2026-02-27 23:23:56 +01:00
8bf3cc72be Születésnap jelzés konfettivel 2026-02-27 23:23:56 +01:00
33028cdf38 tördelés fix 2026-02-27 23:23:56 +01:00
f01b9d4fd5 License rész javítás 2026-02-27 23:23:56 +01:00
41ff65d50b Dátum formázás javítása 2026-02-27 23:23:56 +01:00
ae9ef1603a added loading spinner, fade out, and matched the color theme to the login page 2026-02-27 23:23:56 +01:00
1d8d341f2d fordítás hozzáadása 2026-02-27 23:23:56 +01:00
633926bf2d Áthúzással jelzés, hogy kész a házi 2026-02-27 23:23:56 +01:00
a6344e42fa dátum formálása fix, showHomeworkBottomSheet hozzáadása 2026-02-27 23:23:56 +01:00
9cb2265a97 Adatbázisba mentés: kész házik 2026-02-27 23:23:56 +01:00
971a35b738 HomeworkDoneModelSchema hozzáadása 2026-02-27 23:23:56 +01:00
69ee75966d SVG hozzáadása 2026-02-27 23:23:56 +01:00
177bf3bf38 generált homework_cache_model_g.dart 2026-02-27 23:23:56 +01:00
5b794b199c Órarend szünet fix (2) 2026-02-27 23:23:56 +01:00
a000481cd9 Órarend fix: Szünetek megjelenítése 2026-02-27 23:23:56 +01:00
ae79a44df9 firka: make android buildable again 2026-02-27 23:23:56 +01:00
Horváth Gergely
70213e376c Refactor timetable day selection and parsing
Add robust date parsing and simplify lesson selection logic. Introduces ISO8601 formatters (with and without fractional seconds) and updates parseNextSchoolDayDate to try both variants, plus existing yyyy-MM-dd fallback. Adds LessonCandidate, startOfDay and nextSchoolDay helpers and builds a sorted candidate list (today, tomorrow, next school day) to pick the appropriate lesson set and correctly set isNextDay/isNextSchoolDay flags. Cleans up previous branching-heavy logic and improves handling of edge cases (lessons finished, next-school-day resolution).
2026-02-27 23:23:56 +01:00
Horváth Gergely
146124228a Improve watch UI and robust language sync
Several watch UI and sync improvements: clamp CountdownRing values and use clamped values for progress/color/display; add optional backgroundColor to FirkaCard and refactor HomeView to use lessonTitleWithStatus, lessonCardBackgroundColor and improved break time calculation and refresh handling (onChange of lastUpdated). TimetableView now shows status icons/colors via helper methods. DataStore now returns a localized "time_now" for recent updates. WatchSessionManager handles Flutter channel/unready states by serving shared language state when available and avoids empty language replies. Dart fixes: await initLang in settings, return null from WatchSyncHelper when uninitialized, and attempt to publish language to watch after initialization in main.
2026-02-27 23:23:56 +01:00
Horváth Gergely
9a99a6869a Use zip to iterate adjacent lessons
Replace index-based loops with zip(entry.lessons, entry.lessons.dropFirst()) in TimetableMediumView and TimetableLargeView to iterate adjacent lesson pairs. This improves readability and safety (avoids manual index arithmetic and potential out-of-bounds issues) while keeping the same break-detection logic.
2026-02-27 23:23:56 +01:00
Horváth Gergely
61953b68d2 Add shared session/language state & refresh leases
Introduce shared session and language state plus cross-device refresh leases to improve Watch/iPhone sync. Adds SharedSessionStateManager, SharedLanguageStateManager and RefreshLeaseManager (keychain-backed) and exposes accessGroup via SharedKeychainManager. Wire shared state into WatchSessionManager (publish/load language and session state, immediate token send via message + userInfo + applicationContext, reachability check, lease-related Flutter handlers) and into WatchConnectivityManager (parse versions, apply immediate token updates). Update DataStore and WatchL10n to reconcile shared session/language state, handle stale account switching, and request tokens from phone when needed. Add TokenManager watch-side lease wrapper for refresh coordination, UI tweaks for pairing/no-token messages and icons, small fixes (date parsing in widget provider, background refresh cadence to ~15 min, time-since localization keys and usage), and various helper utilities for parsing int64 and state versioning.
2026-02-27 23:23:56 +01:00
Horváth Gergely
69dde9281d Send language to Watch and handle locale changes
iOS: Update WatchSessionManager to send the current language via WCSession.default.updateApplicationContext with logging and error handling, in addition to existing transferUserInfo. Dart: await initLang during startup and add dispatcher.onLocaleChanged handler that re-initializes language when the app is in auto-language mode, logs locale changes, and triggers a global UI update.
2026-02-27 23:23:56 +01:00
Horváth Gergely
86c7641c60 Migrate token storage to shared Keychain
Add SharedKeychainManager and migrate token storage from the old iCloud Key-Value (KV) approach to a synchronized Keychain-backed solution. Replace iCloudTokenManager usages across WatchSessionManager, TokenManager, and WatchConnectivityManager, update saveToken API to syncToSharedKeychain, and add KV-store migration logic that moves existing KV entries into the shared Keychain and clears the old KV store. Update entitlements (add keychain-access-groups) for both Runner and the Watch app, add/remove files in the Xcode project, delete iCloudTokenManager.swift. Also include access-group resolution, logging, and compatibility observer methods in the new manager.
2026-02-27 23:23:56 +01:00
Horváth Gergely
71f1412164 Improve token recovery and iCloud probing
Track and surface classified token recovery failures and add a timed iCloud probe to accelerate recovery. TokenManager: introduce lastRecoveryFailure, clearLastRecoveryFailure(), and iCloudProbeTimeoutNs; add probeICloudTokenWithTimeout() and attempt an early iCloud-probe apply before refresh flow; record TokenError results from refresh attempts and abort recovery early on network errors; clear failure on successful actions; default lastRecoveryFailure to .noToken when all attempts fail. KretaAPIClient: clear failure on valid token/recovery success and throw a classified APIError when recovery produced a known TokenError. Overall: better diagnostics, faster iCloud-based short-circuiting, and more robust recovery error handling.
2026-02-27 23:23:56 +01:00
Horváth Gergely
7c344be550 Add robust Apple Watch token sync & force-logout
Improve Apple Watch sync resilience and token safety across iOS and Flutter. Key changes:

- Watch (watchOS): rate-limit phone token requests, handle "force_logout" via applicationContext/userInfo and perform local token deletion/cleanup. Added cooldown tracking.
- iPhone host (Swift): expose Flutter methods to check watch app installation, clear iCloud token, and send force-logout to the watch; refuse to forward expired tokens and avoid using iCloud fallback when Flutter reports reauth needed.
- Flutter (WatchSyncHelper/KretaClient): cache and check whether a paired Watch app is installed before touching iCloud/watch; reject expired access tokens (both incoming and outgoing) and prevent sending expired tokens to watch; added fresh-install cleanup to clear iCloud/local state once per install; added methods to notify watch of forced logout and to clear iCloud token.
- Initialization: run fresh-install cleanup before attempting iCloud recovery and skip recovery if cleanup ran.
- Login/settings/home UI: only attempt watch sync when a watch is installed; clear iCloud token on account removal (iOS); minor UX/timing and formatting cleanups.

These changes prevent propagation of expired tokens, reduce redundant phone/watch messaging, and provide a controlled force-logout flow for account removal or fresh installs.
2026-02-27 23:23:56 +01:00
Horváth Gergely
e620f3e564 Add force account-switch and iCloud recovery
Introduce forced account-switch handling and improve token selection/recovery logic.

- WatchConnectivityManager & ReauthRequiredView: parse sentAtMs robustly and compute a shouldForceAccountSwitch flag when an incoming token is for a different account; pass forceAccountSwitch to TokenManager.saveToken and include it in logs.
- TokenManager: add localTokenFromKeychainAndFile helper, prefer the active account when selecting a local token, and refine loadToken to prefer active-account tokens but fall back to the freshest available. saveToken now accepts forceAccountSwitch and will persist a token even if it switches accounts when requested. Adjust iCloud handling to skip iCloud token only if a local active-account token exists; improve diagnostic logging.
- WatchToken: enhance isNewer comparison to consider effectiveUpdatedAt and tokenVersion before falling back to expiryDate.
- HomeScreen (phone): import watch_sync_helper and run a secondary iCloud recovery pass on startup (with a short delay) to apply a fresher iCloud token to the app state if needed.

These changes aim to make cross-device token sync more robust, correctly handle account switches triggered from the watch, and recover stale auth state from iCloud on app startup.
2026-02-27 23:23:56 +01:00
B3ni
2719e6bf77 Update main.dart 2026-02-27 23:23:56 +01:00
Horváth Gergely
55de7d1645 Improve iCloud / Watch token sync & recovery
Add robust handling for token synchronization and recovery across iOS/watchOS and Flutter.

- iOS (WatchSessionManager.swift): queue token events until Flutter signals watchSyncReady, flush queued auth events and iCloud recovery notifications when ready, forward tokens with de-duplication logic, provide fallback to iCloud when Flutter isn't ready, and avoid sending duplicate events. Adds helper methods for token payloads and comparison.
- Token management (TokenManager.swift): track active studentIdNorm in UserDefaults to prefer a single account, persist active account on saves, prefer freshest token within preferred account, improve proactive refresh with configurable lead time and cooldown, skip unnecessary recoveries when a valid token exists, and add cooldown for phone recovery requests.
- iCloud logic (iCloudTokenManager.swift): avoid overwriting tokens across accounts using updatedAt comparisons and only ignore truly stale saves.
- Dart client (kreta_client.dart): skip recovery if local token still valid, clearer iCloud recovery retry flow, fallbacks, and clear reauth flag when usable token applied.
- Token model (token_model.dart & generated .g.dart): add tokenVersion and updatedAtMs fields, populate them on creation/from response, and update Isar schema + generated query helpers.
- Watch sync helper (watch_sync_helper.dart): include tokenVersion/updatedAt in outgoing payloads, resolve incoming/current versions more robustly, use updatedAt when deciding freshness, and invoke watchSyncReady on init so native side can flush queued events.
- App init (main.dart): run an iCloud recovery check on iOS during startup and only clear reauth flag when the chosen token is still in the future.

These changes improve cross-device token consistency, reduce spurious reauth prompts, and make proactive refresh/recovery less noisy and more efficient.
2026-02-27 23:23:56 +01:00
Horváth Gergely
0b78712e64 Token recovery and sync refactor; LiveActivity UI
Centralize and harden token recovery and synchronization across watch/phone components and update LiveActivity UI for iOS 18.

Highlights:
- Introduced a centralized recovery flow in TokenManager.recoverToken() with locking, multi-step recovery (local refresh, keychain/file/watch, iCloud retries) and refreshTokenInternal helper. Added proactive refresh and improved refresh logic to include tokenVersion/updatedAtMs metadata.
- Added tokenVersion and updatedAtMs to WatchToken and propagated these fields through iCloud, WatchConnectivity, WatchSessionManager, and ReauthRequiredView payloads. Many save/load paths now avoid unnecessary iCloud sync and ignore stale tokens based on version/timestamps.
- WatchConnectivityManager now filters stale incoming updates using sentAtMs and persists lastAppliedTokenUpdateMs to avoid regressions; payloads include updatedAtMs/tokenVersion when available.
- DataStore and KretaAPIClient use the centralized recovery API instead of ad-hoc retry logic or direct WatchConnectivity requests.
- iCloudTokenManager stores tokenVersion/updatedAtMs, ignores stale saves, and uses consistent timestamps.
- LiveActivityWidget and LiveActivity updated: iOS 18+ uses new adaptive/family-aware views (including a new SmallActivityView) while legacy behavior is preserved for iOS 16.2–17.x.

These changes aim to make token synchronization more reliable across devices and OS versions, reduce duplicate/conflicting writes, and provide a more adaptive live activity UI on newer iOS releases.
2026-02-27 23:23:56 +01:00
Horváth Gergely
6c67d22fb8 Add active account handling & token recovery
Introduce active account selection and robust token recovery across watch and phone code. Adds a new Dart helper (active_account_helper.dart) to resolve the active account/token and updates KretaClient, token refresh/grant flows, live activity, watch sync, main init and home UI to use pickActiveToken. On the watch side, implement refreshAllWithRecovery in DataStore and replace direct refreshAll calls with refreshAllWithRecovery everywhere (ContentView, BackgroundRefreshManager, WatchConnectivityManager, HomeView). Rewrite the token recovery logic to retry (with delays), prefer fresher iCloud/file/keychain tokens, attempt iPhone retrieval, and better distinguish transient network errors from permanent token invalidation. Also update TokenManager to choose the freshest local token between keychain and file, and add small sync/NULL-safety fixes and delay tweaks in home_screen to improve iCloud recovery behavior. These changes aim to avoid unnecessary reauth prompts, handle intermittent network issues, and support multi-account setups by always using the active token.
2026-02-27 23:23:56 +01:00
Horváth Gergely
5403d1324d Handle iCloud token recovery and notify Flutter
Add end-to-end handling for tokens recovered from iCloud: TokenManager now detects fresh iCloud tokens and posts a "TokenRecoveredFromiCloud" Notification on iOS; WatchSessionManager observes that notification and invokes the Flutter method "onTokenRecoveredFromiCloud". On the Dart side, WatchSyncHelper handles the new callback and runs checkAndRecoverFromiCloud (clearing the reauth flag when appropriate). HomeScreen now attempts proactive iCloud recovery on iOS during startup when the token is expired/expiring or reauth is required, retrying with incremental delays and updating the client/token cache on success. Also minor log text tweak in main.dart and necessary imports added to home_screen.dart.
2026-02-27 23:23:56 +01:00
Horváth Gergely
a071cafacd Add auto-refresh and duplicate-call guard
Watch app: add Combine import, scenePhase tracking, a periodic timer and a 10-minute freshness threshold to auto-refresh data when the app becomes active or data becomes stale. Move refresh logic into onChange/onReceive handlers and add shouldAutoRefresh to avoid unnecessary refreshes; removed an immediate proactive token refresh in ContentView. DataStore.refreshAll now early-returns if a refresh is already in progress and logs the skip to prevent duplicate concurrent refreshes.
2026-02-27 23:23:56 +01:00
Horváth Gergely
dbf0d18e5c Handle percentage grades and token recovery
Add support for percentage-style grades and normalize them to standard grade scale across the watch app and shared models; show raw percentage in grade badge UI while keeping normalized coloring. Update WidgetGrade/KretaGrade to include valueType, add isPercentageGrade, percentageToGrade, normalizedNumericValue, displayTypeWithWeight and displayGradeValue helpers, and use normalized values in DataStore and views. Improve HomeView refresh button to reflect background loading, disable during datastore loading, and auto-transition success/failure states when background sync finishes. Enhance token recovery logic in Dart: KretaClient attempts watch/iCloud recovery twice (with a short delay) before forcing reauth, and token_grant tries to recover a fresher token from iCloud via WatchSyncHelper on 401 responses before throwing token errors.
2026-02-27 23:23:56 +01:00
Horváth Gergely
12e3fa5bff Add iCloud token sync & improve recovery
Add iCloud-based token recovery and saving across iOS/watch components. Introduces WatchSyncHelper.checkAndRecoverFromiCloud and saveTokenToiCloud to fetch/save fresher tokens via a method channel, calls the check on app init and before proactive refresh, and attempts to save refreshed tokens to iCloud. Adds native handlers in WatchSessionManager (checkiCloudToken, saveTokeToniCloud) and updates DataStore token recovery to distinguish network errors vs permanently invalid tokens (avoid unnecessary reauth). Update logging messages accordingly. Also update ubiquity-kvstore identifiers in entitlements to use explicit group.app.firka.firkaa and bump iOS build/version (CURRENT_PROJECT_VERSION and CFBundleVersion) to 1068.
2026-02-27 23:23:56 +01:00
Horváth Gergely
72cfa9b5eb Add splash assets and watch token recovery
Add Android and iOS launch/splash assets and flutter_native_splash config, and update launch_background.xml/styles for Android 12 support and dark mode.

Implement robust Apple Watch token recovery and refresh behavior: add recovery state and async recovery flow to DataStore (iCloud check, API refresh, request from iPhone), show a recovering UI in ContentView, attempt proactive recoveries on startup, and add WatchToken/iCloudTokenManager model support. WatchConnectivityManager now attempts to refresh expired tokens before replying to iPhone requests. BackgroundRefreshManager scheduling was improved to choose intervals based on timetable and user settings with debug logs. SettingsView defaults to Auto (0) and adds the Auto picker option and localization strings.

Also update entitlements across watch/widget extensions to include com.apple.developer.ubiquity-kvstore-identifier, rename watch app icon entry, and add project.pbxproj references for new source files.
2026-02-27 23:23:56 +01:00
Horváth Gergely
51831e94e4 Enhance reauthentication process with token recovery from Apple Watch 2026-02-27 23:23:56 +01:00
Horváth Gergely
aa8b3d5e16 Improve watch sync error handling and reauthentication logic 2026-02-27 23:23:56 +01:00
Horváth Gergely
b83cbef7fc Fix typo in import statement
Corrects a misspelled 'mport SwiftUI' to 'import SwiftUI' in LessonCard.swift, restoring the proper SwiftUI import and preventing compilation errors.
2026-02-27 23:23:56 +01:00
Horváth Gergely
35e1e2c6ab Add Apple Watch app and watch sync support
Add a new Firka Watch app target with UI components, views and services: DataStore, BackgroundRefreshManager, WatchConnectivity/WatchSession integration, localization (WatchL10n), entitlements and assets. Move widget/shared models into ios/Shared and update Xcode project/schemes; add native Kreta API client and TokenManager for watch use. Implement watch-side caching, proactive token refresh, background scheduling, and pairing/pairing UI. Update Flutter side (watch_sync_helper, main, API/token helper changes) and tweak iOS .gitignore and project metadata to enable the watch integration and data sync between phone and watch.
2026-02-27 23:23:56 +01:00
Horváth Gergely
874f5d4297 Add Shortcuts intents, entities & localizations
Introduce App Shortcuts and AppIntents support: add multiple shortcut intents (next/closest lesson, today/tomorrow/closest timetable, recent grades, subject/overall averages), AppShortcuts provider, and ShortcutError. Add AppEntity types (Average, Grade, Lesson, Subject) and corresponding entity queries. Refactor Controls to use AppIntent-based navigation (OpenHome/OpenGrades/OpenTimetable) with localized labels/descriptions and remove duplicate SubjectEntity from AveragesIntent. Update TimetableProvider to use a lock-screen-friendly timeline refresh policy. Add localization resources (AppShortcuts.strings and expanded Localizable.strings) for en/de/hu and register new strings in project files; update Info.plist/project.pbxproj accordingly.
2026-02-27 23:23:56 +01:00
Horváth Gergely
71ef509021 Show active break in timetable widget
Add break detection and UI for active breaks in timetable widgets. Introduces a new localization key "break_between" and a BreakIndicatorRow view that displays a break marker and minutes left. TimetableMediumView and TimetableLargeView now detect when the current time falls between consecutive lessons, reduce the number of visible lessons accordingly, and inject a BreakIndicatorRow between lessons when in a break (minutes are calculated using ceil of time interval). Also clean up commented/debug lines in the iOS widget cache helper (widget.dart) for locale/theme and removed a TODO comment.
2026-02-27 23:23:56 +01:00
Horváth Gergely
16b7d2f70a Add next-school-day support to iOS widgets
Add support for showing the next school day in widgets. Changes include: new localization keys (next_school_day_timetable, no_lessons_ahead) and a formatShortDate helper; updated Hungarian hours abbreviation. Widget model updated (TimetableData) to include nextSchoolDay and nextSchoolDayDate. TimetableProvider now sets isNextSchoolDay/nextSchoolDayDate and returns an entry when a future school day is found. Views (inline, lock screen, small/medium/large) updated to display the next school day header/date and show no_lessons_ahead where appropriate. Flutter helpers (widget cache/IOS helper) extended to serialize nextSchoolDayLessons/nextSchoolDayDate and to search up to a week ahead for the next school day when tomorrow is empty.
2026-02-27 23:23:56 +01:00
Horváth Gergely
402067d624 Add logging, await token callback and widget refresh
Fixes async token handling and improves observability: await the callback in KretaClient to ensure proper async flow, add informative logs for token expiry/refresh and warn on empty 200/201 API responses. Enhance token refresh flow in token_grant with detailed info/warning/severe logs and exception logging for easier debugging. Update widget DB helper to force fresh fetches for timetables/grades when updating widget cache, avoid writing empty caches and add debug prints for counts and cache status. Wire widget refresh into LiveActivityService background fetch (with import and try/catch logging) so iOS widgets get refreshed during background processing.
2026-02-27 23:23:56 +01:00
Horváth Gergely
f76b5fbcca Add iOS Control widgets & timetable UI updates
Introduce iOS 18 Control widgets and improve timetable/widget UI and behavior.

- Add Home, Grades and Timetable Control widgets (AppIntents) that write a "controlNavigation" value into the app group (group.app.firka.firkaa) so the main app can open the requested page.
- Register control widgets in HomeWidgetsBundle for iOS 18+.
- Extend WidgetLocalization with short/abbrev strings (tomorrow_short, hours_abbrev, in_hours) and related localization keys.
- Enhance Lock Screen and Timetable widgets to handle next-day lessons, show hours when >60 minutes, and use localized hour/minute strings.
- Update TimetableProvider timeline generation to avoid producing per-minute entries far before the next lesson; if the next lesson is >60 minutes away, add only a single entry ~60 minutes before it.
- Adjust various widget views (Averages, Grades, Timetable) for more compact layout: spacing, font weights/sizes, compact modes, and added average color logic.
- Update project.pbxproj to add a file-system-synchronized exception for the HomeWidgetsExtension files in the Runner target.
- AppDelegate: read and remove "controlNavigation" from the shared app group and return it via the Flutter method channel as a pending deep link; fall back to existing pendingWidgetDeepLink.
- Flutter: map a received 'home' deep link to HomePage.home in the home screen navigation switch.

These changes add Control Center / Lock Screen launch shortcuts and refine widget presentation and timeline performance.
2026-02-27 23:23:56 +01:00
Horváth Gergely
d395529282 Add lock-screen/inline widgets & timeline updates
Introduce Lock Screen and Inline variants for Timetable, Grades and Averages widgets and register them in HomeWidgetsBundle. Add new views and widget configurations (accessoryInline, accessoryCircular, accessoryRectangular) under LockScreen/, plus grade badge and average display UI. Extend Localization with many new keys in Helpers/Localization.swift and add lock-screen descriptions in en/de/hu Localizable.strings. Update TimetableProvider timeline logic to generate more frequent (per-minute) update entries for lock-screen families, deduplicate timeline dates and ensure proper midnight transition. Adjust TimetableViews display logic to prefer next lesson when current is absent and fix displayed label selection. Apply project.pbxproj updates to file-exception/group entries and some build phase metadata.
2026-02-27 23:23:56 +01:00
Horváth Gergely
1038b49092 iOS: rename LiveActivity widget & update configs
Rename TimetableWidget to LiveActivityWidget and clean up HomeWidgetsExtension targets/files. Update entitlements (group id and formatting) and remove duplicate HomeWidgetsExtensionExtension entitlements file. Update Runner.xcodeproj: bump objectVersion, rename targets/products/references, add WidgetExtension.xcconfig, switch entitlements/infoplist paths, set live-activity related flags, adjust deployment targets/locales and MARKETING_VERSION/CURRENT_PROJECT_VERSION to use Flutter variables. Change app display name to "Firka Testing" and move CFBundleVersion in Info.plist. Also change default widget style to .liquidGlass for Averages, Grades and Timetable intents and fix null-safety when serializing subject/grade category fields in ios_widget_helper.dart.
2026-02-27 23:23:56 +01:00
Horváth Gergely
d06a3dee69 Improve iOS widgets: UI, timeline and JSON fixes
Multiple widget improvements and bug fixes:

- Models: WidgetGrade now exposes subjectNameWithWeight and teacherName for display.
- AveragesProvider: added isFiltered flag, improved subject filtering logic and propagated flag to entries.
- Averages views: show filtered count badge, use configurable max visible items, and respect isFiltered.
- Grades views: display subject name with weight, show teacher in grade rows (renamed flag to showTeacher) and preserve topic display.
- TimetableProvider: build unique transition times for timeline updates, sort entries, and determine current lesson using the provided date instead of Date().
- Timetable views: compute visibleLessons window around the current lesson based on entry.date and use isLessonActive checks against entry.date.
- iOS widget JSON helper: fix subject.category serialization structure, use grade.creationDate for recordDate, and use grade.teacher for teacherName.

These changes fix incorrect JSON exports, improve timeline accuracy, and enhance widget UX when subjects are filtered or when showing teacher/weight info.
2026-02-27 23:23:56 +01:00
Horváth Gergely
d617efec80 Add deep link handling for widgets; implement navigation from widget links 2026-02-27 23:23:56 +01:00
Horváth Gergely
beb4127ef8 Add iOS Home Widgets Extension with timetable, grades, and averages
Introduces a new HomeWidgetsExtension for iOS, including widgets for timetable, recent grades, and subject averages. Adds widget models, providers, intents, localization, and SwiftUI views. Updates project files and main app to support widget data sharing and communication. Also includes new Dart helper for widget data and updates to relevant Flutter screens.
2026-02-27 23:23:56 +01:00
Horváth Gergely
1f57281004 Add tokenExpired property and update warning display logic in live activity 2026-02-27 23:23:56 +01:00
Horváth Gergely
f866052905 Add user-specific bell delay settings; implement retrieval and storage in SharedPreferences 2026-02-27 23:23:56 +01:00
Horváth Gergely
deb013a30e Add morning notification settings; implement user-specific preferences for time and enabled state 2026-02-27 23:23:56 +01:00
Horváth Gergely
8a3f77d565 Implement token expiration handling and reauthentication UI; add reauth toast and update seasonal icon logic 2026-02-27 23:23:56 +01:00
Horváth Gergely
1ea46ede0a Refactor logging in live activity manager and backend client; streamline lesson data handling and improve break event detection logic 2026-02-27 23:23:56 +01:00
Horváth Gergely
79f59b6938 Refactor lesson filtering and add logic to handle break events in live activity manager 2026-02-27 23:23:56 +01:00
Horváth Gergely
e2b98125fc Enhance time formatting by adding language detection for compact time and seasonal break methods 2026-02-27 23:23:56 +01:00
Horváth Gergely
8c877e43db Add time formatting helper and update seasonal display logic 2026-02-27 23:23:56 +01:00
Horváth Gergely
02acf0e59b Add morning notification settings and debounce handling for Live Activities 2026-02-27 23:23:56 +01:00
Horváth Gergely
04870205f9 Refactor date calculations for start of the week in live activity service 2026-02-27 23:23:56 +01:00
Horváth Gergely
bcc95ed0af Reduce bellDelay debounce interval from 5 seconds to 3 seconds;
Enhance lesson fetching logic for improved notification scheduling
2026-02-27 23:23:56 +01:00
88fd491281 Update project settings and entitlements for improved configuration
- Bump object version in project.pbxproj
- Refactor TimetableWidget folder exceptions in project.pbxproj
- Add BGTaskSchedulerPermittedIdentifiers to Info.plist
- Update development team and product bundle identifiers in entitlements
- Mark subproject as dirty in l10n
2026-02-27 23:23:56 +01:00
Horváth Gergely
9a435235b6 - Fixed UI/UX bugs in the Live Activities
- Fixed the unhandled language get, when the Live Activity is turned off
- Fixed bellDelay bugs
2026-02-27 23:23:56 +01:00
Horváth Gergely
e583c77a7e - Added bellDelay support for Live Activities; both standard push notifications and Live Activities now use the bellDelay value (default: 0). IMPORTANT: Holidays and school break(spring,summer,autumn,winter) activities do not apply bellDelay.
- Implemented background fetch on iOS: the app now refreshes every 30 minutes in the background and sends timetable changes to the backend if any are detected.
2026-02-27 23:23:56 +01:00
Horváth Gergely
8dbcc1e2a9 - Fixed user switching so previous user data is now properly cleared.
- Fixed re-login behavior: after every new login, the Live Activities privacy notice is shown as intended.
- Made the Live Activity toggle user-specific to prevent settings from carrying over after switching accounts.
- Fixed user logout so the backend now correctly removes all related data.
- Fixed first-install behavior so the Live Activities privacy notice no longer appears on the public beta screen; it now only appears after reaching the home page.
2026-02-27 23:23:56 +01:00
Horváth Gergely
f631d52d5a - Fixed lesson language data; backend now passes the correct values.
- Updated handling of cancelled lessons: removed timer and now displaying the localized “Cancelled” text.
- Aligned the icon and lesson number in the Dynamic Island so they are now level with the label text.
2026-02-27 23:23:56 +01:00
Horváth Gergely
768d0904a8 Add data privacy consent dialog for Live Activity
A new data privacy consent dialog has been added to the Live Activity feature. Users must accept this dialog to use Live Activity. If they decline, all their data will be immediately deleted from the database, and cannot use the Live Activities feature. Additionally, users receive a detailed description explaining what data we store, for how long, and their GDPR rights.
2026-02-27 23:23:56 +01:00
Horváth Gergely
c21ff3e15f Added an example of the .env file. 2026-02-27 23:23:56 +01:00
0e08919209 feat: add logging for device registration and timetable updates 2025-11-19 15:58:53 +01:00
e651552dec fix: enable iOS platform and update build settings for arm64 architecture 2025-11-19 15:49:28 +01:00
8f683561b9 fix: update version number to 1.0.9+1030 2025-11-19 15:46:25 +01:00
519c9a4043 fix: update development team and bundle identifiers 2025-11-19 13:41:11 +01:00
Horváth Gergely
887d765f65 Live activity support added!
I have merged the latest repo myself and decided to publish my version to the repo.
2025-11-19 01:57:24 +01:00
Pearoo
34cf77f216 feat: add error page 2025-11-07 15:25:48 +01:00
7b382563ba Jenkinsfile: fdroid -> artifacts 2025-10-26 09:14:10 +01:00
667a8e0e4d refactor: use streams for fetching data 2025-10-26 09:08:05 +01:00
147dff3696 fix: payload cast 2025-10-12 16:53:56 +02:00
0fd36de4a3 Increment base build number
Since we rebased the commit count is smaller
2025-10-12 15:50:53 +02:00
d4fe91860a cast jwt payload to Map<String, dynamic> 2025-10-12 13:57:20 +02:00
45d0b298c4 settings/licenses: fix text & spinner style 2025-10-11 20:14:13 +02:00
c812b0721f update l10n module 2025-10-11 20:07:18 +02:00
b62140c0d0 Fordítás hozzáadása 2025-10-09 22:21:28 +02:00
f55cc65f07 License menü 2025-10-09 20:57:55 +02:00
3690cf0462 Fordítás, License menü 2025-10-09 20:57:23 +02:00
233f0c9ed0 Órarend kinézet javítás 2025-10-09 20:56:59 +02:00
6912e44b7e Órarenden igazítás 2025-10-08 20:50:13 +02:00
369febba91 Discord, PP átirányítás 2025-10-08 20:50:01 +02:00
2ca5e8c54b Helyettesítések elrejtése, Discord + PP átirányítás 2025-10-08 20:49:35 +02:00
dd515955ba Helyettesítések elrejtése 2025-10-08 20:48:31 +02:00
97d1f005b4 Amennyiben nem írt dolgozatot/szöveges értékelés stb, nem 0-val jelzi, hanem szöveges értékelést mutatja. 2025-10-07 22:06:37 +02:00
92e94f60c5 Időformátum szebbítése 2025-10-07 22:05:46 +02:00
ba53f30cce kicsi hiba fix 2025-10-07 20:48:03 +02:00
a34c8e23d3 Funkció hozzáadása: Dolgozat popup 2025-10-07 20:39:22 +02:00
ab1208999d Amennyiben nincs jegy 1 tantárgyból, jelzi dave svg-vel 2025-10-06 21:03:58 +02:00
2b51523eb1 Tantárgy név átvitele 2025-10-06 21:03:29 +02:00
9f3190495b Felesleges import törlése 2025-10-06 21:03:12 +02:00
14fdf00259 Felesleges import törlése + tantárgy név átvitel 2025-10-06 21:02:37 +02:00
815604d144 tt: localize "Tantárgy megtekintése" btn 2025-10-06 16:57:54 +02:00
8f499aac21 tt: implement view subject button 2025-10-06 16:56:08 +02:00
f24f340d63 + Tantárgy megtekintése gomb 2025-10-06 12:38:52 +02:00
ccf7443f26 Számonkérés megjelenítése az adott óra felugró ablakánál 2025-10-06 12:37:57 +02:00
2f0c6ca9df Üres napnál amennyiben pld tanítás nélküli munkanap, akkor jelzi a felhasználónak 2025-10-06 12:37:52 +02:00
ff73bafb0d #75 Feleslegesen nagy üres rész Jegyeknél fix 2025-10-06 12:37:40 +02:00
978df96aaf #78 Dolgozatnál hibás tördelés fix 2025-10-06 12:37:31 +02:00
07b8714c7e Amennyiben a felhasználónak nincsenek órái, azt a dizájn szerinti módon jelzi 2025-10-06 12:37:13 +02:00
8881f8c674 #77 Óra témája hibás tördelése fix 2025-10-06 12:37:06 +02:00
569147ae8a Tantárgyak feldolgozása 2025-09-29 21:44:15 +02:00
947e1d12cf Amennyiben nincs jegy a tantárgyból, ismeretlen a tanár is, tehát azt a szöveget kicseréltem 2025-09-29 21:43:59 +02:00
fd750ae6ad studyTask hozzáadása, SubjectAverage bővítése 2025-09-29 21:43:35 +02:00
f31b719605 SubjectAverage átírása, getLessons törlése 2025-09-29 21:43:05 +02:00
0bcdf35060 AllLessons törlése: nincs rá szükség 2025-09-29 21:43:17 +02:00
a0c1f3bb1f DKT API törlése, getSubjectAvg módosítása 2025-09-29 21:40:16 +02:00
6e35ca9d72 home/main: add homework entries 2025-09-30 09:54:51 +02:00
3b6e5d8213 add privacy policy button 2025-09-29 21:39:36 +02:00
894d897778 home,grades,tt: capitalize titles
some school administrators enter everything as lower case
2025-09-29 18:28:55 +02:00
a96be41d01 settings: add logout button 2025-09-29 12:47:15 +02:00
24876aebd6 lesson/sheet: add room name 2025-09-29 12:15:00 +02:00
e4aea80f0b android/gradle: Use /usr/bin/ as ANDROID_SDK_ROOT fallback 2025-09-27 20:56:10 +02:00
56cbaa6d16 message toast -> screen
the design has a screen for messages not a toast
2025-09-25 22:08:27 +02:00
850800864d adjust fonts 2025-09-25 21:47:23 +02:00
a92ea1dcf6 home/tt: Fix date formatting on the title bar 2025-09-25 21:33:20 +02:00
a9829b2163 model: translate field names to English 2025-09-25 21:30:52 +02:00
4f1c903384 Összes tantárgy megjelenítése 2025-09-25 15:57:47 +02:00
b045980bb4 lesson: fix popup height 2025-09-17 13:40:05 +02:00
352f9f223b fix: use proper font size 2025-09-17 13:32:46 +02:00
3d41113c0f fix(style): adjust font height 2025-09-17 13:32:24 +02:00
e616893ad2 debug: update throw exception
use a nested isar txn, which can trigger the error popup
2025-09-16 21:29:32 +02:00
8d934dd0f8 grade bottom sheet: fix size and padding 2025-09-16 21:25:59 +02:00
3e31804fe5 lesson: don't check the week if its empty 2025-09-16 21:23:56 +02:00
5f74a99f5a refactor: setting -> settings 2025-09-16 17:28:43 +02:00
6e16b9a37c tt: add haptic feedback to swiping between pages 2025-09-16 13:07:41 +02:00
ebcf49d957 home: fix styling in active lesson 2025-09-16 09:50:39 +02:00
aec2453a05 tt: fix last lesson getting covered by T H E S H A D O W 2025-09-16 09:40:11 +02:00
6c64ac4a35 added pfp for homescreen 2025-09-15 23:26:32 +02:00
ae06a61b05 fixes #59 2025-09-15 22:23:03 +02:00
d5c81d443e add haptic feedback 2025-09-15 21:36:52 +02:00
8b1b5cc4cf Update submodule 2025-09-15 19:09:15 +02:00
3d09187d6f home: remove logging 2025-09-15 19:02:14 +02:00
722068fdde Főoldalhoz hátramaradt tanórák száma fix 2025-09-15 18:51:22 +02:00
c471768598 Tanulo > Tanuló 2025-09-15 18:50:36 +02:00
2009418887 + jel kivétele: Nincs használva 2025-09-15 18:50:22 +02:00
94d3802e95 Több információ a beírt jegyeknél 2025-09-15 18:50:01 +02:00
4fe8af2e66 fix: use a 30 bit hash if the username is non-numeric 2025-09-15 15:09:29 +02:00
57122a4c3f Jenkins: update version code for aab 2025-09-15 12:43:18 +02:00
e5fac2609f Jenkins: move bundle compression to build_apk.sh 2025-09-15 12:25:49 +02:00
dd4ccf2736 wearos: fix pairing 2025-09-15 12:21:40 +02:00
Pearoo
1356fd3eb3 fix(timetable): clamp carousel to bottom
only tested on Pixel 9 Pro yet
2025-09-14 13:54:22 +02:00
Pearoo
fde6a47adc fix(timetable): no more unexplainable padding 2025-09-13 22:55:55 +02:00
Pearoo
c1edbe0971 feat(timetable): cache next & previous weeks 2025-09-13 20:14:04 +02:00
Pearoo
f04517749b chore: update cache retention 2025-09-13 20:13:09 +02:00
Pearoo
c36d656178 fix: next week resets to monday 2025-09-13 19:16:33 +02:00
8c4735ccb3 tt: fix event text color 2025-09-13 17:54:32 +02:00
a665478930 kreta_client: more verbose logging 2025-09-13 17:04:27 +02:00
033ab39c59 home_subpage: handle back events 2025-09-13 16:39:31 +02:00
6bf6b46119 move scaffold from grades & tt pages to subpage
fixes random white stuttering in the background
2025-09-13 14:14:27 +02:00
2e425dd757 tt: show breaks after last lesson is over 2025-09-13 14:07:25 +02:00
942ecc9db2 home/tt: truncate long lesson names and room names
closes #53
2025-09-13 13:59:33 +02:00
b4d87978e2 settings & home: use firka app bundle
fixes #61
2025-09-13 13:36:08 +02:00
e84ea8c383 home: only call setState on update if screen is mounted 2025-09-13 13:06:18 +02:00
5354c601eb settings: move postUpdate hook outside save function
fixes #62
2025-09-13 13:05:50 +02:00
9533fdaeec settings: add log file sharing 2025-09-13 12:05:04 +02:00
c79934f946 some apple things idk 2025-09-13 00:14:08 +02:00
d21b8955a7 removed support for ipad, macos, vision os 2025-09-12 23:15:26 +02:00
c95128a48e logging: censor debugPrint in release mode 2025-09-13 11:38:10 +02:00
308ff7f14c logging: delete old log files 2025-09-13 11:37:37 +02:00
69eae36ef8 logging: log to file 2025-09-13 11:32:39 +02:00
788f808d4e logger: censor sensitive information 2025-09-13 11:01:05 +02:00
c16c899e66 login: more verbose logging 2025-09-13 10:01:25 +02:00
6e2eeea8f0 use proper logging 2025-09-12 22:44:02 +02:00
191ee62be9 login: fix comparison 2025-09-12 18:44:28 +02:00
b51169ab3c token: add support for guardians 2025-09-12 18:12:54 +02:00
1902ace989 login: add a fallback error handler 2025-09-12 17:09:20 +02:00
d3e30689f0 firka_card: fix dark mode shadow
closes #39
2025-09-11 21:33:05 +02:00
c1aae7adb1 home: add bottom sheet for announcements 2025-09-11 19:34:01 +02:00
ee72056074 grade & home: add bottom sheet 2025-09-11 18:19:57 +02:00
4bd585d1dc grade: convert dates to local ones 2025-09-11 17:59:30 +02:00
4806ac073a refactor: extract showLessonBottomSheet out to a file 2025-09-11 17:25:12 +02:00
ac9a5cda91 home: add grades 2025-09-11 15:01:53 +02:00
60e0a1755b grades/{subjects}: fix text colors 2025-09-11 14:54:48 +02:00
9039356cfd fix color for light buttons in dark mode
closes #57
2025-09-11 14:16:59 +02:00
4327cae06a remove wear_login_screen.dart 2025-09-11 13:56:22 +02:00
c22d175afb home: check for mounting before preloading assets 2025-09-11 13:55:01 +02:00
6650b8aaef login: automatically switch to new account 2025-09-11 13:53:58 +02:00
e18f31a8b4 login: remove login hint from add account screen 2025-09-11 12:49:23 +02:00
caeca5e050 feat: account switching 2025-09-11 12:47:43 +02:00
e44684049f home: fix random bouncing
- switch pull_to_refresh_flutter3 from to smart_scroll
- decrease spring stiffness to 95

closes #47
2025-09-10 21:10:45 +02:00
359129c0dd tt: add animations to switching between pages
closes #45
2025-09-10 20:26:29 +02:00
e53df719c7 settings: add back button for rounding options 2025-09-10 10:38:10 +02:00
53c5ad4f14 tt: only show next break on current day
closes #50
2025-09-10 10:28:45 +02:00
dd59381b35 tt: increase padding when there is a test 2025-09-10 09:41:13 +02:00
5811ece08e tt: show tests on lessons when tests are hidden
closes #51
2025-09-10 07:48:57 +02:00
0701424b3c tt: show tests on day picker 2025-09-10 07:44:39 +02:00
93d3125013 settings: add padding to customization screen
closes #48
2025-09-09 16:47:38 +02:00
e96979d36f settings: add back button to developer options 2025-09-09 13:35:32 +02:00
9a17d9085c main: invalidate ui on platform brightness change 2025-09-09 13:27:42 +02:00
6c3ac6c09b settings: invalidate ui on theme & lang change 2025-09-09 13:26:16 +02:00
d1c34bd607 State -> FirkaState
Add a helper called FirkaState which registers
a listener to globalUpdate, so that we can
invalidate every widget that is active
2025-09-09 13:13:55 +02:00
869ba964ee date: use proper locale 2025-09-09 11:53:07 +02:00
4d45de372b login: add dark themed images 2025-09-09 11:33:36 +02:00
18adc04801 kreta_login: revert ua on iOS 2025-09-09 08:00:11 +02:00
c71dd3e680 revert: Change webview UA to Google Chrome on Android 2025-09-09 07:56:42 +02:00
e978459c19 kréta login update 2025-09-08 21:00:58 +02:00
5f7106d257 tt: fix lesson no for empty classes 2025-09-09 07:47:27 +02:00
1f2b8091f1 timetable: Fix lesson number icon
closes #49
2025-09-08 20:30:38 +02:00
932a89193e docs: Update CONTRIBUTING.md 2025-09-08 20:50:41 +02:00
048832589c Jenkinsfile: Bring back debug artifacts 2025-09-07 16:44:46 +02:00
f55ec7c525 tt: switch to monday if the week isn't the current one
closes #44
2025-09-07 16:43:37 +02:00
d3fce38235 tt: switch to monday if the week isn't the current one
closes #44
2025-09-07 16:30:28 +02:00
9183769ff4 tt: jump to current day
closes #42
2025-09-07 12:03:40 +02:00
4f4960280a tt: make padding more consistent 2025-09-07 11:26:05 +02:00
c85a428a7b fix: change "Hide breaks & empty lessons" to "Hide breaks"
closes #52
2025-09-07 11:22:22 +02:00
1738a38b4f home/grades/{subject}: fix text color 2025-09-07 11:17:49 +02:00
ddd7c5a9d6 tmp: remove lidl app icon
closes #46
2025-09-06 21:20:17 +02:00
a141f1822c fix SettingsItemsRadio
closes #41
2025-09-06 19:00:03 +02:00
41fab74f11 fix typo
closes #40
2025-09-06 18:47:58 +02:00
df1c5d9acf Jenkinsfile: build aab on release branch 2025-09-06 16:59:38 +02:00
a4b691f8be bump version string 2025-09-06 16:59:27 +02:00
ac82436751 settings: use runApp in lang settings as well 2025-09-06 10:46:44 +02:00
868d6f3665 fix: nav color when switching theme 2025-09-06 10:45:23 +02:00
bd965caa4c bottom_tt_icon.dart: add shadow to active icon 2025-09-06 10:28:48 +02:00
145eca557e android: build each abi in parallel 2025-09-06 08:54:55 +02:00
25e3ea95ba fix: reinit theme on platform brightness change 2025-09-06 08:47:35 +02:00
b6683158d9 bump version to 1.0.0+1017 2025-09-06 01:01:37 +02:00
3efc019322 update project configuration and framework references in Xcode project file 2025-09-04 21:42:00 +02:00
a980e4eff2 lesson: fix bottom sheet in dark mode 2025-09-06 08:24:23 +02:00
324d21ec07 tt: fix empty week in dark mode 2025-09-06 08:21:44 +02:00
1224d4801d fix: navbar theme on auto 2025-09-06 08:11:58 +02:00
51b8753875 extras: respect theming 2025-09-05 21:46:26 +02:00
b31e90b052 tt*: respect theming 2025-09-05 21:44:25 +02:00
2d5cc896b8 bottom_nav_icon.dart: respect theming 2025-09-05 21:41:10 +02:00
975c9c5a08 fix: native status bar theming 2025-09-05 21:38:10 +02:00
57d6c503f2 login: remove hardcoded colors 2025-09-05 21:28:07 +02:00
e3b71dbd4d dark mode toggle 2025-09-05 20:58:30 +02:00
565 changed files with 48853 additions and 22484 deletions

4
.gitignore vendored
View File

@@ -100,8 +100,12 @@ firka/debug-info/
**/.env*
**/*.dart.js
**/*.info.json
**/*.g.dart
**/.codegen-cache.yaml
# tools.py logs
tool_logs/build/*.log
tool_logs/d8dx_fix/*.log
tool_logs/pub_fix/*.log
secrets/upload_certificate.pem
secrets (2)/upload_certificate.pem

18
.gitmodules vendored
View File

@@ -1,18 +0,0 @@
[submodule "firka/vendor/isar_generator"]
path = firka/vendor/isar_generator
url = https://git.qwit.cloud/firka/isar_generator
[submodule "firka/vendor/isar"]
path = firka/vendor/isar
url = https://git.qwit.cloud/firka/isar
[submodule "firka/vendor/isar_flutter_libs"]
path = firka/vendor/isar_flutter_libs
url = https://git.qwit.cloud/firka/isar_flutter_libs
[submodule "firka/lib/l10n"]
path = firka/lib/l10n
url = https://github.com/QwIT-Development/firka-localization
[submodule "firka_wear/vendor/wear_plus"]
path = firka_wear/vendor/wear_plus
url = https://git.firka.app/firka/wear_plus
[submodule "firka/android/app/src/main/java/org/brotli"]
path = firka/android/app/src/main/java/org/brotli
url = https://git.firka.app/firka/org_brotli

232
.woodpecker.yml Normal file
View File

@@ -0,0 +1,232 @@
when:
- event: [push, pull_request]
- event: manual
steps:
- name: submodules
image: git.firka.app/firka/firka-builder:latest
commands:
- git submodule update --init --recursive
- name: secrets
image: git.firka.app/firka/firka-builder:latest
environment:
UPLOAD_KEYSTORE_B64:
from_secret: upload_keystore_b64
KEYSTORE_PROPERTIES_B64:
from_secret: keystore_properties_b64
commands:
- echo "$UPLOAD_KEYSTORE_B64" | base64 -d > secrets/upload-keystore.jks
- echo "$KEYSTORE_PROPERTIES_B64" | base64 -d > secrets/keystore.properties
# Each step runs in a fresh container from the builder image -- only the
# workspace volume is shared between them. Pointing PUB_CACHE at a
# workspace-local dir (instead of the image's default /root/.pub-cache)
# is what lets `flutter pub get`'s downloads survive into later steps.
- name: dependencies
image: git.firka.app/firka/firka-builder:latest
commands:
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
- cd firka
- '[ -f .env ] || cp .env.example .env 2>/dev/null || touch .env'
- flutter pub get
- name: codegen
image: git.firka.app/firka/firka-builder:latest
commands:
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
- cd firka
- dart run scripts/codegen.dart
- name: clone-mock-kreta-server
image: git.firka.app/firka/firka-builder:latest
environment:
GITEA_USERNAME:
from_secret: gitea_username
GITEA_TOKEN:
from_secret: gitea_token
commands:
- pwd
# The heredoc uses a quoted delimiter so $GITEA_USERNAME/$GITEA_TOKEN
# are written to the script literally, not expanded here -- keeps the
# secret values out of this (traced) command's expanded output.
- |
cat > /tmp/write_netrc.sh <<'NETRC_SCRIPT'
printf 'machine git.firka.app\nlogin %s\npassword %s\n' "$GITEA_USERNAME" "$GITEA_TOKEN" > "$HOME/.netrc"
chmod 600 "$HOME/.netrc"
NETRC_SCRIPT
# Runs as an untraced child shell, so the expansion above never hits the log.
- sh /tmp/write_netrc.sh
- git clone --depth 1 https://git.firka.app/firka/mock_kreta_server.git mock_kreta_server
- rm -f /tmp/write_netrc.sh "$HOME/.netrc"
- name: build-mock-kreta-server
image: golang:1.26
commands:
- cd mock_kreta_server
- go build -o ../mock_kreta_server_bin .
# Runs the mock server in the background and exercises kreta_api's DTOs
# against its real wire format, catching drift between the two repos.
- name: kreta-api-mock-server-tests
image: git.firka.app/firka/firka-builder:latest
commands:
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
- ./mock_kreta_server_bin -addr :8090 -data mock_kreta_server/data.json &
- sleep 1
- cd kreta_api
- dart pub get
- MOCK_KRETA_SERVER_URL=http://127.0.0.1:8090 dart test
- name: firka-e2e-tests
image: git.firka.app/firka/firka-builder:latest
commands:
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
- ./mock_kreta_server_bin -addr :8090 -data mock_kreta_server/data.json &
- sleep 1
- cd firka
- '[ -f .env ] || cp .env.example .env 2>/dev/null || touch .env'
- cp $(find "$PUB_CACHE" -name libisar.so | grep linux | head -n 1) libisar.so 2>/dev/null || true
- flutter test test/data/widget_test.dart test/e2e/screenshot_widget_test.dart test/e2e/notification_diff_test.dart
- name: firka-integration-tests
image: git.firka.app/firka/firka-builder:latest
privileged: true
volumes:
- /dev/kvm:/dev/kvm
commands:
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
- 'grep -q "::1" /etc/hosts || echo "::1 localhost ip6-localhost ip6-loopback" >> /etc/hosts 2>/dev/null || true'
- sysctl -w net.ipv6.conf.all.disable_ipv6=0 2>/dev/null || true
- sed -i 's/TIMEOUT=60/TIMEOUT=300/' /opt/bin/start-emulator.sh
- sed -i 's/-snapshot default_boot/-no-snapshot-load/' /opt/bin/start-emulator.sh
- ./mock_kreta_server_bin -addr :8090 -data mock_kreta_server/data.json &
- sleep 1
- /opt/bin/start-emulator.sh
- adb reverse tcp:8090 tcp:8090
- cd firka
- '[ -f .env ] || cp .env.example .env 2>/dev/null || touch .env'
- flutter test integration_test/widget_e2e_test.dart
- name: build-release
image: git.firka.app/firka/firka-builder:latest
when:
- branch: [main, staging]
commands:
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
- cd firka
- '[ -f "$(git rev-parse --git-dir)/shallow" ] && git fetch --unshallow 2>/dev/null || true'
- SHA=$(git rev-parse --short HEAD)
- COMMIT_COUNT=$(git rev-list --count HEAD)
- 'BASE_VERSION=$(grep "^version:" pubspec.yaml | cut -d: -f2 | cut -d+ -f1 | tr -d " ")'
- BUILD_NAME="$BASE_VERSION-$SHA"
- VERSION_CODE=$((2000 + COMMIT_COUNT))
- flutter build appbundle --release --build-name="$BUILD_NAME" --build-number="$VERSION_CODE"
# universal apk for the website's download button, the .aab is for stores
- flutter build apk --release --build-name="$BUILD_NAME" --build-number="$VERSION_CODE"
- name: build-debug
image: git.firka.app/firka/firka-builder:latest
when:
- branch:
exclude: [main, staging]
commands:
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
- cd firka
- '[ -f "$(git rev-parse --git-dir)/shallow" ] && git fetch --unshallow 2>/dev/null || true'
- SHA=$(git rev-parse --short HEAD)
- COMMIT_COUNT=$(git rev-list --count HEAD)
- 'BASE_VERSION=$(grep "^version:" pubspec.yaml | cut -d: -f2 | cut -d+ -f1 | tr -d " ")'
- BUILD_NAME="$BASE_VERSION-$SHA"
- VERSION_CODE=$((2000 + COMMIT_COUNT))
- flutter build apk --debug --split-per-abi --build-name="$BUILD_NAME" --build-number="$VERSION_CODE"
- name: publish-release
image: woodpeckercommunity/plugin-gitea-package:latest
pull: true
when:
- branch: [main, staging]
settings:
user:
from_secret: gitea_username
password:
from_secret: gitea_token
owner: firka
package_name: firka
package_version: ${CI_COMMIT_SHA}
file_source: ./firka/build/app/outputs/bundle/release/app-release.aab
file_name: app-release.aab
update: 'true'
- name: publish-release-apk
image: woodpeckercommunity/plugin-gitea-package:latest
pull: true
when:
- branch: [main, staging]
settings:
user:
from_secret: gitea_username
password:
from_secret: gitea_token
owner: firka
package_name: firka
package_version: ${CI_COMMIT_SHA}
file_source: ./firka/build/app/outputs/flutter-apk/app-release.apk
file_name: app-release.apk
update: 'true'
- name: publish-debug-arm64-v8a
image: woodpeckercommunity/plugin-gitea-package:latest
pull: true
when:
- branch:
exclude: [main, staging]
settings:
user:
from_secret: gitea_username
password:
from_secret: gitea_token
owner: firka
package_name: firka
package_version: ${CI_COMMIT_SHA}
file_source: ./firka/build/app/outputs/flutter-apk/app-arm64-v8a-debug.apk
file_name: app-arm64-v8a-debug.apk
update: 'true'
- name: publish-debug-armeabi-v7a
image: woodpeckercommunity/plugin-gitea-package:latest
pull: true
when:
- branch:
exclude: [main, staging]
settings:
user:
from_secret: gitea_username
password:
from_secret: gitea_token
owner: firka
package_name: firka
package_version: ${CI_COMMIT_SHA}
file_source: ./firka/build/app/outputs/flutter-apk/app-armeabi-v7a-debug.apk
file_name: app-armeabi-v7a-debug.apk
update: 'true'
- name: publish-debug-x86_64
image: woodpeckercommunity/plugin-gitea-package:latest
pull: true
when:
- branch:
exclude: [main, staging]
settings:
user:
from_secret: gitea_username
password:
from_secret: gitea_token
owner: firka
package_name: firka
package_version: ${CI_COMMIT_SHA}
file_source: ./firka/build/app/outputs/flutter-apk/app-x86_64-debug.apk
file_name: app-x86_64-debug.apk
update: 'true'

10
CLAUDE.md Normal file
View File

@@ -0,0 +1,10 @@
# Firka
Before you change code, write a comment or make a commit in this repo, get the Firka style guide and follow it. It is in a separate repo so it stays the same across all Firka projects.
```bash
[ -d ../style-guide ] && git -C ../style-guide pull --ff-only \
|| git clone https://git.firka.app/firka/style-guide.git ../style-guide
```
Then read `../style-guide/CLAUDE.md` and do what it says. It lists the skills to install and which style skill belongs to this repo.

View File

@@ -1,35 +1,19 @@
# Flutter telepítése
A firka androidra való lebuildeléséhez kötelező a saját Flutter fork használata, illetve minden más fajta --release buildhez is.
A Flutter telepítéséhez a dokumentáció [itt](https://docs.flutter.dev/get-started/install) található.
A Flutter zip letöltése helyett [a custom engine zip-et töltsd le](https://git.firka.app/firka/flutter/archive/main.zip)
# Brotli
A firka brotlival compresseli a libflutter-t buildelés közben ezért szükséges a projekt
buildeléséhez hogy a brotli a PATH-ben legyen
## Windows
- Töltsd le a `brotli-x64-windows-static.zip`-et a [google/brotli github repoból](https://github.com/google/brotli/releases/latest)
- Csomagold ki valahol (pl. C:\Users\\<username>\dev\brotli)
- Add hozzá a mappát ahova kicsomagoltad (C:\Users\\<username>\dev\brotli) a PATH-hez
- Ne felejtsd el újraindítani az IDE-det illetve parancssorodat utánna hogy frissüljön a PATH
## Linux/MacOS
Telepítsd fel a brotli packaget a distro-d package managerével
A projekt jelenleg a 3.41.2-es Flutter SDK-t használja.
# Keystore
[Secrets dokumentáció](secrets/README.md)
# Flutter l10n
# Fileok generálása
Flutter l10n fileok generálása
Flutter l10n és egyéb fileok generálása
```shell
Flutter gen-l10n --template-arb-file app_hu.arb
$ cd firka # vagy firka_wear
$ dart run scripts/codegen.dart
```
# Android debug build
@@ -42,20 +26,10 @@ $ Flutter build apk --debug --target-platform android-arm,android-arm64,android-
# Android release build
A release buildhez közelező egy keystore használata, illetve a saját Flutter engineünk használata.
A release buildhez közelező egy keystore használata.
## Custom Flutter engine setupolása
## Release appbundle buildelése (firka és firka_wear)
```shell
$ git clone https://git.firka.app/firka/flutter
$ cd flutter
$ . dev/tools/envsetup.sh
$ gclient sync -D
$ ./dev/tools/build_release.sh
```
## Release apk buildelése
```shell
$ ./tools/linux/build_apk.sh main
$ ./build.sh
```

35
CONTRIBUTING_de.md Normal file
View File

@@ -0,0 +1,35 @@
# Flutter installieren
Die Dokumentation zur Installation von Flutter findest du [hier](https://docs.flutter.dev/get-started/install).
Das Projekt verwendet derzeit das Flutter SDK 3.41.2.
# Keystore
[Dokumentation zu Secrets](secrets/README.md)
# Dateien generieren
Flutter-L10N-Dateien und andere Dateien generieren
```shell
$ cd firka # oder firka_wear
$ dart run scripts/codegen.dart
```
# Android-Debug-Build
Für den Dev-Build ist kein Keystore erforderlich
```shell
$ cd firka
$ flutter build apk --debug --target-platform android-arm,android-arm64,android-x64
```
# Android-Release-Build
Der Release-Build erfordert die Verwendung eines Keystores.
## Erstellen des Release-Appbundles (firka und firka_wear)
```shell
$ ./build.sh
```

View File

@@ -1,41 +1,24 @@
# Installing flutter
# Installing Flutter
To build firka you will have to use our custom Flutter fork,
and to make a release build you will have to use our custom
flutter engine.
The documentation for installing flutter can be found [here](https://docs.flutter.dev/get-started/install).
Instead of downloading the regular flutter zip, download it from [here](https://git.firka.app/firka/flutter/archive/main.zip).
# Brotli
Firka uses brotli to compress libflutter during the build process to make the app smaller,
so building Firka requires you to have brotli in your path
## Windows
- Download `brotli-x64-windows-static.zip` from [google/brotli](https://github.com/google/brotli/releases/latest)
- Extract it to somewhere like C:\Users\\<username>\dev\brotli
- Add the directory (ex. C:\Users\\<username>\dev\brotli) to your PATH
- Don't forget to restart your IDE or terminal sessions for the PATH variable to update
## Linux/MacOS
Install it using your distro's package manager
Flutter installation documentation can be found [here](https://docs.flutter.dev/get-started/install).
The project currently uses Flutter SDK 3.41.2.
# Keystore
[Secrets docs](secrets/README_en.md)
[Secrets documentation](secrets/README.md)
# Flutter l10n
# Generating files
Generating flutter l10n files
Generating Flutter l10n and other files
```shell
flutter gen-l10n --template-arb-file app_hu.arb
$ cd firka # or firka_wear
$ dart run scripts/codegen.dart
```
# Android debug build
The dev build doesn't require using a custom keystore
The dev build does not require using a keystore
```shell
$ cd firka
$ flutter build apk --debug --target-platform android-arm,android-arm64,android-x64
@@ -43,20 +26,10 @@ $ flutter build apk --debug --target-platform android-arm,android-arm64,android-
# Android release build
The release build requires using a custom keystore and our custom flutter fork
The release build requires using a keystore.
## Setting up our flutter engine fork
## Building the release appbundle (firka and firka_wear)
```shell
$ git clone https://git.firka.app/firka/flutter
$ cd flutter
$ . dev/tools/envsetup.sh
$ gclient sync -D
$ ./dev/tools/build_release.sh
$ ./build.sh
```
## Building the release apk
```shell
$ ./tools/linux/build_apk.sh main
```

219
Jenkinsfile vendored
View File

@@ -1,219 +0,0 @@
pipeline {
agent {
label 'ubuntu'
}
environment {
PATH = "/home/jenkins/development/flutter/bin:${env.PATH}"
}
stages {
stage('Pre-build Cleanup') {
steps {
script {
sh '''#!/bin/sh
set -x
fusermount -u secrets || true
'''
}
}
}
stage('Decrypt main keys') {
when {
branch 'main'
}
steps {
script {
def userInput = input(
id: 'signaturePassword',
message: 'Please enter the signing key password:',
parameters: [
password(
defaultValue: '',
description: 'Enter the signing key password',
name: 'password'
)
]
)
env.PASSWORD = userInput.toString()
}
sh '''#!/bin/sh
echo \$PASSWORD | gocryptfs $HOME/android_secrets secrets/ -nonempty
'''
}
}
stage('Clone submodules') {
steps {
script {
sh 'git submodule update --init --recursive'
}
}
}
stage('Modify firka_bundle.dart') {
when {
branch 'main'
}
steps {
script {
sh '''#!/bin/sh
set -e
BUNDLE_FILE="firka/lib/helpers/firka_bundle.dart"
if [ -f "$BUNDLE_FILE" ]; then
echo "Modifying $BUNDLE_FILE"
sed -i 's/final bool _compressedBundle = false;/final bool _compressedBundle = Platform.isAndroid;/' "$BUNDLE_FILE"
echo "Modified _compressedBundle setting"
grep "_compressedBundle" "$BUNDLE_FILE" || echo "Warning: _compressedBundle line not found after modification"
else
echo "$BUNDLE_FILE not found"
exit 1
fi
'''
}
}
}
stage('Build firka') {
steps {
sh 'bash -c "./tools/linux/build_apk.sh ' + env.BRANCH_NAME + '"'
}
}
stage('Rename Release APKs') {
when {
branch 'main'
}
steps {
script {
sh '''#!/bin/sh
set -e
APK_DIR="firka/build/app/outputs/flutter-apk"
# Find all release APKs and rename them
for apk_file in $APK_DIR/app-*-release.apk; do
if [ -f "$apk_file" ]; then
# Extract ABI from filename (e.g., app-arm64-v8a-release.apk -> arm64-v8a)
basename_file=$(basename "$apk_file")
abi=$(echo "$basename_file" | sed 's/app-//; s/-release.apk//')
# Create new filename
new_name="app.firka.naplo_${abi}.apk"
new_path="$APK_DIR/$new_name"
echo "Renaming $apk_file to $new_path"
mv "$apk_file" "$new_path"
fi
done
ls -la $APK_DIR/app.firka.naplo_*.apk || echo "APK files not found"
'''
}
}
}
stage('Calculate Version Code') {
steps {
script {
sh '''#!/bin/sh
set -e
cd firka
# Calculate version code based on git commits (same logic as build script)
COMMIT_COUNT=$(git rev-list --count HEAD)
BASE_BUILD_NUMBER=$((1000 + COMMIT_COUNT))
if [ "$BRANCH_NAME" = "main" ]; then
# For main branch, highest version code is BASE + 3000 (x64 build)
VERSION_CODE=$((BASE_BUILD_NUMBER + 3000))
else
# For debug builds, version code is BASE + 0
VERSION_CODE=$BASE_BUILD_NUMBER
fi
echo "Calculated version code: $VERSION_CODE"
echo "$VERSION_CODE" > ../version_code.txt
'''
env.VERSION_CODE = readFile('version_code.txt').trim()
echo "Setting VERSION_CODE environment variable to: ${env.VERSION_CODE}"
}
}
}
stage('Upload to F-Droid Debug') {
when {
branch 'dev'
}
steps {
script {
withCredentials([usernamePassword(credentialsId: 'fdroid-ssh', usernameVariable: 'SSH_USER', passwordVariable: 'SSHPASS')]) {
sh '''
SOURCE_FILE="firka/build/app/outputs/flutter-apk/app-debug.apk"
REMOTE_PATH="/home/fdroid/firka-fdroid/repo/app.firka.naplo.debug.apk"
export SSHPASS
sshpass -e scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
"$SOURCE_FILE" "$SSH_USER@10.0.0.21:$REMOTE_PATH"
# Update version code in F-Droid metadata
sshpass -e ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
"$SSH_USER@10.0.0.21" \
"sed -i 's/^CurrentVersionCode: .*/CurrentVersionCode: $VERSION_CODE/' /home/fdroid/firka-fdroid/metadata/app.firka.naplo.debug.yml"
sshpass -e ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
"$SSH_USER@10.0.0.21" \
"cd /home/fdroid/firka-fdroid && /run/current-system/sw/bin/fdroid update"
'''
}
}
}
}
stage('Upload to F-Droid Release') {
when {
branch 'main'
}
steps {
script {
withCredentials([usernamePassword(credentialsId: 'fdroid-ssh', usernameVariable: 'SSH_USER', passwordVariable: 'SSHPASS')]) {
sh '''
# Use the renamed APK files
REMOTE_PATH="/home/fdroid/firka-fdroid/repo/"
export SSHPASS
# Loop over each APK file and upload it one by one
for SOURCE_FILE in firka/build/app/outputs/flutter-apk/app.firka.naplo_*.apk; do
if [ -f "$SOURCE_FILE" ]; then
echo "Uploading $SOURCE_FILE to $REMOTE_PATH"
sshpass -e scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
"$SOURCE_FILE" "$SSH_USER@10.0.0.21:$REMOTE_PATH"
else
echo "No APK files found to upload."
fi
done
# Update version code in F-Droid metadata for release
sshpass -e ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
"$SSH_USER@10.0.0.21" \
"sed -i 's/^CurrentVersionCode: .*/CurrentVersionCode: $VERSION_CODE/' /home/fdroid/firka-fdroid/metadata/app.firka.naplo.yml"
# Update F-Droid repository
sshpass -e ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
"$SSH_USER@10.0.0.21" \
"cd /home/fdroid/firka-fdroid && /run/current-system/sw/bin/fdroid update"
'''
}
}
}
}
stage('Post Cleanup') {
steps {
script {
sh '''
rm firka/build/app/outputs/flutter-apk/app.firka.naplo_*.apk || true
rm firka/build/app/outputs/flutter-apk/app-debug.apk || true
rm version_code.txt || true
git checkout -- firka/pubspec.yaml || true
git checkout -- firka/lib/helpers/firka_bundle.dart || true
'''
}
}
}
}
}

View File

@@ -1,13 +1,49 @@
# Firka Napló
# <img src="https://git.firka.app/firka/readme-files/raw/branch/main/dave.png" height="40" /> Firka
| <sub>HU</sub> [Magyar](README.md) | <sub>EN</sub> [English](README_en.md) |
|-----------------------------------|---------------------------------------|
| <sub>HU</sub> [Magyar](README.md) | <sub>EN</sub> [English](README_en.md) | <sub>DE</sub> [Deutsch](README_de.md) |
|-----------------------------------|---------------------------------------|---------------------------------------|
[![Crowdin](https://badges.crowdin.net/firka/localized.svg)](https://crowdin.com/project/firka)
<a href="https://translate.firka.app/engage/firka-naplo/"><img src="https://translate.firka.app/widget/firka-naplo/firka-app/en/svg-badge.svg" alt="Fordítás állapota"></a>
<a href="https://status.firka.app/"><img src="https://status.firka.app/api/badge/1/uptime/24?label=Üzemidő&suffix=%" alt="Üzemidő"></a>
<a href="https://builds.firka.app/job/Firka%20Beta/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fbuilds.firka.app%2Fjob%2FFirka%2520Beta%2F&label=Build" alt="Build állapota"></a>
## A projektről
### Azért kezdtünk neki ennek a projektnek, mert úgy véltük, hogy a hivatalos alkalmazás nem volt elég jó. A Firka egy teljesen nyílt forráskódú, közösség által karbantartott alternatíva, és ez még csak a kezdet. Minden verzióval gyorsabb, testreszabhatóbb és felhasználóbarátabb lesz.
Firka egy alternatív [megnevezetlen naplóra] egy kliens alkalmazás. Az alkalmazás célja
egy modern, felhasználóbarát felület biztosítása a(z) [megnevezetlen napló] rendszerhez.
<img src="https://git.firka.app/firka/readme-files/raw/branch/main/firka_features.png" width="100%" />
A [fejlesztői környezet beállítsa](CONTRIBUTING.md)
<br />
## Mik egyáltalán az alkalmazás funkciói?
### Lásd előre, mi vár rád
A főképernyő megmutatja a közelgő óráidat, hogy soha ne érjen meglepetés. Szűrj tantárgy, dolgozatok, vagy bármi más alapján, ami számodra fontos. Az alsó sáv teljesen testreszabható – tedd oda, amit használsz, és rejtsd el, amit nem.
### Jegyek, a te feltételeid szerint
Nem vagy felkészülve a jegyeidre? Ez a beállítás elrejti őket, amíg egyesével meg nem nyitod őket, így kényelmes tempóban dolgozhatod fel minden kudarcodat.
### Pontosan mennyire vagy rossz matekból?
A jegyek oldalon grafikon mutatja az összesített átlagodat, így végig követheted, ahogyan lassan süllyed a félév során. Minden tantárgyhoz külön grafikon is tartozik, ha pontosan tudni akarod melyik a tettes.
### Szabj testre mindent
A beállítások képernyőn olyan lehetőségek is vannak, amelyekről nem is tudtad, hogy szükséged van rájuk. Állítsd be a csengő eltolását, hogy másodpercre pontosan tudd, mikor ér véget az óra.
Balkezes mód is van, mert úgy tűnik, van, aki nem volt szerencsés az életben.
## Mit támogattok?
Jelenleg **Androidot** támogatunk (Wear OS-es okosóra-kísérőalkalmazással).
<br />
Tervezzük a böngészős támogatást is!
## Contribution
Az első lépéseket a [közreműködési útmutatóban](CONTRIBUTING_en.md) találod.
## Közösség
[Discord](https://discord.gg/xTspd3zzRZ)

51
README_de.md Normal file
View File

@@ -0,0 +1,51 @@
# <img src="https://git.firka.app/firka/readme-files/raw/branch/main/dave.png" height="40" /> Firka
| <sub>HU</sub> [Magyar](README.md) | <sub>EN</sub> [English](README_en.md) | <sub>DE</sub> [Deutsch](README_de.md) |
|-----------------------------------|---------------------------------------|---------------------------------------|
<a href="https://translate.firka.app/engage/firka-naplo/"><img src="https://translate.firka.app/widget/firka-naplo/firka-app/en/svg-badge.svg" alt="Translation status"></a>
<a href="https://status.firka.app/"><img src="https://status.firka.app/api/badge/1/uptime/24?label=Uptime&suffix=%" alt="Uptime"></a>
<a href="https://builds.firka.app/job/Firka%20Beta/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fbuilds.firka.app%2Fjob%2FFirka%2520Beta%2F&label=Build" alt="Build status"></a>
### Wir haben diese App entwickelt, weil die offizielle App viel zu wünschen übrig ließ. Firka ist eine vollständig open-source, von der Community gepflegte Alternative, und wir stehen erst am Anfang. Mit jedem Release wird sie schneller, anpassbarer und benutzerfreundlicher.
<img src="https://git.firka.app/firka/readme-files/raw/branch/main/firka_features.png" width="100%" />
<br />
## Was sind überhaupt die Funktionen der App?
### Sieh, was ansteht
Der Startbildschirm zeigt deine anstehenden Lektionen an, damit du nie unvorbereitet bist. Filtere nach Fach, Prüfungen oder was auch immer dir gerade wichtig ist. Die untere Leiste ist vollständig anpassbar: Zeige an was du nutzt und verstecke was du nicht brauchst.
### Noten, ganz nach deinen Vorstellungen
Emotional nicht bereit für deine eigenen Noten? Diese Einstellung hält sie verborgen, bis du jede einzelne antippst, damit du deine Misserfolge in einem angenehmen Tempo verarbeiten kannst.
### Wie schlecht bist du eigentlich in Mathe?
Die Noten-Seite enthält ein Diagramm deines Gesamtdurchschnitts, sodass du beobachten kannst, wie er im Laufe des Semesters langsam sinkt. Jedes Fach hat zudem ein eigenes Diagramm, falls du genau wissen möchtest, welches dafür verantwortlich ist.
### Alles anpassen
Der Einstellungsbildschirm bietet Optionen, von denen du nicht wusstest, dass du sie brauchst. Passe die Glockenverzögerung an, damit du auf die Sekunde genau weißt, wann der Unterricht endet. Es gibt auch einen Linkshänder-Modus, denn anscheinend benutzen manche Leute ihr Handy falsch.
## Was wird unterstützt?
Derzeit unterstützen wir **Android** (mit einer Wear OS Smartwatch-Begleit-App).
<br />
Wir planen, auch deinen Browser zu unterstützen!
## Mitwirken
Wir würden uns sehr über deine Hilfe freuen.
Du kannst im [Leitfaden zum unterstützen](CONTRIBUTING_de.md) loslegen.
## Community
[Discord](https://discord.gg/xTspd3zzRZ)

View File

@@ -1,13 +1,51 @@
# Firka
# <img src="https://git.firka.app/firka/readme-files/raw/branch/main/dave.png" height="40" /> Firka
| <sub>HU</sub> [Magyar](README.md) | <sub>EN</sub> [English](README_en.md) |
|-----------------------------------|---------------------------------------|
| <sub>HU</sub> [Magyar](README.md) | <sub>EN</sub> [English](README_en.md) | <sub>DE</sub> [Deutsch](README_de.md) |
|-----------------------------------|---------------------------------------|---------------------------------------|
[![Crowdin](https://badges.crowdin.net/firka/localized.svg)](https://crowdin.com/project/firka)
<a href="https://translate.firka.app/engage/firka-naplo/"><img src="https://translate.firka.app/widget/firka-naplo/firka-app/en/svg-badge.svg" alt="Translation status"></a>
<a href="https://status.firka.app/"><img src="https://status.firka.app/api/badge/1/uptime/24?label=Uptime&suffix=%" alt="Uptime"></a>
<a href="https://builds.firka.app/job/Firka%20Beta/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fbuilds.firka.app%2Fjob%2FFirka%2520Beta%2F&label=Build" alt="Build status"></a>
## The project
### We built this because the official app left a lot to be desired. Firka is a fully open source, community maintained alternative and we're just getting started. Faster, more customizable, and more user friendly with every release.
Firka is an alternative client for [an application to be named]. The app's goal is to be a modern
user friendly app for the [to be named] system.
[Contribution guide](CONTRIBUTING_en.md)
<img src="https://git.firka.app/firka/readme-files/raw/branch/main/firka_features.png" width="100%" />
<br />
## What even are the app's features?
### See what's coming
The home screen shows your upcoming lessons so you're never caught off guard. Filter by subject, exams, or whatever you actually care about. The bottom bar is fully customizable, put what you use, hide what you don't.
### Grades, on your terms
Emotionally unprepared for your own grades? This setting keeps them hidden until you tap each one open, so you can process your failures at a comfortable pace.
### How bad are you at maths, exactly?
The grades page has a graph of your overall average, so you can watch it slowly decline over the semester. Each subject also gets its own graph, in case you wanted to know exactly which one is responsible.
### Customize everything
The settings screen has options you didn't know you needed. Adjust the bell offset so you know exactly when class ends down to the second. Left-handed mode exists too, because apparently some people use their phones wrong.
## What do you support?
Currently, we support **Android** (with a Wear OS smartwatch companion app).
<br />
We're planning on supporting your browser also!
## Contribution
We would really appriciate your help.
You can get started at the [contribution guide](CONTRIBUTING_en.md).
## Community
[Discord](https://discord.gg/xTspd3zzRZ)

52
build.ps1 Normal file
View File

@@ -0,0 +1,52 @@
$ErrorActionPreference = 'Stop'
$ROOT = $PSScriptRoot
$SHA = (git -C $ROOT rev-parse --short HEAD)
$COMMIT_COUNT = [int](git -C $ROOT rev-list --count HEAD)
function Build-App {
param([string]$App)
$pubspec = Join-Path $ROOT $App "pubspec.yaml"
if (-not (Test-Path $pubspec)) {
Write-Error "Not found: $pubspec"
}
$versionLine = Get-Content $pubspec | Select-String -Pattern '^\s*version:\s*' | Select-Object -First 1
if (-not $versionLine) {
Write-Error "No version line in $pubspec"
}
$line = $versionLine.Line
if ($line -match '^\s*version:\s*([^+\s]+)') {
$baseVersion = $Matches[1].Trim()
} else {
Write-Error "Could not parse version from: $line"
}
$buildName = "${baseVersion}-${SHA}"
$versionCode = 2000 + $COMMIT_COUNT
if ($App -eq "firka_wear") {
$versionCode += 1
}
Write-Host "Building $App : version $buildName (version code: $versionCode)"
Push-Location (Join-Path $ROOT $App)
try {
flutter pub get
dart run scripts/codegen.dart
flutter build appbundle --build-name="$buildName" --build-number="$versionCode" --verbose
} finally {
Pop-Location
}
}
$target = if ($args.Count -gt 0) { $args[0] } else { "all" }
switch ($target) {
"firka" { Build-App firka }
"firka_wear" { Build-App firka_wear }
"all" { Build-App firka; Build-App firka_wear }
default {
Write-Error "Usage: $MyInvocation.MyCommand.Name [firka|firka_wear|all]"
}
}

41
build.sh Normal file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
SHA=$(git -C "$ROOT" rev-parse --short HEAD)
COMMIT_COUNT=$(git -C "$ROOT" rev-list --count HEAD)
build_app() {
local APP="$1"
local PUBSPEC="$ROOT/$APP/pubspec.yaml"
if [[ ! -f "$PUBSPEC" ]]; then
echo "Not found: $PUBSPEC" >&2
return 1
fi
local VERSION_LINE BASE_VERSION BUILD_NAME VERSION_CODE
VERSION_LINE=$(grep -E '^\s*version:\s*' "$PUBSPEC" | head -1)
BASE_VERSION=$(echo "$VERSION_LINE" | sed -E 's/^[[:space:]]*version:[[:space:]]*([^+]+).*/\1/' | tr -d ' ')
BUILD_NAME="${BASE_VERSION}-${SHA}"
VERSION_CODE=$((2000 + COMMIT_COUNT))
[[ "$APP" == "firka_wear" ]] && VERSION_CODE=$((VERSION_CODE + 1))
echo "Building $APP: version $BUILD_NAME (version code: $VERSION_CODE)"
cd "$ROOT/$APP"
flutter pub get
dart run scripts/codegen.dart
flutter build appbundle --build-name="$BUILD_NAME" --build-number="$VERSION_CODE" --verbose
}
case "${1:-all}" in
firka) build_app firka ;;
firka_wear) build_app firka_wear ;;
all) build_app firka && build_app firka_wear ;;
*)
echo "Usage: $0 [firka|firka_wear|all]" >&2
exit 1
;;
esac

48
cache.md Normal file
View File

@@ -0,0 +1,48 @@
# Cache
Entry:
név|típus|
-|-|
latestElement|idő|
createdAt|idő|
response|Json|
Legutóbbi = Legutóbbi sikeres adatlekérdezés listájának legfrissebb elemének ideje.
## Timetable
TimetableDay entry.
Frissíteni|Korábbi|Múlt hét|Jelenlegi hét|Jövő hét|Későbbi|
-|-|-|-|-|-|
belépéskor?|✖️|✖️|✔️|✔️|✖️|
kijelzéskor?|✖️|✖️|✖️|✖️|✔️|
Új mulasztáskor a mulasztás napját MINDIG frissíti.
## Értékelések/Tesztek/Faliújság/Feljegyzések/Házi feladatok
Frissíteni|Korábbi|Legutóbbi létrehozástól|
-|-|-|
belépéskor?|✖️|✔️|
kijelzéskor?|✖️|✖️|
## Mulasztások
Összes
## Egyéb
Belépéskor
--------
# IMPL
### GenericCache
Entry:
név|típus|
-|-|
userId|id|
createdAt|idő|
response|Json|

5
firka/.env.example Normal file
View File

@@ -0,0 +1,5 @@
# Backend Configuration
# Development: http://192.168.X.YYY:3000/api/v1
# Production: https://your-domain.com/api/v1
BACKEND_BASE_URL=http://192.168.X.YYY:3000/api/v1
BACKEND_API_KEY=development_api_key_12345

11
firka/.gitignore vendored
View File

@@ -12,6 +12,11 @@
.swiftpm/
migrate_working_dir/
# Environment variables
.env
.env.local
.env.*.local
# IntelliJ related
*.iml
*.ipr
@@ -44,4 +49,8 @@ app.*.map.json
/android/app/profile
/android/app/release
coverage
coverage
# Generated files
*.g.dart
libisar.so

View File

@@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.
version:
revision: "05db9689081f091050f01aed79f04dce0c750154"
revision: "adc901062556672b4138e18a4dc62a4be8f4b3c2"
channel: "stable"
project_type: app
@@ -13,11 +13,11 @@ project_type: app
migration:
platforms:
- platform: root
create_revision: 05db9689081f091050f01aed79f04dce0c750154
base_revision: 05db9689081f091050f01aed79f04dce0c750154
create_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2
base_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2
- platform: ios
create_revision: 05db9689081f091050f01aed79f04dce0c750154
base_revision: 05db9689081f091050f01aed79f04dce0c750154
create_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2
base_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2
# User provided section

View File

@@ -7,6 +7,10 @@
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
analyzer:
exclude:
- build/**
- android/**
include: package:flutter_lints/flutter.yaml
linter:

View File

@@ -1,77 +1,54 @@
import org.apache.commons.io.FileUtils
import java.io.FileInputStream
import java.security.MessageDigest
import java.util.Properties
import java.util.concurrent.Executors
import java.util.concurrent.Future
import java.util.concurrent.locks.ReentrantReadWriteLock
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
import java.util.zip.ZipOutputStream
import java.util.zip.ZipOutputStream.DEFLATED
import java.util.zip.ZipOutputStream.STORED
plugins {
id("com.android.application")
id("kotlin-android")
id("org.jetbrains.kotlin.plugin.compose") version "2.2.0"
// START: FlutterFire Configuration
id("com.google.gms.google-services")
// END: FlutterFire Configuration
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.kotlin.android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}
fun loadProperties(file: File): Properties {
val properties = Properties()
FileInputStream(file).use { inputStream ->
properties.load(inputStream)
}
return properties
}
android {
namespace = "app.firka.naplo"
compileSdk = flutter.compileSdkVersion
ndkVersion = "27.0.12077973"
compileSdk = 37
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}
buildFeatures {
compose = true
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
defaultConfig {
applicationId = "app.firka.naplo"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 29
targetSdk = 36
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}
val secretsDir = File(projectDir.absolutePath, "../../../secrets/")
val propsFile = File(secretsDir, "keystore.properties")
if (propsFile.exists()) {
val props = loadProperties(propsFile)
val props = Properties().apply { FileInputStream(propsFile).use { load(it) } }
val store = File(secretsDir, props["storeFile"].toString())
signingConfigs {
create("release") {
storeFile = store
storePassword = props["storePassword"] as String
keyPassword = props["keyPassword"] as String
keyAlias = props["keyAlias"] as String
// Use APK Signature Scheme v3 (and v4 for streaming verification). See:
// https://source.android.com/docs/security/features/apksigning/v3
enableV3Signing = true
enableV4Signing = true
}
}
}
buildTypes {
getByName("debug") {
applicationIdSuffix = ".debug"
@@ -79,808 +56,64 @@ android {
}
release {
val config = signingConfigs.findByName("release")
if (config != null) {
signingConfig = config
}
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
proguardFiles("proguard-rules.pro")
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
configurations.all {
resolutionStrategy {
force("androidx.test.espresso:espresso-core:3.6.1")
force("androidx.test.espresso:espresso-idling-resource:3.6.1")
}
}
dependencies {
implementation("androidx.wear:wear-ongoing:1.0.0")
implementation("androidx.glance:glance-appwidget:1.1.1")
implementation("com.google.android.gms:play-services-wearable:18.1.0")
implementation("com.google.android.gms:play-services-base:18.5.0")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
}
// Ensure .env exists before Flutter bundles assets (copy from .env.example if missing)
val envFile = file("${project.projectDir}/../../.env")
val envExampleFile = file("${project.projectDir}/../../.env.example")
tasks.register("ensureEnv") {
doLast {
if (!envFile.exists() && envExampleFile.exists()) {
envExampleFile.copyTo(envFile, overwrite = false)
println("Created .env from .env.example for asset bundling.")
}
}
}
tasks.matching { it.name.startsWith("compileFlutterBuild") }.configureEach {
dependsOn("ensureEnv")
}
// Ensure default ProGuard files exist at the projectDir location expected by AGP/R8 when build directory is relocated
val defaultProguardDir = file("${project.projectDir}/build/intermediates/default_proguard_files/global")
defaultProguardDir.mkdirs()
val defaultProguardOptimize = File(defaultProguardDir, "proguard-android-optimize.txt-9.2.0")
if (!defaultProguardOptimize.exists()) {
defaultProguardOptimize.writeText("-allowaccessmodification\n")
}
tasks.register("ensureProguardFiles") {
doLast {
defaultProguardDir.mkdirs()
if (!defaultProguardOptimize.exists()) {
defaultProguardOptimize.writeText("-allowaccessmodification\n")
}
}
}
tasks.matching { it.name.startsWith("compile") || it.name.contains("minify", ignoreCase = true) || it.name.contains("r8", ignoreCase = true) }.configureEach {
dependsOn("ensureProguardFiles")
}
flutter {
source = "../.."
}
tasks.register("transformAndResignDebugApk") {
group = "build"
description = "Transform and resign APK with debug key"
dependsOn("assembleDebug")
doLast {
if (System.getenv("TRANSFORM_APK") != null
&& System.getenv("TRANSFORM_APK") == "true") {
transformApks(true)
}
}
}
tasks.register("transformAndResignReleaseApk") {
group = "build"
description = "Transform and resign APK with release key"
dependsOn("assembleRelease")
doLast {
checkReleaseKey()
if (System.getenv("TRANSFORM_APK") != null
&& System.getenv("TRANSFORM_APK") == "true") {
transformApks(false)
}
}
}
tasks.register("transformAndResignReleaseBundle") {
group = "build"
description = "Transform and resign bundle with release key"
dependsOn("bundleRelease")
doLast {
if (System.getenv("TRANSFORM_AAB") != null
&& System.getenv("TRANSFORM_AAB") == "true") {
transformAppBundle()
}
}
}
afterEvaluate {
tasks.findByName("assembleDebug")?.finalizedBy("transformAndResignDebugApk")
tasks.findByName("assembleRelease")?.finalizedBy("transformAndResignReleaseApk")
tasks.findByName("bundleRelease")?.finalizedBy("transformAndResignReleaseBundle")
}
fun checkReleaseKey() {
val secretsDir = File(projectDir.absolutePath, "../../../secrets/")
val propsFile = File(secretsDir, "keystore.properties")
if (propsFile.exists()) {
val props = loadProperties(propsFile)
val store = File(secretsDir, props["storeFile"].toString())
println(
"Signing with:\n" +
"\t- store: ${store.name}\n" +
"\t- key: ${props["keyAlias"]}"
)
} else {
throw Exception("Release keystore not found!")
}
}
fun transformApks(debug: Boolean, i : Int = 0) {
try {
_transformApks(debug)
} catch (e: Exception) {
if (i < 5) {
e.printStackTrace()
println("Retrying: ${i + 1}")
transformApks(debug, i + 1)
} else {
throw e
}
}
}
fun _transformApks(debug: Boolean) {
println("Starting APK transformation process...")
val buildDir = project.buildDir
val apkDir = File(buildDir, "outputs/flutter-apk")
val apks = getApks(debug)
var c = 0
apks
.forEach { c++; transformAndSignApk(apkDir, it.nameWithoutExtension, debug) }
println("Transformed: $c apks")
}
fun transformAndSignApk(apkDir: File, name: String, debug: Boolean) {
val originalApk = File(apkDir, "$name.apk")
val transformedApk = File(apkDir, "$name-transformed.apk")
val finalApk = File(apkDir, "$name-resigned.apk")
val finalIdsig = File(apkDir, "$name-resigned.apk.idsig")
if (!originalApk.exists()) {
throw GradleException("Original APK not found at: ${originalApk.absolutePath}")
}
if (transformedApk.exists()) transformedApk.delete()
if (finalApk.exists()) finalApk.delete()
println("Original APK: ${originalApk.absolutePath}")
try {
println("Transforming APK...")
transformApk(originalApk, transformedApk, if (debug) { "6" } else {"Z"})
if (debug) {
println("Signing with debug key...")
signWithDebugKey(transformedApk, finalApk)
} else {
println("Signing with release key...")
signWithReleaseKey(transformedApk, finalApk)
}
if (finalApk.exists()) {
originalApk.delete()
finalIdsig.delete()
finalApk.renameTo(originalApk)
println("APK successfully transformed")
println("Final APK: ${originalApk.absolutePath}")
}
transformedApk.delete()
} catch (e: Exception) {
throw GradleException("Failed to transform and resign APK: ${e.message}", e)
}
}
fun transformApk(input: File, output: File, compressionLevel: String = "Z") {
val tempDir = File(project.buildDir, "tmp/apk-transform")
val cacheDir = File(project.buildDir, "cache")
val optipngCacheDir = File(cacheDir, "optipng")
val assetCompressionDir = File(cacheDir, "assets")
tempDir.deleteRecursively()
tempDir.mkdirs()
if (!optipngCacheDir.exists()) optipngCacheDir.mkdirs()
if (!assetCompressionDir.exists()) assetCompressionDir.mkdirs()
val brotli = findToolInPath("brotli")
?: throw Exception("Brotli not found in path")
val optipng = findToolInPath("optipng")
if (optipng == null || optipng.isEmpty()) {
println("Optipng was not found in PATH, optimizing images will be skipped.")
}
copy {
from(zipTree(input))
into(tempDir)
}
val metaInf = File(tempDir, "META-INF")
val metaInfFiles = metaInf.listFiles()
for (file in metaInfFiles!!) {
if (file.name.endsWith("MF") || file.name.endsWith("SF")
|| file.name.endsWith("RSA")) {
file.delete()
}
}
val arches = File(tempDir, "lib").listFiles()
val compressedLibs = mutableMapOf<String, String>()
for (arch in arches!!) {
val libFlutter = File(arch, "libflutter.so")
if (!libFlutter.exists()) continue
val compressedFlutter = File(arch, "libflutter-br.so")
compressedLibs["libflutter.so"] = libFlutter.sha256()
println("Compressing ${arch.name}/libflutter.so with brotli")
exec {
commandLine(
brotli,
"-$compressionLevel",
libFlutter.absolutePath,
"-o", compressedFlutter.absolutePath
)
}
libFlutter.delete()
val json = groovy.json.JsonBuilder(compressedLibs)
File(arch, "index.so").writeText(json.toString())
}
val topDirL = tempDir.absolutePath.length + 1
val zos = ZipOutputStream(output.outputStream())
val coreCount = Runtime.getRuntime().availableProcessors()
val flutterResources = tempDir.walkTopDown().filter{f -> f.absolutePath.contains("flutter_assets")}
val pngFiles = tempDir.walkTopDown().filter{f -> f.name.endsWith(".png")}
val assetIndex = mutableMapOf<String, String>()
val indexReadWriteLock = ReentrantReadWriteLock()
if (compressionLevel == "Z") {
if (optipng != null) {
val executor = Executors.newFixedThreadPool(coreCount)
val futures = mutableListOf<Future<*>>()
pngFiles.forEach { pngFile ->
val cacheFile = File(optipngCacheDir, pngFile.sha256())
if (cacheFile.exists()) {
cacheFile.copyTo(pngFile, true)
} else {
val future = executor.submit {
exec {
commandLine(
optipng,
"-zm", "9",
"-zw", "32k",
"-o9",
pngFile.absolutePath
)
}
pngFile.copyTo(cacheFile, true)
}
futures.add(future)
}
}
futures.forEach { it.get() }
executor.shutdown()
}
val executor = Executors.newFixedThreadPool(coreCount)
val futures = mutableListOf<Future<*>>()
val blacklist = listOf(
// "AssetManifest.bin",
"AssetManifest.json",
"FontManifest.json",
"isolate_snapshot_data",
"kernel_blob.bin",
"NativeAssetsManifest.json",
"NOTICES.Z",
"vm_snapshot_data",
"fonts",
"shaders"
)
flutterResources.forEach { f ->
val relName = f.absolutePath.substring(topDirL).replace("\\", "/")
if (f.isDirectory) return@forEach
val cacheFileRaw = File(assetCompressionDir, f.sha256()+".r")
val cacheFileGz = File(assetCompressionDir, f.sha256()+".gz")
val cacheFileBr = File(assetCompressionDir, f.sha256()+".br")
if (cacheFileRaw.exists() || cacheFileGz.exists() || cacheFileBr.exists()) {
if (cacheFileRaw.exists()) {
cacheFileRaw.copyTo(f, true)
indexReadWriteLock.writeLock().lock()
assetIndex[relName] = "r"
indexReadWriteLock.writeLock().unlock()
} else if (cacheFileGz.exists()) {
cacheFileGz.copyTo(f, true)
indexReadWriteLock.writeLock().lock()
assetIndex[relName] = "g"
indexReadWriteLock.writeLock().unlock()
} else {
cacheFileBr.copyTo(f, true)
indexReadWriteLock.writeLock().lock()
assetIndex[relName] = "b"
indexReadWriteLock.writeLock().unlock()
}
} else {
val future = executor.submit {
val brTmp = File(f.absolutePath + ".br.tmp")
val gzTmp = File(f.absolutePath + ".gz.tmp")
var blacklisted = false
for (f in blacklist) {
if (relName.contains(f)) {
blacklisted = true
break
}
}
if (!blacklisted) {
println("$relName: Testing with brotli")
exec {
commandLine(
brotli,
"-$compressionLevel",
f.absolutePath,
"-o", brTmp.absolutePath
)
}
println("$relName: Testing with gzip")
ant.invokeMethod(
"gzip", mapOf(
"src" to f.absolutePath,
"destfile" to gzTmp.absolutePath,
)
)
println("$brTmp: ${brTmp.length()}")
println("$gzTmp: ${gzTmp.length()}")
if (f.length() < gzTmp.length() && f.length() < brTmp.length()) {
println("$relName: Raw file wins")
f.copyTo(cacheFileRaw, true)
indexReadWriteLock.writeLock().lock()
assetIndex[relName] = "r"
indexReadWriteLock.writeLock().unlock()
} else {
if (brTmp.length() < gzTmp.length()) {
println("$relName: Brotli wins")
f.delete()
brTmp.copyTo(f, true)
brTmp.copyTo(cacheFileBr, true)
indexReadWriteLock.writeLock().lock()
assetIndex[relName] = "b"
indexReadWriteLock.writeLock().unlock()
} else {
println("$relName: Gzip wins")
f.delete()
gzTmp.copyTo(f, true)
gzTmp.copyTo(cacheFileGz, true)
indexReadWriteLock.writeLock().lock()
assetIndex[relName] = "g"
indexReadWriteLock.writeLock().unlock()
}
}
brTmp.delete()
gzTmp.delete()
}
}
futures.add(future)
}
}
futures.forEach { it.get() }
executor.shutdown()
}
tempDir.walkTopDown().forEach { f ->
if (f.absolutePath == tempDir.absolutePath) return@forEach
var relName = f.absolutePath.substring(topDirL).replace("\\", "/")
if (f.isDirectory && !relName.endsWith("/")) relName += "/"
if (compressionLevel == "Z") {
if (relName == "assets/flutter_assets/assets/firka.i") return@forEach
}
println(relName)
val compress = !relName.endsWith(".so") && !relName.endsWith(".arsc")
zos.setMethod(if (compress) { DEFLATED } else { STORED })
val entry = ZipEntry(relName)
if (!compress) {
entry.size = f.length()
entry.crc = FileUtils.checksumCRC32(f)
}
zos.putNextEntry(entry)
if (f.isFile) {
zos.write(f.readBytes())
}
zos.closeEntry()
}
if (compressionLevel == "Z") {
zos.setMethod(DEFLATED)
zos.putNextEntry(ZipEntry("assets/flutter_assets/assets/firka.i"))
val indexUncompressed = File(tempDir, "index.json")
indexReadWriteLock.readLock().lock()
val json = groovy.json.JsonBuilder(assetIndex)
indexReadWriteLock.readLock().unlock()
indexUncompressed.writeText(json.toString())
val indexCompressed = File(tempDir, "index.json.br")
exec {
commandLine(
brotli,
"-$compressionLevel",
indexUncompressed.absolutePath,
"-o", indexCompressed.absolutePath
)
}
zos.write(indexCompressed.readBytes())
indexUncompressed.delete()
indexCompressed.delete()
zos.closeEntry()
}
zos.close()
tempDir.deleteRecursively()
println("APK transformed successfully")
}
fun transformAppBundle() {
val buildDir = project.buildDir
val bundle = File(buildDir, "outputs/bundle/release/app-release.aab")
val bundleTmp = File(buildDir, "outputs/bundle/release/tmp.zip")
val apks = getApks(false)
val apkCount = apks.count { it.name.startsWith("app-") && it.name.endsWith("-release.apk") }
if (!bundle.exists()) {
throw Exception("Bundle not found at: $bundle")
}
if (apkCount < 3) {
throw Exception("Excepected 3 apks per abi but only found $apkCount")
}
val aabTempDir = File(project.buildDir, "tmp/aab-transform")
aabTempDir.deleteRecursively()
aabTempDir.mkdirs()
val apksUnzipped = File(project.buildDir, "tmp/apks-unzipped")
apksUnzipped.deleteRecursively()
val arm32TempDir = File(apksUnzipped, "armeabi-v7a")
arm32TempDir.mkdirs()
val arm64TempDir = File(apksUnzipped, "arm64-v8a")
arm64TempDir.mkdirs()
val x86TempDir = File(apksUnzipped, "x86_64")
x86TempDir.mkdirs()
copy {
from(zipTree(bundle))
into(aabTempDir)
}
copy {
from(zipTree(apks.first { it.name.contains("armeabi-v7a") }))
into(arm32TempDir)
}
copy {
from(zipTree(apks.first { it.name.contains("arm64-v8a") }))
into(arm64TempDir)
}
copy {
from(zipTree(apks.first { it.name.contains("x86_64") }))
into(x86TempDir)
}
val libs = File(aabTempDir, "base/lib").listFiles()!!
for (dstLibs in libs) {
println("Copying lib: ${dstLibs.name}")
val srcDir = File(apksUnzipped, dstLibs.name)
if (!srcDir.exists()) {
continue
}
val srcLibs = File(srcDir, "lib/${dstLibs.name}/")
dstLibs.listFiles()!!.forEach { it.delete() }
srcLibs.listFiles()!!.forEach { it.copyTo(File(dstLibs, it.name)) }
}
val zos = ZipOutputStream(bundleTmp.outputStream())
val bundleZip = ZipFile(bundle)
val bundleEntries = bundleZip.entries()
val brotli = findToolInPath("brotli")
?: throw Exception("Brotli not found in path")
val optipng = findToolInPath("optipng")
?: throw Exception("Optipng not found in path")
val indexReadWriteLock = ReentrantReadWriteLock()
val assetIndex = mutableMapOf<String, String>()
while (bundleEntries.hasMoreElements()) {
val entry = bundleEntries.nextElement()
/*
if (entry.name == "base/assets/flutter_assets/assets/firka.i") {
println("Patching: ${entry.name}")
zos.putNextEntry(ZipEntry("assets/flutter_assets/assets/firka.i"))
val indexUncompressed = File(aabTempDir, "index.json")
indexReadWriteLock.readLock().lock()
val json = groovy.json.JsonBuilder(assetIndex)
indexReadWriteLock.readLock().unlock()
indexUncompressed.writeText(json.toString())
val indexCompressed = File(aabTempDir, "index.json.br")
exec {
commandLine(
brotli,
"-Z",
indexUncompressed.absolutePath,
"-o", indexCompressed.absolutePath
)
}
zos.write(indexCompressed.readBytes())
indexUncompressed.delete()
indexCompressed.delete()
zos.closeEntry()
continue
}
if (entry.name.startsWith("base/lib")) {
println("Patching: ${entry.name}")
zos.putNextEntry(ZipEntry(entry.name))
zos.closeEntry()
continue
}
*/
println("Adding: ${entry.name}")
zos.putNextEntry(ZipEntry(entry.name))
if (!entry.isDirectory) {
val data = bundleZip.getInputStream(entry).readAllBytes()
zos.write(data)
}
zos.closeEntry()
}
bundleZip.close()
zos.close()
bundle.delete()
signBundle(bundleTmp, bundle)
bundleTmp.delete()
aabTempDir.deleteRecursively()
println("AAB transformed successfully")
}
fun File.sha256(): String {
val md = MessageDigest.getInstance("SHA-256")
val digest = md.digest(this.readBytes())
return digest.fold("") { str, it -> str + "%02x".format(it) }
}
fun getApks(debug: Boolean): List<File> {
val buildDir = project.buildDir
val apkDir = File(buildDir, "outputs/flutter-apk")
val apks = apkDir.listFiles()!!
val flavor = if (debug) { "debug" } else { "release" }
return apks
.filter { apk -> apk.name.startsWith("app-") && apk.name.endsWith("-$flavor.apk") }
.toList()
}
fun getDebugKeystorePath(): String {
val userHome = System.getProperty("user.home")
val debugKeystore = File(userHome, ".android/debug.keystore")
if (!debugKeystore.exists()) {
throw GradleException("Debug keystore not found at: ${debugKeystore.absolutePath}")
}
return debugKeystore.absolutePath
}
fun getDefaultAndroidSdkPath(): String? {
val os = System.getProperty("os.name").lowercase()
val userHome = System.getProperty("user.home")
return when {
os.contains("win") ->
"$userHome\\AppData\\Local\\Android\\Sdk"
os.contains("mac") ->
"$userHome/Library/Android/sdk"
os.contains("linux") ->
"$userHome/Android/Sdk"
else -> null
}
}
fun findToolInPath(toolName: String): String? {
val pathEnvironment = System.getenv("PATH")
val pathDirs = pathEnvironment.split(File.pathSeparator)
val executableNames = when {
System.getProperty("os.name").lowercase().contains("win") ->
listOf("$toolName.exe", toolName)
else ->
listOf(toolName)
}
for (pathDir in pathDirs) {
for (execName in executableNames) {
val possibleTool = File(pathDir, execName)
if (possibleTool.exists() && possibleTool.canExecute()) {
return possibleTool.absolutePath
}
}
}
return null
}
fun findToolInSdkPath(toolName: String): String? {
var androidHome : String? = System.getenv("ANDROID_HOME")
?: System.getenv("ANDROID_SDK_ROOT")
if (androidHome == null) androidHome = getDefaultAndroidSdkPath()
if (androidHome != null) {
val buildTools = File(androidHome, "build-tools")
if (buildTools.exists()) {
val latestVersion = buildTools.listFiles()
?.filter { it.isDirectory }
?.filter { it.name != "debian" }
?.maxByOrNull { it.name }
if (latestVersion != null) {
val toolExec = File(latestVersion, toolName)
if (toolExec.exists()) {
return toolExec.absolutePath
}
}
}
}
if (!toolName.contains(".exe")) {
val exeTool = findToolInSdkPath("$toolName.exe")
if (exeTool != null) return exeTool
}
if (!toolName.contains(".sh")) {
val shTool = findToolInSdkPath("$toolName.sh")
if (shTool != null) return shTool
}
if (!toolName.contains(".bat")) {
val batTool = findToolInSdkPath("$toolName.bat")
if (batTool != null) return batTool
}
return null
}
fun signWithDebugKey(input: File, output: File) {
val debugKeystore = getDebugKeystorePath()
val debugKeystorePassword = "android"
val debugKeyAlias = "androiddebugkey"
val debugKeyPassword = "android"
val zipAlign: String = findToolInSdkPath("zipalign")
?: throw Exception("Could not find zipalign in ANDROID_SDK")
val apksigner: String = findToolInSdkPath("apksigner")
?: throw Exception("Could not find zipalign in ANDROID_SDK")
exec {
commandLine(
zipAlign,
"-v", "4",
input.absolutePath,
output.absolutePath
)
}
exec {
commandLine(
apksigner, "sign",
"--ks", debugKeystore,
"--ks-pass", "pass:$debugKeystorePassword",
"--ks-key-alias", debugKeyAlias,
"--key-pass", "pass:$debugKeyPassword",
output.absolutePath
)
}
println("APK signed and aligned successfully")
}
fun signWithReleaseKey(input: File, output: File) {
val secretsDir = File(projectDir.absolutePath, "../../../secrets/")
val propsFile = File(secretsDir, "keystore.properties")
if (!propsFile.exists()) {
throw Exception("Release keystore not found!")
}
val props = loadProperties(propsFile)
val releaseKeystore = File(secretsDir, props["storeFile"].toString())
val releaseKeystorePassword = props["storePassword"] as String
val releaseKeyAlias = props["keyAlias"] as String
val releaseKeyPassword = props["keyPassword"] as String
val zipAlign: String = findToolInSdkPath("zipalign")
?: throw Exception("Could not find zipalign either in ANDROID_SDK")
val apksigner: String = findToolInSdkPath("apksigner")
?: throw Exception("Could not find zipalign either in ANDROID_SDK")
exec {
commandLine(
zipAlign,
"-v", "4",
input.absolutePath,
output.absolutePath
)
}
exec {
commandLine(
apksigner, "sign",
"--ks", releaseKeystore,
"--ks-pass", "pass:$releaseKeystorePassword",
"--ks-key-alias", releaseKeyAlias,
"--key-pass", "pass:$releaseKeyPassword",
output.absolutePath
)
}
println("APK signed and aligned successfully")
}
fun signBundle(input: File, output: File) {
val secretsDir = File(projectDir.absolutePath, "../../../secrets/")
val propsFile = File(secretsDir, "keystore.properties")
if (!propsFile.exists()) {
throw Exception("Release keystore not found!")
}
val props = loadProperties(propsFile)
val releaseKeystore = File(secretsDir, props["storeFile"].toString())
val releaseKeystorePassword = props["storePassword"] as String
val releaseKeyAlias = props["keyAlias"] as String
val releaseKeyPassword = props["keyPassword"] as String
// val zipAlign: String = findToolInSdkPath("zipalign")
// ?: throw Exception("Could not find zipalign in ANDROID_SDK")
val jarsigner: String = findToolInPath("jarsigner")
?: throw Exception("Could not find jarsigner in PATH")
/*
exec {
commandLine(
zipAlign,
"-v", "4",
input.absolutePath,
output.absolutePath
)
}
*/
input.copyTo(output, true)
exec {
// -keystore $KEYSTORE -storetype $STORETYPE -storepass $STOREPASS -digestalg SHA1 -sigalg SHA256withRSA application.zip $KEYALIAS
commandLine(
jarsigner,
"-verbose",
"-sigalg", "SHA256withRSA",
"-digestalg", "SHA-256",
"-keystore", releaseKeystore,
"-storepass", releaseKeystorePassword,
output.absolutePath,
releaseKeyAlias
)
}
println("AAB signed and aligned successfully")
}

View File

@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "219357380322",
"project_id": "firka-4633b",
"storage_bucket": "firka-4633b.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:219357380322:android:5b776732799faa5c08a8bb",
"android_client_info": {
"package_name": "app.firka.naplo"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyD-3VE9--eKRDGm1UW_P9JLaM2Hyd2Wfx4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@@ -1,2 +1,75 @@
-keep class org.brotli.** { *; }
-keep class app.firka.naplo.glance.** { *; }
# Firka custom keep rules
-keep class app.firka.naplo.glance.** { *; }
# Android optimize rules (-allowaccessmodification)
-allowaccessmodification
# Android common keep rules
-keepattributes AnnotationDefault,
EnclosingMethod,
InnerClasses,
RuntimeVisibleAnnotations,
RuntimeVisibleParameterAnnotations,
RuntimeVisibleTypeAnnotations,
Signature
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
-keep public class com.google.android.vending.licensing.ILicensingService
-dontnote com.android.vending.licensing.ILicensingService
-dontnote com.google.vending.licensing.ILicensingService
-dontnote com.google.android.vending.licensing.ILicensingService
# Native methods
-keepclasseswithmembernames,includedescriptorclasses class * {
native <methods>;
}
# Keep setters in Views so that animations can still work.
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}
# We want to keep methods in Activity that could be used in the XML attribute onClick.
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
# For enumeration classes
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * implements android.os.Parcelable {
public static final ** CREATOR;
}
# Preserve annotated Javascript interface methods.
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
# The support libraries contains references to newer platform versions.
-dontnote android.support.**
-dontnote androidx.**
-dontwarn android.support.**
-dontwarn androidx.**
# Understand the @Keep support annotation.
-keep class android.support.annotation.Keep
-keep @android.support.annotation.Keep class * {*;}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <methods>;
}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <init>(...);
}
-dontnote org.apache.http.**
-dontnote android.net.http.**
-dontnote java.lang.invoke.**

View File

@@ -4,6 +4,7 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="Firka Debug"
<application android:name="app.firka.naplo.AppMain"
android:label="Firka Debug"
android:usesCleartextTraffic="true" />
</manifest>
</manifest>

View File

@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "219357380322",
"project_id": "firka-4633b",
"storage_bucket": "firka-4633b.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:219357380322:android:5b776732799faa5c08a8bb",
"android_client_info": {
"package_name": "app.firka.naplo.debug"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyD-3VE9--eKRDGm1UW_P9JLaM2Hyd2Wfx4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@@ -3,13 +3,43 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.POST_PROMOTED_NOTIFICATIONS" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:name=".AppMain"
android:icon="@mipmap/launcher_icon">
<service
android:name=".WearSyncForegroundService"
android:exported="false"
android:foregroundServiceType="dataSync" />
<service
android:name=".ProgressNotificationForegroundService"
android:exported="false"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="Displays ongoing school day lesson and break progress updates." />
</service>
<receiver
android:name=".ProgressAlarmReceiver"
android:exported="false">
<intent-filter>
<action android:name="app.firka.naplo.ACTION_PROGRESS_6AM_ALARM" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity
android:name=".MainActivity"
@@ -35,7 +65,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_ace"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_ace_round" >
<intent-filter>
@@ -49,7 +79,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_ace_f"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_ace_f_round" >
<intent-filter>
@@ -63,7 +93,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_bi"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_bi_round" >
<intent-filter>
@@ -77,7 +107,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_bi_f"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_bi_f_round" >
<intent-filter>
@@ -91,7 +121,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_cactus"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_cactus_round" >
<intent-filter>
@@ -105,7 +135,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_cc"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_cc_round" >
<intent-filter>
@@ -119,7 +149,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_enby"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_enby_round" >
<intent-filter>
@@ -133,7 +163,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_enby_f"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_enby_f_round" >
<intent-filter>
@@ -147,7 +177,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_fidesz"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_fidesz_round" >
<intent-filter>
@@ -161,7 +191,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_filc"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_filc_round" >
<intent-filter>
@@ -175,7 +205,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_filco"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_filco_round" >
<intent-filter>
@@ -189,7 +219,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_galaxy"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_galaxy_round" >
<intent-filter>
@@ -203,7 +233,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_gay"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_gay_round" >
<intent-filter>
@@ -217,7 +247,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_gay_f"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_gay_f_round" >
<intent-filter>
@@ -231,7 +261,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_half_firka_2"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_half_firka_2_round" >
<intent-filter>
@@ -245,7 +275,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_kreta"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_kreta_round" >
<intent-filter>
@@ -259,7 +289,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_lesb"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_lesb_round" >
<intent-filter>
@@ -273,7 +303,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_lesb_f"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_lesb_f_round" >
<intent-filter>
@@ -287,7 +317,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_lgbtq"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_lgbtq_round" >
<intent-filter>
@@ -301,7 +331,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_lgbtq_f"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_lgbtq_f_round" >
<intent-filter>
@@ -315,7 +345,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_lgbtqp"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_lgbtqp_round" >
<intent-filter>
@@ -329,7 +359,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_lgbtqp_f"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_lgbtqp_f_round" >
<intent-filter>
@@ -343,7 +373,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_lidl"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_lidl_round" >
<intent-filter>
@@ -357,7 +387,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_mkkp"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_mkkp_round" >
<intent-filter>
@@ -371,7 +401,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_nuke"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_nuke_round" >
<intent-filter>
@@ -385,7 +415,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_modern"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_modern_round" >
<intent-filter>
@@ -399,7 +429,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_o1g"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_o1g_round" >
<intent-filter>
@@ -413,7 +443,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_old"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_old_round" >
<intent-filter>
@@ -427,7 +457,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_paper"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_paper_round" >
<intent-filter>
@@ -441,7 +471,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_pear"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_pear_round" >
<intent-filter>
@@ -455,7 +485,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_pixel"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_pixel_round" >
<intent-filter>
@@ -469,7 +499,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_pixelized"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_pixelized_round" >
<intent-filter>
@@ -483,7 +513,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_pride"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_pride_round" >
<intent-filter>
@@ -497,7 +527,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_proto"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_proto_round" >
<intent-filter>
@@ -511,7 +541,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_refilc"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_refilc_round" >
<intent-filter>
@@ -525,7 +555,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_refulc"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_refulc_round" >
<intent-filter>
@@ -539,7 +569,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_repont"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_repont_round" >
<intent-filter>
@@ -553,7 +583,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_szivacs"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_szivacs_round" >
<intent-filter>
@@ -567,7 +597,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_tisza"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_tisza_round" >
<intent-filter>
@@ -581,7 +611,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_trans"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_trans_round" >
<intent-filter>
@@ -595,7 +625,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_trans_f"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_trans_f_round" >
<intent-filter>
@@ -609,7 +639,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_void_icon"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_void_icon_round" >
<intent-filter>
@@ -623,7 +653,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_xmas1"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_xmas1_round" >
<intent-filter>
@@ -637,7 +667,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_xmas2"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_xmas2_round" >
<intent-filter>
@@ -651,7 +681,7 @@
android:targetActivity=".MainActivity"
android:exported="true"
android:enabled="false"
android:icon="@mipmap/ic_xmas3"
android:icon="@mipmap/launcher_icon"
android:roundIcon="@mipmap/ic_xmas3_round" >
<intent-filter>
@@ -664,6 +694,7 @@
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="app.firka.naplo.ACTION_REFRESH_WIDGET" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
@@ -679,6 +710,13 @@
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />
<!-- Small status-bar icon for FCM notification-payload messages that
Android displays automatically (data-only wakeups instead go
through LocalNotificationService, which sets its own icon). -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_notification" />
</application>
<!-- Required to query activities that can process text, see:

View File

@@ -1,99 +1,5 @@
package app.firka.naplo
import android.annotation.SuppressLint
import android.app.Application
import android.os.Build
import android.util.Log
import org.brotli.dec.BrotliInputStream
import org.json.JSONObject
import java.io.File
import java.io.FileOutputStream
import java.security.MessageDigest
import java.util.zip.ZipFile
class AppMain : Application() {
private fun File.sha256(): String {
if (!exists()) return "0000000000000000000000000000000000000000000000000000000000000000"
val md = MessageDigest.getInstance("SHA-256")
val digest = md.digest(this.readBytes())
return digest.fold("") { str, it -> str + "%02x".format(it) }
}
@SuppressLint("UnsafeDynamicallyLoadedCode")
override fun onCreate() {
super.onCreate()
var useUncompressedLibs = false
val abi = Build.SUPPORTED_ABIS[0]
val apks = File(applicationInfo.nativeLibraryDir, "../..").absoluteFile
.listFiles()!!
.filter { file -> file.name.endsWith(".apk") }
.toList()
var nativesApkN: ZipFile? = null
for (apk in apks) {
if (nativesApkN != null) break
val zip = ZipFile(apk)
val entries = zip.entries()
while (entries.hasMoreElements()) {
val entry = entries.nextElement()
if (entry.name.endsWith("$abi/index.so")) {
zip.close()
nativesApkN = ZipFile(apk)
break
}
if (entry.name.endsWith("$abi/libflutter.so")) {
useUncompressedLibs = true
break
}
}
zip.close()
}
if (useUncompressedLibs) {
return;
}
if (nativesApkN == null) {
throw Exception("Can't find native libraries")
}
val nativesApk: ZipFile = nativesApkN
val compressedLibsIndex = nativesApk.getInputStream(
nativesApk.getEntry("lib/$abi/index.so")
)
val compressedLibs = JSONObject(compressedLibsIndex.readBytes().toString(Charsets.UTF_8))
for (so in compressedLibs.keys()) {
val soFile = File(cacheDir, so)
if (soFile.sha256() == compressedLibs.getString(so)) {
System.load(soFile.absolutePath)
return
}
Log.d("AppMain", "Decompressing: $so")
val brInput = nativesApk.getInputStream(
nativesApk.getEntry("lib/$abi/${so.replace(".so", "-br.so")}")
)
val soOutput = FileOutputStream(soFile)
val brIn = BrotliInputStream(brInput)
brIn.copyTo(soOutput)
brInput.close()
soOutput.close()
System.load(soFile.absolutePath)
}
}
}
class AppMain : Application() {}

View File

@@ -7,8 +7,9 @@ import org.json.JSONObject
fun JSONObject.getStringOrNull(key: String): String? {
return try {
if (has(key)) {
getString(key)
if (has(key) && !isNull(key)) {
val v = getString(key)
if (v == "null" || v.isBlank()) null else v
} else {
null
}

View File

@@ -1,19 +1,32 @@
package app.firka.naplo
import android.app.NotificationManager
import android.appwidget.AppWidgetManager
import android.content.ComponentName
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.util.Log
import androidx.glance.appwidget.updateAll
import app.firka.naplo.glance.TimetableWidget
import app.firka.naplo.glance.TimetableWidgetReceiver
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.GoogleApiAvailability
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import kotlin.system.exitProcess
class MainActivity : FlutterActivity() {
private val channel = "firka.app/main"
private val wearSyncChannel = "app.firka/wear_sync"
private val progressNotificationChannel = "app.firka/progress_notification"
private fun forceIconUpdate() {
try {
@@ -30,6 +43,118 @@ class MainActivity : FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, wearSyncChannel).setMethodCallHandler { call, result ->
when (call.method) {
"startWearSyncService" -> {
val args = call.arguments as? Map<*, *>
val cachePath = args?.get("cachePath") as? String
val appDirPath = args?.get("appDirPath") as? String
if (cachePath != null && appDirPath != null) {
val messenger = flutterEngine.dartExecutor.binaryMessenger
val ch = MethodChannel(messenger, wearSyncChannel)
ch.invokeMethod("getLocalizedString", "wearSyncNotificationTitle", object : MethodChannel.Result {
override fun success(titleResult: Any?) {
val title = titleResult as? String ?: "Syncing with watch"
ch.invokeMethod("getLocalizedString", "wearSyncNotificationText", object : MethodChannel.Result {
override fun success(textResult: Any?) {
val text = textResult as? String ?: ""
val intent = Intent(this@MainActivity, WearSyncForegroundService::class.java).apply {
action = WearSyncForegroundService.ACTION_START
putExtra(WearSyncForegroundService.EXTRA_CACHE_PATH, cachePath)
putExtra(WearSyncForegroundService.EXTRA_APP_DIR_PATH, appDirPath)
putExtra(WearSyncForegroundService.EXTRA_NOTIFICATION_TITLE, title)
putExtra(WearSyncForegroundService.EXTRA_NOTIFICATION_TEXT, text)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(intent)
} else {
startService(intent)
}
result.success(null)
}
override fun error(code: String, msg: String?, details: Any?) { result.success(null) }
override fun notImplemented() { result.success(null) }
})
}
override fun error(code: String, msg: String?, details: Any?) { result.error(code, msg, details) }
override fun notImplemented() { result.notImplemented() }
})
} else {
result.error("INVALID_ARGS", "cachePath and appDirPath required", null)
}
}
"stopWearSyncService" -> {
val intent = Intent(this, WearSyncForegroundService::class.java).apply {
action = WearSyncForegroundService.ACTION_STOP
}
startService(intent)
result.success(null)
}
else -> result.notImplemented()
}
}
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, progressNotificationChannel).setMethodCallHandler { call, result ->
when (call.method) {
"startProgressService" -> {
val intent = Intent(this, ProgressNotificationForegroundService::class.java).apply {
action = ProgressNotificationForegroundService.ACTION_START
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(intent)
} else {
startService(intent)
}
result.success(true)
}
"stopProgressService" -> {
val intent = Intent(this, ProgressNotificationForegroundService::class.java).apply {
action = ProgressNotificationForegroundService.ACTION_STOP
}
startService(intent)
result.success(true)
}
"isProgressServiceRunning" -> {
val nm = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
val isNotifActive = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
try {
nm.activeNotifications?.any { it.id == 4002 } ?: false
} catch (e: Exception) {
ProgressNotificationForegroundService.isRunning
}
} else {
ProgressNotificationForegroundService.isRunning
}
result.success(ProgressNotificationForegroundService.isRunning && isNotifActive)
}
"updateProgressStrings" -> {
@Suppress("UNCHECKED_CAST")
val strings = call.arguments as? Map<String, String>
if (strings != null) {
ProgressNotificationForegroundService.saveStrings(this, strings)
if (ProgressNotificationForegroundService.isRunning) {
val intent = Intent(this, ProgressNotificationForegroundService::class.java).apply {
action = ProgressNotificationForegroundService.ACTION_UPDATE
}
startService(intent)
}
result.success(true)
} else {
result.error("INVALID_ARGS", "strings map required", null)
}
}
"schedule6AmAlarm" -> {
ProgressAlarmReceiver.scheduleNext6AmAlarm(this)
result.success(true)
}
"cancel6AmAlarm" -> {
ProgressAlarmReceiver.cancel6AmAlarm(this)
result.success(true)
}
else -> result.notImplemented()
}
}
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, channel).setMethodCallHandler {
call, result ->
when (call.method) {
@@ -97,7 +222,31 @@ class MainActivity : FlutterActivity() {
} catch (e: Exception) {
e.printStackTrace()
}
result.success(true)
result.success(true)
}
"refreshTimetableWidget" -> {
CoroutineScope(SupervisorJob() + Dispatchers.Default).launch {
try {
val appContext = context.applicationContext
val intent = Intent(appContext, TimetableWidgetReceiver::class.java).apply {
action = TimetableWidgetReceiver.ACTION_REFRESH_WIDGET
}
appContext.sendBroadcast(intent)
TimetableWidget().updateAll(appContext)
result.success(true)
} catch (e: Exception) {
result.error("refresh_failed", e.message, null)
}
}
}
"isGmsAvailable" -> {
try {
val availability = GoogleApiAvailability.getInstance()
val resultCode = availability.isGooglePlayServicesAvailable(context)
result.success(resultCode == ConnectionResult.SUCCESS)
} catch (e: Exception) {
result.success(false)
}
}
else -> {
result.notImplemented()
@@ -108,6 +257,29 @@ class MainActivity : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
window.clearFlags(android.view.WindowManager.LayoutParams.FLAG_SECURE)
handleIntent(intent)
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
setIntent(intent)
handleIntent(intent)
}
private fun handleIntent(intent: Intent?) {
val action = intent?.getStringExtra("action")
if (action == "pin_widget") {
val appWidgetManager = AppWidgetManager.getInstance(this)
val myProvider = ComponentName(this, TimetableWidgetReceiver::class.java)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && appWidgetManager.isRequestPinAppWidgetSupported) {
appWidgetManager.requestPinAppWidget(myProvider, null, null)
}
} else if (action == "refresh_widget") {
val appContext = applicationContext
val refreshIntent = Intent(appContext, TimetableWidgetReceiver::class.java).apply {
this.action = TimetableWidgetReceiver.ACTION_REFRESH_WIDGET
}
appContext.sendBroadcast(refreshIntent)
}
}
}

View File

@@ -0,0 +1,97 @@
package app.firka.naplo
import android.app.AlarmManager
import android.app.PendingIntent
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Build
import android.util.Log
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.ZoneId
class ProgressAlarmReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent?) {
Log.d(TAG, "onReceive action: ${intent?.action}")
scheduleNext6AmAlarm(context)
val data = ProgressNotificationForegroundService.loadTodayTimetable(context)
if (data == null || data.lessons.isEmpty()) {
Log.d(TAG, "No timetable for today at 6 AM wakeup; skipping service start")
return
}
val sorted = data.lessons.sortedBy { it.start }
val lastLesson = sorted.last()
val now = LocalDateTime.now()
if (now.isBefore(lastLesson.end)) {
Log.d(TAG, "Starting ProgressNotificationForegroundService from 6 AM alarm")
val serviceIntent = Intent(context, ProgressNotificationForegroundService::class.java).apply {
action = ProgressNotificationForegroundService.ACTION_START
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(serviceIntent)
} else {
context.startService(serviceIntent)
}
}
}
companion object {
private const val TAG = "ProgressAlarmReceiver"
const val ACTION_PROGRESS_6AM_ALARM = "app.firka.naplo.ACTION_PROGRESS_6AM_ALARM"
const val ALARM_REQUEST_CODE = 400201
fun scheduleNext6AmAlarm(context: Context) {
val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as? AlarmManager ?: return
val intent = Intent(context, ProgressAlarmReceiver::class.java).apply {
action = ACTION_PROGRESS_6AM_ALARM
}
val pendingIntent = PendingIntent.getBroadcast(
context,
ALARM_REQUEST_CODE,
intent,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
val now = LocalDateTime.now()
var target = now.toLocalDate().atTime(6, 0)
if (!target.isAfter(now)) {
target = target.plusDays(1)
}
val epochMillis = target.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()
Log.d(TAG, "Scheduling next 6 AM alarm for $target ($epochMillis)")
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, epochMillis, pendingIntent)
} else {
alarmManager.setExact(AlarmManager.RTC_WAKEUP, epochMillis, pendingIntent)
}
} catch (e: SecurityException) {
Log.w(TAG, "SecurityException while scheduling exact 6 AM alarm, falling back to setWindow", e)
alarmManager.set(AlarmManager.RTC_WAKEUP, epochMillis, pendingIntent)
}
}
fun cancel6AmAlarm(context: Context) {
val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as? AlarmManager ?: return
val intent = Intent(context, ProgressAlarmReceiver::class.java).apply {
action = ACTION_PROGRESS_6AM_ALARM
}
val pendingIntent = PendingIntent.getBroadcast(
context,
ALARM_REQUEST_CODE,
intent,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
alarmManager.cancel(pendingIntent)
Log.d(TAG, "Cancelled 6 AM progress alarm")
}
}
}

View File

@@ -0,0 +1,649 @@
package app.firka.naplo
import android.app.AlarmManager
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.Service
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.pm.ServiceInfo
import android.graphics.drawable.Icon
import android.os.Build
import android.os.IBinder
import android.util.Log
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import app.firka.naplo.glance.WidgetLesson
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.json.JSONObject
import java.io.File
import java.time.Duration
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter
class ProgressNotificationForegroundService : Service() {
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate)
private var tickerJob: Job? = null
private var isForegroundStarted = false
private var transitionPendingIntent: PendingIntent? = null
private val timeReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
when (intent?.action) {
Intent.ACTION_TIME_TICK,
Intent.ACTION_SCREEN_ON,
Intent.ACTION_USER_PRESENT -> {
refreshAndPostNotification()
}
}
}
}
private val channelId = "firka_progress_notification_v3"
private val notificationId = 4002
private val hhmm = DateTimeFormatter.ofPattern("HH:mm")
private fun formatTemplate(template: String, vararg replacements: Pair<String, String>): String {
var res = template
for ((key, value) in replacements) {
res = res.replace("{$key}", value)
}
return res
}
override fun onCreate() {
super.onCreate()
isRunning = true
createNotificationChannel()
val filter = IntentFilter().apply {
addAction(Intent.ACTION_TIME_TICK)
addAction(Intent.ACTION_SCREEN_ON)
addAction(Intent.ACTION_USER_PRESENT)
}
ContextCompat.registerReceiver(
this,
timeReceiver,
filter,
ContextCompat.RECEIVER_NOT_EXPORTED
)
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
createNotificationChannel()
when (intent?.action) {
ACTION_START, ACTION_UPDATE -> {
isRunning = true
refreshAndPostNotification()
startTicker()
}
ACTION_STOP -> {
isRunning = false
stopForegroundService()
return START_NOT_STICKY
}
else -> {
isRunning = true
refreshAndPostNotification()
startTicker()
}
}
return START_STICKY
}
override fun onBind(intent: Intent?): IBinder? = null
override fun onDestroy() {
isRunning = false
cancelTransitionAlarm()
try {
unregisterReceiver(timeReceiver)
} catch (_: Exception) {}
tickerJob?.cancel()
scope.cancel()
super.onDestroy()
}
private fun startTicker() {
tickerJob?.cancel()
tickerJob = scope.launch {
while (isActive) {
val currentMillis = System.currentTimeMillis()
val millisIntoMinute = currentMillis % 60_000
// Target next :00 or :30 second boundary
val delayMillis = if (millisIntoMinute < 30_000) {
30_000 - millisIntoMinute
} else {
60_000 - millisIntoMinute
}.coerceIn(1_000, 30_000)
delay(delayMillis)
refreshAndPostNotification()
}
}
}
private fun refreshAndPostNotification() {
val widgetData = loadTodayTimetable(applicationContext)
if (widgetData == null || widgetData.lessons.isEmpty()) {
Log.d(TAG, "No lessons for today; stopping progress service")
stopForegroundService()
return
}
val lessons = widgetData.lessons.sortedBy { it.start }
val now = LocalDateTime.now()
val lastLesson = lessons.last()
// If today's last lesson has ended, stop notification & foreground service
if (now.isAfter(lastLesson.end) || now.isEqual(lastLesson.end)) {
Log.d(TAG, "Last lesson of the day ended (${lastLesson.end}); stopping progress service")
stopForegroundService()
return
}
val notification = buildProgressNotification(widgetData, now)
if (notification == null) {
stopForegroundService()
return
}
if (!isForegroundStarted) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(
notificationId,
notification,
ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE
)
} else {
@Suppress("DEPRECATION")
startForeground(notificationId, notification)
}
isForegroundStarted = true
}
val nm = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
nm.notify(notificationId, notification)
// Schedule exact alarm for next transition (lesson start/end or break end)
val firstLesson = lessons.first()
val targetTransitionTime: LocalDateTime? = when {
now.isBefore(firstLesson.start) -> firstLesson.start
else -> {
val currentLesson = lessons.find { !now.isBefore(it.start) && now.isBefore(it.end) }
if (currentLesson != null) {
currentLesson.end
} else {
val nextLesson = lessons.firstOrNull { it.start.isAfter(now) }
nextLesson?.start
}
}
}
if (targetTransitionTime != null) {
scheduleNextTransitionAlarm(targetTransitionTime)
}
}
private fun buildProgressNotification(data: TimetableProgressData, now: LocalDateTime): Notification? {
val strings = getStrings(this)
val lessons = data.lessons.sortedBy { it.start }
val firstLesson = lessons.first()
val lastLesson = lessons.last()
val pendingIntent = PendingIntent.getActivity(
this,
0,
packageManager.getLaunchIntentForPackage(packageName),
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
val accentColor = data.accentColor
val breakColor = data.breakColor
val remainingLessonsCount = lessons.count { !now.isAfter(it.end) }
val remainingSuffix = if (remainingLessonsCount == 1) {
strings["progress_notif_remaining_lessons_one"] ?: ""
} else {
val template = strings["progress_notif_remaining_lessons_other"] ?: ""
formatTemplate(template, "count" to remainingLessonsCount.toString())
}
if (now.isBefore(firstLesson.start)) {
val minutesLeft = minutesRemaining(now, firstLesson.start)
val firstLessonIconRes = resolveSubjectIcon(firstLesson)
val title = if (firstLesson.lessonNumber != null) {
val template = strings["progress_notif_lesson_title"] ?: ""
if (template.isNotEmpty()) {
formatTemplate(template, "number" to firstLesson.lessonNumber.toString(), "name" to firstLesson.name)
} else {
firstLesson.name
}
} else {
firstLesson.name
}
val room = firstLesson.roomName?.trim()
val roomSuffix = if (!room.isNullOrBlank() && room != "null") "\n$room" else ""
val subSuffix = if (!firstLesson.substituteTeacher.isNullOrBlank() && firstLesson.substituteTeacher != "null" && firstLesson.substituteTeacher != "-") {
strings["progress_notif_substitution"] ?: ""
} else ""
val timeRange = "${firstLesson.start.format(hhmm)}-${firstLesson.end.format(hhmm)}"
val templateCase1 = strings["progress_notif_case1_text"] ?: ""
val text = formatTemplate(
templateCase1,
"minutes" to minutesLeft.toString(),
"timeRange" to timeRange,
"room" to roomSuffix,
"substitution" to subSuffix,
"remaining" to remainingSuffix
)
val criticalTemplate = strings["progress_notif_critical_text"] ?: ""
val criticalText = formatTemplate(criticalTemplate, "minutes" to minutesLeft.toString())
val morningStart = firstLesson.start.toLocalDate().atTime(6, 0)
val baseStart = if (now.isBefore(morningStart)) now else morningStart
val totalMinutes = Duration.between(baseStart, firstLesson.start).toMinutes().coerceAtLeast(15)
val elapsed = Duration.between(baseStart, now).toMinutes().coerceIn(0, totalMinutes)
if (Build.VERSION.SDK_INT >= 36) {
val progressStyle = Notification.ProgressStyle()
.setProgress(elapsed.toInt())
.setProgressSegments(listOf(
Notification.ProgressStyle.Segment(totalMinutes.toInt()).setColor(accentColor)
))
.setProgressEndIcon(Icon.createWithResource(this, firstLessonIconRes))
.setProgressTrackerIcon(Icon.createWithResource(this, R.drawable.ic_subject_break))
val builder = Notification.Builder(this, channelId)
.setStyle(progressStyle)
.setContentTitle(title)
.setContentText(text)
.setSmallIcon(R.drawable.ic_notification)
.setLargeIcon(Icon.createWithResource(this, firstLessonIconRes))
.setContentIntent(pendingIntent)
.setOngoing(true)
.setOnlyAlertOnce(true)
.setRequestPromotedOngoing(true)
.setShortCriticalText(criticalText.take(7))
return builder.build()
} else {
return NotificationCompat.Builder(this, channelId)
.setContentTitle(title)
.setContentText(text)
.setSmallIcon(R.drawable.ic_notification)
.setContentIntent(pendingIntent)
.setProgress(totalMinutes.toInt(), elapsed.toInt(), false)
.setOngoing(true)
.setOnlyAlertOnce(true)
.build()
}
}
val currentLesson = lessons.find { !now.isBefore(it.start) && now.isBefore(it.end) }
val title: String
val text: String
val criticalText: String
val trackerIconRes: Int
val largeIconRes: Int
val endIconRes: Int
val itemDuration: Int
val itemElapsed: Int
val itemColor: Int
if (currentLesson != null) {
val lessonDuration = Duration.between(currentLesson.start, currentLesson.end).toMinutes().coerceAtLeast(1).toInt()
val elapsed = Duration.between(currentLesson.start, now).toMinutes().coerceIn(0, lessonDuration.toLong()).toInt()
val timeLeft = minutesRemaining(now, currentLesson.end)
itemDuration = lessonDuration
itemElapsed = elapsed
itemColor = accentColor
trackerIconRes = resolveSubjectIcon(currentLesson)
largeIconRes = trackerIconRes
endIconRes = R.drawable.ic_subject_break
val prefix = if (currentLesson.lessonNumber != null) {
val template = strings["progress_notif_lesson_title"] ?: ""
if (template.isNotEmpty()) {
formatTemplate(template, "number" to currentLesson.lessonNumber.toString(), "name" to currentLesson.name)
} else {
currentLesson.name
}
} else {
currentLesson.name
}
title = prefix
val room = currentLesson.roomName?.trim()
val roomSuffix = if (!room.isNullOrBlank() && room != "null") "\n$room" else ""
val subSuffix = if (!currentLesson.substituteTeacher.isNullOrBlank() && currentLesson.substituteTeacher != "null" && currentLesson.substituteTeacher != "-") {
strings["progress_notif_substitution"] ?: ""
} else ""
val timeRange = "${currentLesson.start.format(hhmm)}-${currentLesson.end.format(hhmm)}"
val templateLesson = strings["progress_notif_case2_lesson_text"] ?: ""
text = formatTemplate(
templateLesson,
"minutes" to timeLeft.toString(),
"timeRange" to timeRange,
"room" to roomSuffix,
"substitution" to subSuffix,
"remaining" to remainingSuffix
)
val criticalTemplate = strings["progress_notif_critical_text"] ?: ""
criticalText = formatTemplate(criticalTemplate, "minutes" to timeLeft.toString())
} else {
val previousLesson = lessons.lastOrNull { !now.isBefore(it.end) }
val nextLesson = lessons.firstOrNull { it.start.isAfter(now) }
val breakStart = previousLesson?.end ?: now
val breakEnd = nextLesson?.start ?: lastLesson.end
val breakDuration = Duration.between(breakStart, breakEnd).toMinutes().coerceAtLeast(1).toInt()
val elapsed = Duration.between(breakStart, now).toMinutes().coerceIn(0, breakDuration.toLong()).toInt()
val timeLeft = minutesRemaining(now, breakEnd)
itemDuration = breakDuration
itemElapsed = elapsed
itemColor = breakColor
trackerIconRes = R.drawable.ic_subject_break
largeIconRes = if (nextLesson != null) resolveSubjectIcon(nextLesson) else trackerIconRes
endIconRes = if (nextLesson != null) resolveSubjectIcon(nextLesson) else trackerIconRes
title = strings["progress_notif_case2_break_title"] ?: ""
val templateBreak = strings["progress_notif_case2_break_text"] ?: ""
text = formatTemplate(
templateBreak,
"minutes" to timeLeft.toString(),
"remaining" to remainingSuffix
)
val criticalTemplate = strings["progress_notif_critical_text"] ?: ""
criticalText = formatTemplate(criticalTemplate, "minutes" to timeLeft.toString())
}
if (Build.VERSION.SDK_INT >= 36) {
val progressStyle = Notification.ProgressStyle()
.setProgress(itemElapsed)
.setProgressSegments(listOf(
Notification.ProgressStyle.Segment(itemDuration).setColor(itemColor)
))
.setProgressTrackerIcon(Icon.createWithResource(this, trackerIconRes))
.setProgressEndIcon(Icon.createWithResource(this, endIconRes))
val builder = Notification.Builder(this, channelId)
.setStyle(progressStyle)
.setContentTitle(title)
.setContentText(text)
.setSmallIcon(R.drawable.ic_notification)
.setLargeIcon(Icon.createWithResource(this, largeIconRes))
.setContentIntent(pendingIntent)
.setOngoing(true)
.setOnlyAlertOnce(true)
.setRequestPromotedOngoing(true)
.setShortCriticalText(criticalText.take(7))
return builder.build()
} else {
return NotificationCompat.Builder(this, channelId)
.setContentTitle(title)
.setContentText(text)
.setSmallIcon(R.drawable.ic_notification)
.setContentIntent(pendingIntent)
.setProgress(itemDuration, itemElapsed, false)
.setOngoing(true)
.setOnlyAlertOnce(true)
.build()
}
}
private fun resolveSubjectIcon(lesson: WidgetLesson): Int {
if (!lesson.icon.isNullOrEmpty()) {
val res = getSubjectIconRes(lesson.icon)
if (res != R.drawable.ic_notification) return res
}
val name = lesson.name.lowercase()
return when {
Regex("mate(k|matika)").containsMatchIn(name) -> R.drawable.ic_subject_mathematics
Regex("magyar nyelv|nyelvtan").containsMatchIn(name) -> R.drawable.ic_subject_grammar
Regex("irodalom").containsMatchIn(name) -> R.drawable.ic_subject_literature
Regex("tor(i|tenelem)").containsMatchIn(name) -> R.drawable.ic_subject_history
Regex("foldrajz").containsMatchIn(name) -> R.drawable.ic_subject_geography
Regex("rajz|muvtori|muveszet|vizualis").containsMatchIn(name) -> R.drawable.ic_subject_art
Regex("fizika").containsMatchIn(name) -> R.drawable.ic_subject_physics
Regex("^enek|zene|szolfezs|zongora|korus").containsMatchIn(name) -> R.drawable.ic_subject_music
Regex("^tes(i|tneveles)|sport|edzeselmelet").containsMatchIn(name) -> R.drawable.ic_subject_pe
Regex("kemia").containsMatchIn(name) -> R.drawable.ic_subject_chemistry
Regex("biologia").containsMatchIn(name) -> R.drawable.ic_subject_biology
Regex("angol|nemet|francia|olasz|orosz|spanyol|latin|kinai|idegen|nyelv").containsMatchIn(name) -> R.drawable.ic_subject_language
Regex("informatika|szoftver|digitalis").containsMatchIn(name) -> R.drawable.ic_subject_it
Regex("prog|alkalmazas").containsMatchIn(name) -> R.drawable.ic_subject_code
Regex("halozat").containsMatchIn(name) -> R.drawable.ic_subject_networking
Regex("filozofia").containsMatchIn(name) -> R.drawable.ic_subject_philosophy
Regex("osztaly(fonoki|kozosseg)").containsMatchIn(name) -> R.drawable.ic_subject_ofo
Regex("penzugy|gazdasag").containsMatchIn(name) -> R.drawable.ic_subject_economics
Regex("kornyezet|termeszet").containsMatchIn(name) -> R.drawable.ic_subject_env
Regex("(hit|erkolcs)tan|vallas|etika").containsMatchIn(name) -> R.drawable.ic_subject_religion
Regex("adatbazis").containsMatchIn(name) -> R.drawable.ic_subject_database
else -> R.drawable.ic_subject_unknown
}
}
private fun getSubjectIconRes(iconName: String?): Int {
if (iconName == null) return R.drawable.ic_subject_unknown
return when (iconName.lowercase()) {
"mathematics" -> R.drawable.ic_subject_mathematics
"grammar" -> R.drawable.ic_subject_grammar
"literature" -> R.drawable.ic_subject_literature
"history" -> R.drawable.ic_subject_history
"geography" -> R.drawable.ic_subject_geography
"art" -> R.drawable.ic_subject_art
"physics" -> R.drawable.ic_subject_physics
"music" -> R.drawable.ic_subject_music
"pe" -> R.drawable.ic_subject_pe
"chemistry" -> R.drawable.ic_subject_chemistry
"biology" -> R.drawable.ic_subject_biology
"env" -> R.drawable.ic_subject_env
"religion" -> R.drawable.ic_subject_religion
"economics" -> R.drawable.ic_subject_economics
"it" -> R.drawable.ic_subject_it
"code" -> R.drawable.ic_subject_code
"networking" -> R.drawable.ic_subject_networking
"theatre" -> R.drawable.ic_subject_theatre
"film" -> R.drawable.ic_subject_film
"electricalengineering" -> R.drawable.ic_subject_electricalengineering
"mechanicalengineering" -> R.drawable.ic_subject_mechanicalengineering
"technika" -> R.drawable.ic_subject_technika
"dance" -> R.drawable.ic_subject_dance
"philosophy" -> R.drawable.ic_subject_philosophy
"erettsegi" -> R.drawable.ic_subject_erettsegi
"ofo" -> R.drawable.ic_subject_ofo
"diligence" -> R.drawable.ic_subject_diligence
"attitude" -> R.drawable.ic_subject_attitude
"language" -> R.drawable.ic_subject_language
"linux" -> R.drawable.ic_subject_linux
"database" -> R.drawable.ic_subject_database
"applications" -> R.drawable.ic_subject_applications
"project" -> R.drawable.ic_subject_project
"break" -> R.drawable.ic_subject_break
else -> R.drawable.ic_subject_unknown
}
}
private fun createNotificationChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val nm = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
try {
nm.deleteNotificationChannel("firka_progress_notification")
nm.deleteNotificationChannel("firka_progress_notification_v2")
} catch (_: Exception) {}
val strings = getStrings(this)
val channelName = strings["progress_notif_channel_name"]?.takeIf { it.isNotBlank() } ?: "Firka"
val channelDesc = strings["progress_notif_channel_desc"] ?: ""
val channel = NotificationChannel(
channelId,
channelName,
NotificationManager.IMPORTANCE_DEFAULT
).apply {
setShowBadge(false)
setSound(null, null)
enableVibration(false)
description = channelDesc
}
nm.createNotificationChannel(channel)
}
}
private fun scheduleNextTransitionAlarm(targetTime: LocalDateTime) {
val alarmManager = getSystemService(ALARM_SERVICE) as? AlarmManager ?: return
cancelTransitionAlarm()
val intent = Intent(this, ProgressNotificationForegroundService::class.java).apply {
action = ACTION_UPDATE
}
val pendingIntent = PendingIntent.getService(
this,
1001,
intent,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
transitionPendingIntent = pendingIntent
val epochMillis = targetTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()
if (epochMillis > System.currentTimeMillis()) {
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, epochMillis, pendingIntent)
} else {
alarmManager.setExact(AlarmManager.RTC_WAKEUP, epochMillis, pendingIntent)
}
} catch (e: SecurityException) {
Log.w(TAG, "Cannot schedule transition alarm", e)
}
}
}
private fun cancelTransitionAlarm() {
val alarmManager = getSystemService(ALARM_SERVICE) as? AlarmManager ?: return
transitionPendingIntent?.let {
alarmManager.cancel(it)
transitionPendingIntent = null
}
}
private fun stopForegroundService() {
isRunning = false
cancelTransitionAlarm()
tickerJob?.cancel()
isForegroundStarted = false
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
stopForeground(STOP_FOREGROUND_REMOVE)
} else {
@Suppress("DEPRECATION")
stopForeground(true)
}
stopSelf()
}
private fun minutesRemaining(from: LocalDateTime, to: LocalDateTime): Int {
val seconds = Duration.between(from, to).seconds
return if (seconds <= 0) 1 else ((seconds + 59) / 60).toInt().coerceAtLeast(1)
}
companion object {
private const val TAG = "ProgressNotifService"
const val ACTION_START = "app.firka.naplo.ProgressNotificationForegroundService.START"
const val ACTION_UPDATE = "app.firka.naplo.ProgressNotificationForegroundService.UPDATE"
const val ACTION_STOP = "app.firka.naplo.ProgressNotificationForegroundService.STOP"
private const val PREFS_STRINGS = "firka_progress_strings"
@Volatile
var isRunning: Boolean = false
fun saveStrings(context: Context, strings: Map<String, String>) {
val prefs = context.applicationContext.getSharedPreferences(PREFS_STRINGS, Context.MODE_PRIVATE)
val editor = prefs.edit()
for ((k, v) in strings) {
editor.putString(k, v)
}
editor.apply()
}
fun getStrings(context: Context): Map<String, String> {
val prefs = context.applicationContext.getSharedPreferences(PREFS_STRINGS, Context.MODE_PRIVATE)
val all = prefs.all
val result = mutableMapOf<String, String>()
for ((k, v) in all) {
if (v is String) {
result[k] = v
}
}
return result
}
fun loadTodayTimetable(context: Context): TimetableProgressData? {
return try {
val appFlutter = File(context.applicationContext.dataDir, "app_flutter")
val widgetStateFile = File(appFlutter, "widget_state.json")
if (!widgetStateFile.exists()) return null
val text = widgetStateFile.readText(Charsets.UTF_8)
val json = JSONObject(text)
val tt = json.getJSONArray("timetable")
val allLessons = mutableListOf<WidgetLesson>()
for (i in 0 until tt.length()) {
allLessons.add(WidgetLesson(tt.getJSONObject(i)))
}
val today = LocalDate.now()
var todayLessons = allLessons.filter { it.start.toLocalDate() == today }
if (todayLessons.isEmpty()) {
val displayDateStr = json.optString("displayDate", "")
if (displayDateStr.isNotEmpty()) {
try {
val displayDate = LocalDate.parse(displayDateStr)
todayLessons = allLessons.filter { it.start.toLocalDate() == displayDate }
} catch (_: Exception) {}
}
}
val colorsObj = json.optJSONObject("colors")
val accent = colorsObj?.optInt("accent", 0xFF4C662B.toInt()) ?: 0xFF4C662B.toInt()
val secondary = colorsObj?.optInt("secondary", 0xFF586249.toInt()) ?: 0xFF586249.toInt()
val language = json.optString("language", null)
TimetableProgressData(todayLessons, accent, secondary, language)
} catch (e: Exception) {
Log.e(TAG, "Error reading timetable data", e)
null
}
}
}
}
data class TimetableProgressData(
val lessons: List<WidgetLesson>,
val accentColor: Int,
val breakColor: Int,
val language: String? = null,
)

View File

@@ -0,0 +1,221 @@
package app.firka.naplo
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.Service
import android.content.Intent
import android.os.Build
import android.os.IBinder
import android.util.Log
import androidx.core.app.NotificationCompat
import java.io.ByteArrayInputStream
import java.io.ObjectInputStream
import com.google.android.gms.wearable.MessageClient
import com.google.android.gms.wearable.MessageEvent
import com.google.android.gms.wearable.Wearable
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.engine.dart.DartExecutor
import io.flutter.embedding.engine.loader.FlutterLoader
import io.flutter.plugin.common.MethodChannel
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import kotlinx.coroutines.withTimeout
import kotlinx.coroutines.delay
/**
* Foreground service that keeps the app able to respond to Wear OS sync requests.
* When the watch sends request_sync, starts a Dart background isolate to fetch data,
* then reads the cache file and sends sync_data to the watch.
*/
class WearSyncForegroundService : Service(), MessageClient.OnMessageReceivedListener {
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate)
private var cachePath: String? = null
private var appDirPath: String? = null
private val channelId = "firka_wear_sync"
private val notificationId = 4001
private var notificationTitle: String = "Syncing with watch"
private var notificationText: String = ""
override fun onCreate() {
super.onCreate()
createNotificationChannel()
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
when (intent?.action) {
ACTION_START -> {
cachePath = intent.getStringExtra(EXTRA_CACHE_PATH)
appDirPath = intent.getStringExtra(EXTRA_APP_DIR_PATH)
notificationTitle = intent.getStringExtra(EXTRA_NOTIFICATION_TITLE) ?: "Syncing with watch"
notificationText = intent.getStringExtra(EXTRA_NOTIFICATION_TEXT) ?: ""
startForegroundWithNotification()
Wearable.getMessageClient(this@WearSyncForegroundService)
.addListener(this@WearSyncForegroundService)
}
ACTION_STOP -> {
stopForegroundService()
return START_NOT_STICKY
}
}
return START_STICKY
}
override fun onBind(intent: Intent?): IBinder? = null
override fun onDestroy() {
try {
Wearable.getMessageClient(this@WearSyncForegroundService)
.removeListener(this@WearSyncForegroundService)
.addOnCompleteListener { }
} catch (_: Exception) { }
scope.cancel()
super.onDestroy()
}
override fun onMessageReceived(messageEvent: MessageEvent) {
if (messageEvent.path != PATH_WATCH_CONNECTIVITY ||
!isRequestSyncPayload(messageEvent.data)
) return
val cPath = cachePath
val aPath = appDirPath
if (cPath == null || aPath == null) return
scope.launch {
runSyncInBackground(cPath, aPath)
}
}
/**
* watch_connectivity plugin sends with path "watch_connectivity" and serializes the message
* map with Java ObjectOutputStream. Parse payload and check for id == "request_sync".
*/
private fun isRequestSyncPayload(data: ByteArray?): Boolean {
if (data == null || data.isEmpty()) return false
return try {
ObjectInputStream(ByteArrayInputStream(data)).use { ois ->
val map = ois.readObject()
if (map is Map<*, *>) map["id"] == "request_sync" else false
}
} catch (_: Exception) {
false
}
}
private fun startForegroundWithNotification() {
val notification = buildNotification()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(notificationId, notification, android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)
} else {
@Suppress("DEPRECATION")
startForeground(notificationId, notification)
}
}
private fun buildNotification(): Notification {
val pendingIntent = PendingIntent.getActivity(
this,
0,
packageManager.getLaunchIntentForPackage(packageName),
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
return NotificationCompat.Builder(this, channelId)
.setContentTitle(notificationTitle)
.setContentText(notificationText)
.setSmallIcon(R.drawable.ic_notification)
.setContentIntent(pendingIntent)
.setOngoing(true)
.build()
}
private fun createNotificationChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel(
channelId,
"Wear sync",
NotificationManager.IMPORTANCE_LOW
).apply { setShowBadge(false) }
(getSystemService(NOTIFICATION_SERVICE) as NotificationManager)
.createNotificationChannel(channel)
}
}
private fun stopForegroundService() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
stopForeground(STOP_FOREGROUND_REMOVE)
} else {
@Suppress("DEPRECATION")
stopForeground(true)
}
stopSelf()
}
private suspend fun runSyncInBackground(cPath: String, aPath: String) = withContext(Dispatchers.Default) {
val flutterLoader = FlutterLoader()
if (!flutterLoader.initialized()) {
withContext(Dispatchers.Main) {
flutterLoader.startInitialization(applicationContext)
flutterLoader.ensureInitializationComplete(applicationContext, null)
}
}
val (engine, bgChannel) = withContext(Dispatchers.Main) {
val eng = FlutterEngine(applicationContext)
val entrypoint = DartExecutor.DartEntrypoint(
flutterLoader.findAppBundlePath(),
"package:firka/services/wear_sync_background.dart",
"wearSyncBackgroundEntrypoint"
)
eng.dartExecutor.executeDartEntrypoint(entrypoint)
val ch = MethodChannel(eng.dartExecutor.binaryMessenger, "app.firka/wear_sync_background")
Pair(eng, ch)
}
val completer = CompletableDeferred<Unit>()
delay(500)
withContext(Dispatchers.Main) {
bgChannel.invokeMethod("request_sync", mapOf(
"cachePath" to cPath,
"appDirPath" to aPath
), object : MethodChannel.Result {
override fun success(result: Any?) {
completer.complete(Unit)
}
override fun error(errorCode: String, errorMessage: String?, errorDetails: Any?) {
Log.e(TAG, "request_sync error: $errorCode $errorMessage")
completer.complete(Unit)
}
override fun notImplemented() {
completer.complete(Unit)
}
})
}
try {
withTimeout(30_000) {
completer.await()
}
} catch (_: kotlinx.coroutines.TimeoutCancellationException) {
Log.w(TAG, "Wear sync isolate timed out")
}
withContext(Dispatchers.Main) {
engine.destroy()
}
}
companion object {
private const val TAG = "WearSyncService"
const val ACTION_START = "app.firka.naplo.WearSyncForegroundService.START"
const val ACTION_STOP = "app.firka.naplo.WearSyncForegroundService.STOP"
const val EXTRA_CACHE_PATH = "cachePath"
const val EXTRA_APP_DIR_PATH = "appDirPath"
const val EXTRA_NOTIFICATION_TITLE = "notificationTitle"
const val EXTRA_NOTIFICATION_TEXT = "notificationText"
private const val PATH_WATCH_CONNECTIVITY = "watch_connectivity"
}
}

View File

@@ -16,9 +16,10 @@ import androidx.glance.layout.padding
import androidx.glance.layout.width
import androidx.glance.text.FontWeight
import androidx.glance.text.Text
import androidx.glance.text.TextAlign
import androidx.glance.text.TextStyle
import app.firka.naplo.model.Colors
import app.firka.naplo.model.Lesson
import app.firka.naplo.glance.WidgetLesson
import java.time.format.DateTimeFormatterBuilder
val hhmm = DateTimeFormatterBuilder()
@@ -26,8 +27,13 @@ val hhmm = DateTimeFormatterBuilder()
.toFormatter()
@Composable
fun LessonCard(lesson: Lesson, colors: Colors,
modifier: GlanceModifier = GlanceModifier) {
fun LessonCard(
lesson: WidgetLesson,
colors: Colors,
modifier: GlanceModifier = GlanceModifier,
roomBadgeWidthDp: Float = 48f,
subjectColumnWidthDp: Float = 226f,
) {
Box(modifier =
modifier
.fillMaxWidth()
@@ -38,17 +44,33 @@ fun LessonCard(lesson: Lesson, colors: Colors,
var bgColor = colors.a15p
var fgColor = colors.textSecondary
if (lesson.substituteTeacher == null) {
if (lesson.substituteTeacher != null) {
bgColor = colors.warning15p
fgColor = colors.warningText
}
Box(modifier = GlanceModifier.padding(12.dp)) {
Row {
Row(modifier = GlanceModifier.width(226.dp), verticalAlignment = Alignment.CenterVertically) {
Row(modifier = GlanceModifier.fillMaxWidth()) {
val badgeStyle = TextStyle(
color = ColorProvider(colors.textSecondary, colors.textSecondary),
fontSize = 14.sp,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Center
)
val badgePadding = GlanceModifier.padding(8.dp, 4.dp)
val lessonNumberBadgeModifier = GlanceModifier.cornerRadius(16.dp).width(24.dp)
val roomBadgeModifier = GlanceModifier.cornerRadius(16.dp).width(roomBadgeWidthDp.dp)
Row(
modifier = GlanceModifier.width(subjectColumnWidthDp.dp),
verticalAlignment = Alignment.CenterVertically,
) {
if (lesson.lessonNumber != null) {
Box(modifier = GlanceModifier.cornerRadius(16.dp).background(bgColor)) {
Box(
modifier = lessonNumberBadgeModifier.background(bgColor),
contentAlignment = Alignment.Center,
) {
Text(
lesson.lessonNumber.toString(),
style = TextStyle(
@@ -56,24 +78,24 @@ fun LessonCard(lesson: Lesson, colors: Colors,
fontSize = 14.sp,
fontWeight = FontWeight.Bold
),
modifier = GlanceModifier.padding(8.dp, 4.dp),
modifier = GlanceModifier.padding(4.dp, 4.dp),
)
}
Spacer(modifier = GlanceModifier.width(4.dp))
}
// TODO: Add subject icons
Text(
lesson.name,
text = lesson.name,
style = TextStyle(
color = ColorProvider(colors.textPrimary, colors.textPrimary),
fontSize = 14.sp,
fontWeight = FontWeight.Bold
),
maxLines = 1,
modifier = GlanceModifier.fillMaxWidth(),
)
}
// Spacer(modifier = GlanceModifier.width(10.dp))
Row(verticalAlignment = Alignment.CenterVertically) {
Text(
lesson.start.format(hhmm),
@@ -84,24 +106,18 @@ fun LessonCard(lesson: Lesson, colors: Colors,
),
)
Spacer(modifier = GlanceModifier.width(8.dp))
Box(modifier = GlanceModifier.cornerRadius(16.dp).background(colors.a15p)) {
var roomName = "N/A";
if (lesson.roomName != null) {
roomName = lesson.roomName!!;
}
if (roomName.length < 2) {
roomName = " $roomName"
}
val roomName = lesson.roomName ?: "N/A"
Box(
modifier = roomBadgeModifier.background(colors.a15p),
contentAlignment = Alignment.Center,
) {
Text(
roomName,
style = TextStyle(
color = ColorProvider(colors.textSecondary, colors.textSecondary),
fontSize = 14.sp,
fontWeight = FontWeight.Bold
),
modifier = GlanceModifier.padding(8.dp, 4.dp),
text = roomName,
style = badgeStyle,
maxLines = 1,
modifier = GlanceModifier
.fillMaxWidth()
.padding(4.dp, 4.dp),
)
}
}

View File

@@ -9,8 +9,10 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.glance.GlanceId
import androidx.glance.GlanceModifier
import androidx.glance.LocalSize
import androidx.glance.appwidget.GlanceAppWidget
import androidx.glance.appwidget.provideContent
import androidx.glance.appwidget.SizeMode
import androidx.glance.background
import androidx.glance.color.ColorProvider
import androidx.glance.currentState
@@ -26,7 +28,9 @@ import androidx.glance.text.FontWeight
import androidx.glance.text.Text
import androidx.glance.text.TextStyle
import app.firka.naplo.model.Colors
import app.firka.naplo.model.Lesson
import app.firka.naplo.glance.WidgetLesson
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.json.JSONObject
import java.io.File
import java.time.LocalDate
@@ -37,20 +41,55 @@ class TimetableWidget : GlanceAppWidget() {
override val stateDefinition: GlanceStateDefinition<*>?
get() = HomeWidgetGlanceStateDefinition()
override val sizeMode: SizeMode
get() = SizeMode.Exact
override suspend fun provideGlance(context: Context, id: GlanceId) {
val data = withContext(Dispatchers.IO) {
loadWidgetData(context)
}
provideContent {
GlanceContent(context, currentState())
GlanceContent(context, currentState(), data)
}
}
private fun loadWidgetData(context: Context): WidgetData? {
try {
val appFlutter = File(context.applicationContext.dataDir, "app_flutter")
val widgetStateFile = File(appFlutter, "widget_state.json")
if (!widgetStateFile.exists()) return null
val text = widgetStateFile.readText(Charsets.UTF_8)
val widgetState = JSONObject(text)
val colors = Colors(widgetState)
val tt = widgetState.getJSONArray("timetable")
val lessons = mutableListOf<WidgetLesson>()
for (i in 0..<tt.length()) {
lessons.add(WidgetLesson(tt.getJSONObject(i)))
}
val displayDateStr = widgetState.optString("displayDate", "")
val targetDate = if (displayDateStr.isNotEmpty()) {
try {
LocalDate.parse(displayDateStr)
} catch (_: Exception) {
LocalDate.now()
}
} else {
LocalDate.now()
}
val filtered = lessons.filter { it.start.toLocalDate() == targetDate }
val headerText = if (displayDateStr.isNotEmpty()) displayDateStr else "Mai órarend"
return WidgetData(colors, headerText, filtered)
} catch (e: Throwable) {
android.util.Log.e("TimetableWidget", "Error in loadWidgetData", e)
return null
}
}
@Composable
private fun GlanceContent(context: Context, currentState: HomeWidgetGlanceState) {
val appFlutter = File(context.applicationContext.dataDir, "app_flutter")
val widgetStateFile = File(appFlutter, "widget_state.json")
if (!widgetStateFile.exists()) {
Box(modifier =
GlanceModifier
private fun GlanceContent(context: Context, currentState: HomeWidgetGlanceState, data: WidgetData?) {
if (data == null) {
Box(
modifier = GlanceModifier
.background(Color(0xFFFAFFF0))
.padding(16.dp)
.fillMaxSize(),
@@ -65,47 +104,74 @@ class TimetableWidget : GlanceAppWidget() {
)
)
}
return
}
val widgetState = JSONObject(widgetStateFile.readText(Charsets.UTF_8))
val colors = Colors(widgetState)
val tt = widgetState.getJSONArray("timetable")
var lessons = mutableListOf<Lesson>()
for (i in 0..<tt.length()) {
lessons.add(Lesson(tt.getJSONObject(i)))
val size = LocalSize.current
val lessonRowHeightDp = 52f
val scale = lessonRowHeightDp / 52f
val headerHeightDp = 20f * scale
val verticalPaddingDp = 32f * scale
val spacerDp = 4f * scale
val paddingDp = 16f * scale
val availableHeightDp = size.height.value - verticalPaddingDp - headerHeightDp - spacerDp
val maxVisibleLessons = (availableHeightDp / lessonRowHeightDp).toInt().coerceAtLeast(0)
val maxLessons = (maxVisibleLessons.coerceAtMost(16) / 2 * 2).coerceAtLeast(1)
val displayLessons = data.lessons.take(maxLessons)
val lessonChunks = displayLessons.chunked(2)
val showDate = maxLessons > 1
val roomBadgeWidthDp = 48f
val minWidthForTimeAndChipDp = 8f + 40f + roomBadgeWidthDp
val subjectColumnWidthDp = (size.width.value - 2 * paddingDp - 32f - minWidthForTimeAndChipDp)
.coerceIn(80f, 226f)
val dateSectionHeight = if (showDate) headerHeightDp + spacerDp else 0f
val lessonListHeight = when (val n = displayLessons.size) {
0 -> 0f
else -> n * lessonRowHeightDp + (n - 1) * spacerDp
}
val remainingHeight = (size.height.value - 2 * paddingDp - dateSectionHeight - lessonListHeight).coerceAtLeast(0f)
val verticalPaddingAroundLessons = remainingHeight / 2f
val now = LocalDate.now()
val start = LocalDateTime.of(now.year, now.month, now.dayOfMonth, 0, 0)
val end = start.plusHours(23)
lessons = lessons.filter { lesson -> lesson.start.isAfter(start) && lesson.end.isBefore(end) }.toMutableList()
Box(modifier =
GlanceModifier
.background(colors.background)
.padding(16.dp)
Box(
modifier = GlanceModifier
.background(data.colors.background)
.padding(paddingDp.dp)
.fillMaxSize()
) {
Column {
Text(
"Mai órarend",
style = TextStyle(
color = ColorProvider(colors.textSecondary, colors.textSecondary),
fontSize = 12.sp,
fontWeight = FontWeight.Medium
if (showDate) {
Text(
data.headerText,
style = TextStyle(
color = ColorProvider(data.colors.textSecondary, data.colors.textSecondary),
fontSize = 12.sp,
fontWeight = FontWeight.Medium
)
)
)
Spacer(modifier = GlanceModifier.height(4.dp))
for (lesson in lessons) {
LessonCard(lesson, colors)
Spacer(modifier = GlanceModifier.height(4.dp))
Spacer(modifier = GlanceModifier.height(spacerDp.dp))
}
Spacer(modifier = GlanceModifier.height(verticalPaddingAroundLessons.dp))
for (chunk in lessonChunks) {
Column {
for (lesson in chunk) {
LessonCard(
lesson,
data.colors,
roomBadgeWidthDp = roomBadgeWidthDp,
subjectColumnWidthDp = subjectColumnWidthDp,
)
Spacer(modifier = GlanceModifier.height(spacerDp.dp))
}
}
}
Spacer(modifier = GlanceModifier.height(verticalPaddingAroundLessons.dp))
}
}
}
}
}
private data class WidgetData(
val colors: Colors,
val headerText: String,
val lessons: List<WidgetLesson>,
)

View File

@@ -1,7 +1,62 @@
package app.firka.naplo.glance
import android.appwidget.AppWidgetManager
import android.content.Context
import android.os.Bundle
import HomeWidgetGlanceWidgetReceiver
import androidx.glance.appwidget.GlanceAppWidgetManager
import kotlinx.coroutines.runBlocking
import android.content.Intent
import android.util.Log
import androidx.glance.appwidget.updateAll
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
class TimetableWidgetReceiver : HomeWidgetGlanceWidgetReceiver<TimetableWidget>() {
override val glanceAppWidget = TimetableWidget()
override fun onReceive(context: Context, intent: Intent) {
super.onReceive(context, intent)
val action = intent.action
if (action == ACTION_REFRESH_WIDGET ||
action == AppWidgetManager.ACTION_APPWIDGET_UPDATE ||
action == Intent.ACTION_BOOT_COMPLETED ||
action == Intent.ACTION_MY_PACKAGE_REPLACED) {
val pendingResult = goAsync()
CoroutineScope(SupervisorJob() + Dispatchers.Default).launch {
try {
glanceAppWidget.updateAll(context)
} catch (e: Exception) {
Log.e("TimetableWidget", "Failed glanceAppWidget.updateAll from onReceive", e)
} finally {
pendingResult?.finish()
}
}
}
}
override fun onAppWidgetOptionsChanged(
context: Context,
appWidgetManager: AppWidgetManager,
appWidgetId: Int,
newOptions: Bundle,
) {
super.onAppWidgetOptionsChanged(context, appWidgetManager, appWidgetId, newOptions)
val pendingResult = goAsync()
CoroutineScope(SupervisorJob() + Dispatchers.Default).launch {
try {
val glanceId = GlanceAppWidgetManager(context).getGlanceIdBy(appWidgetId)
glanceAppWidget.update(context, glanceId)
} finally {
pendingResult?.finish()
}
}
}
companion object {
const val ACTION_REFRESH_WIDGET = "app.firka.naplo.ACTION_REFRESH_WIDGET"
}
}

View File

@@ -0,0 +1,49 @@
package app.firka.naplo.glance
import app.firka.naplo.getIntOrNull
import app.firka.naplo.getStringOrNull
import org.json.JSONObject
import java.time.LocalDateTime
import java.time.OffsetDateTime
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeFormatterBuilder
import java.time.temporal.ChronoField
class WidgetLesson(data: JSONObject) {
companion object {
private val formatter: DateTimeFormatter = DateTimeFormatterBuilder()
.appendPattern("yyyy-MM-dd'T'HH:mm:ss")
.optionalStart()
.appendFraction(ChronoField.NANO_OF_SECOND, 1, 9, true)
.optionalEnd()
.optionalStart()
.appendLiteral('Z')
.optionalEnd()
.optionalStart()
.appendOffset("+HH:MM", "+00:00")
.optionalEnd()
.toFormatter()
fun parseDateTime(raw: String): LocalDateTime {
return try {
LocalDateTime.parse(raw, formatter)
} catch (_: Exception) {
try {
OffsetDateTime.parse(raw).toLocalDateTime()
} catch (_: Exception) {
LocalDateTime.parse(raw)
}
}
}
}
val name: String = data.optString("name", data.optString("Nev", ""))
val start: LocalDateTime = parseDateTime(data.optString("start", data.optString("KezdetIdopont", "")))
val end: LocalDateTime = parseDateTime(data.optString("end", data.optString("VegIdopont", "")))
val lessonNumber: Int? = data.getIntOrNull("dailyNth") ?: data.getIntOrNull("Oraszam")
val roomName: String? = (data.getStringOrNull("roomName") ?: data.getStringOrNull("TeremNeve"))
?.takeIf { it != "null" && it != "-" && it.isNotBlank() }
val substituteTeacher: String? = (data.getStringOrNull("substituteTeacher") ?: data.getStringOrNull("HelyettesTanarNeve"))
?.takeIf { it != "null" && it != "-" && it.isNotBlank() }
val icon: String? = data.getStringOrNull("icon")
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

View File

@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
<item>
<bitmap android:gravity="center" android:src="@drawable/splash"/>
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M19 4H5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"
android:fillColor="#FFFFFFFF" />
<path
android:pathData="M12 16h7a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h7zm0 0v4m0 0h4m-4 0H8"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M15.586 3a2 2 0 0 1 2.828 0L21 5.586a2 2 0 0 1 0 2.828L19.414 10 14 4.586 15.586 3zm-3 3-9 9A2 2 0 0 0 3 16.414V19a2 2 0 0 0 2 2h2.586A2 2 0 0 0 9 20.414l9-9L12.586 6z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M 7.0,8.0 a 5.0,5.0 0 1,0 10.0,0 a 5.0,5.0 0 1,0 -10.0,0 Z"
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:pathData="M20 21a8 8 0 1 0-16 0"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:pathData="M12 13a8 8 0 0 0-8 8h16a8 8 0 0 0-8-8z"
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M10 1a1 1 0 0 0 0 2h1v1.062A7.96 7.96 0 0 0 7.094 5.68L5.914 4.5l.793-.793a1 1 0 0 0-1.414-1.414l-3 3a1 1 0 0 0 1.414 1.414l.793-.793 1.18 1.18A7.96 7.96 0 0 0 4.062 11H3v-1a1 1 0 0 0-2 0v4a1 1 0 1 0 2 0v-1h1.062c.182 1.46.759 2.8 1.618 3.906l-1.18 1.18-.793-.793a1 1 0 0 0-1.414 1.414l3 3a1 1 0 0 0 1.414-1.414l-.793-.793 1.18-1.18A7.965 7.965 0 0 0 11 19.938V21h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-1.062a7.965 7.965 0 0 0 3.906-1.618l1.18 1.18-.793.793a1 1 0 0 0 1.414 1.414l3-3a1 1 0 0 0-1.414-1.414l-.793.793-1.18-1.18A7.965 7.965 0 0 0 19.938 13H21v1a1 1 0 1 0 2 0v-4a1 1 0 1 0-2 0v1h-1.062a7.965 7.965 0 0 0-1.618-3.906l1.18-1.18.793.793a1 1 0 1 0 1.414-1.414l-3-3a1 1 0 1 0-1.414 1.414l.793.793-1.18 1.18A7.966 7.966 0 0 0 13 4.062V3h1a1 1 0 1 0 0-2h-4zm3 13a1 1 0 0 1 1-1h.001a1 1 0 1 1 0 2H14a1 1 0 0 1-1-1zm-3-3.5a.5.5 0 1 1 1 0 .5.5 0 0 1-1 0zm.5-2.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12zm11-5a1 1 0 1 0-2 0v3.764a3 3 0 0 0 1.658 2.683l2.895 1.447a1 1 0 1 0 .894-1.788l-2.894-1.448a1 1 0 0 1-.553-.894V7z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M6 2a1 1 0 0 0 0 2h1v13a5 5 0 0 0 10 0V4h1a1 1 0 1 0 0-2H6zm3 5V4h6v3H9zm4.708 5.708a1 1 0 0 1-1.414 0h-.001a1 1 0 0 1 1.414-1.415 1 1 0 0 1 0 1.415zm-3.414 4a1 1 0 1 0 1.414-1.414v-.001a1 1 0 0 0-1.415 1.414z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M9.5 5H9a2 2 0 0 0-2 2v2c0 1-.6 3-3 3 1 0 3 .6 3 3v2a2 2 0 0 0 2 2h.5m5-14h.5a2 2 0 0 1 2 2v2c0 1 .6 3 3 3-1 0-3 .6-3 3v2a2 2 0 0 1-2 2h-.5"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M17 7a5.001 5.001 0 0 0-4.607 3.053C11.963 11.07 12.896 12 14 12h6c1.105 0 2.037-.93 1.607-1.947A5.001 5.001 0 0 0 17 7zm0 10a5.001 5.001 0 0 0-3.053-4.607C12.93 11.963 12 12.896 12 14v6c0 1.105.93 2.037 1.947 1.607A5.001 5.001 0 0 0 17 17zM7 17a5.001 5.001 0 0 0 4.607-3.053C12.037 12.93 11.104 12 10 12H4c-1.105 0-2.037.93-1.607 1.947A5.001 5.001 0 0 0 7 17zM7 7a5.001 5.001 0 0 0 3.053 4.607C11.07 12.037 12 11.104 12 10V4c0-1.105-.93-2.037-1.947-1.607A5.001 5.001 0 0 0 7 7z"
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M21 7c0 2.21-4.03 4-9 4S3 9.21 3 7s4.03-4 9-4 9 1.79 9 4z"
android:fillColor="#FFFFFFFF" />
<path
android:pathData="M21 7c0 2.21-4.03 4-9 4S3 9.21 3 7m18 0c0-2.21-4.03-4-9-4S3 4.79 3 7m18 0v5M3 7v5m18 0c0 2.21-4.03 4-9 4s-9-1.79-9-4m18 0v5c0 2.21-4.03 4-9 4s-9-1.79-9-4v-5"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M10 2a3.001 3.001 0 0 0-2.83 2H6a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3h-1.17A3.001 3.001 0 0 0 14 2h-4zM9 5a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2h-4a1 1 0 0 1-1-1zm6.78 6.625a1 1 0 1 0-1.56-1.25l-3.303 4.128-1.21-1.21a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.488-.082l4-5z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M21 8c0 1.02-1.186 1.92-3 2.462-1.134.34-2.513.538-4 .538s-2.866-.199-4-.538C8.187 9.92 7 9.02 7 8c0-1.657 3.134-3 7-3s7 1.343 7 3z"
android:fillColor="#FFFFFFFF" />
<path
android:pathData="M21 8c0-1.657-3.134-3-7-3S7 6.343 7 8m14 0v4c0 1.02-1.186 1.92-3 2.462-1.134.34-2.513.538-4 .538s-2.866-.199-4-.538C8.187 13.92 7 13.02 7 12V8m14 0c0 1.02-1.186 1.92-3 2.462-1.134.34-2.513.538-4 .538s-2.866-.199-4-.538C8.187 9.92 7 9.02 7 8"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:pathData="M3 12v4c0 1.02 1.187 1.92 3 2.462 1.134.34 2.513.538 4 .538s2.866-.199 4-.538c1.813-.542 3-1.442 3-2.462v-1M3 12c0-1.197 1.635-2.23 4-2.711M3 12c0 1.02 1.187 1.92 3 2.462 1.134.34 2.513.538 4 .538.695 0 1.366-.043 2-.124"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M4 14 14 3v7h6L10 21v-7H4z"
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M20.156 6.473a2.639 2.639 0 0 0-2.63-2.629C15.049 3.817 9.909 4.193 6.5 7.6c-2.796 2.796-2.915 7.3-.157 10.057 2.758 2.758 7.26 2.639 10.057-.157 3.407-3.408 3.783-8.548 3.756-11.027zm-4.62 1.991a1 1 0 0 1 0 1.415l-.978.977.587.195a1 1 0 0 1-.633 1.898l-1.535-.512-1.247 1.247.586.196a1 1 0 0 1-.632 1.897l-1.173-.39a3.01 3.01 0 0 1-.344-.14l-2.41 2.41-3.121 3.121a1 1 0 0 1-1.414-1.414l3.121-3.121 2.41-2.41a3.009 3.009 0 0 1-.14-.344l-.39-1.173a1 1 0 0 1 1.897-.632l.196.586 1.247-1.247-.512-1.535a1 1 0 0 1 1.898-.633l.195.587.977-.978a1 1 0 0 1 1.414 0z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M 5.0,9.0 a 7.0,7.0 0 1,0 14.0,0 a 7.0,7.0 0 1,0 -14.0,0 Z"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:pathData="M7 20.234V14c.667.667 2.6 2 5 2s4.333-1.333 5-2v6.234a1 1 0 0 1-1.514.857l-2.972-1.782a1 1 0 0 0-1.028 0L8.514 21.09A1 1 0 0 1 7 20.234z"
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M5 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1.586l2.293 2.293A1 1 0 0 0 22 16V8a1 1 0 0 0-1.707-.707L18 9.586V8a3 3 0 0 0-3-3H5z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M 3.0,12.0 a 9.0,9.0 0 1,0 18.0,0 a 9.0,9.0 0 1,0 -18.0,0 Z"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:pathData="M13.5 6h.5a2 2 0 0 0 2-2C8.4 1.2 4.5 6.5 3.5 9.5l4.167 5.093c.215.263.333.593.333.933C8 16.34 8.673 17 9.487 17c.828 0 1.513.672 1.513 1.5V21c2.167-.167 6.8-1.2 8-4h-1a2 2 0 0 1-2-2 2 2 0 0 0-2-2h-2a2 2 0 0 1-2-2v-1a1 1 0 0 1 1-1 1 1 0 0 0 1-1v-.5A1.5 1.5 0 0 1 13.5 6z"
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3 5a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v14a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V5zm5 0v7l2.293-2.293a1 1 0 0 1 1.414 0L14 12V5a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12zm14.243-4.243L9.879 9.88l-2.122 6.364 6.364-2.122 2.122-6.364z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v7.764l1.447 2.894-.894.448.894-.448c.998 1.995-.453 4.342-2.683 4.342H4.236c-2.23 0-3.68-2.347-2.683-4.342L3 13.764V6zm3-1a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H6z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12 2H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h.93a2 2 0 0 1 1.664.89l.574.862a1 1 0 0 0 1.664 0l.574-.861A2 2 0 0 1 11.07 12H12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2z"
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:pathData="M18 10h2a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-.93a2 2 0 0 0-1.664.89l-.574.862a1 1 0 0 1-1.664 0l-.574-.861A2 2 0 0 0 12.93 20H12a2 2 0 0 1-2-2v-1"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12 3a2 2 0 0 0-1 3.732V8H8c-3.2 0-4 2.667-4 4v7c0 .667.4 2 2 2h1v-4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v4h1c1.6 0 2-1.333 2-2v-7c0-3.2-2.667-4-4-4h-3V6.732A2 2 0 0 0 12 3zm3 18v-3h-2v3h2zm-4 0v-3H9v3h2zm10-3v-5c.667 0 2 .4 2 2v1c0 .667-.4 2-2 2zM3 13v5c-1.6 0-2-1.333-2-2v-1c0-1.6 1.333-2 2-2zm6-1a1 1 0 1 0 0 2h.001a1 1 0 1 0 0-2H9zm5 1a1 1 0 0 1 1-1h.001a1 1 0 1 1 0 2H15a1 1 0 0 1-1-1z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M11 4.85c-2.195-1.022-5.52-1.565-8.633.979A1 1 0 0 0 2 6.603V19a1 1 0 0 0 1.633.774c2.736-2.236 5.734-1.31 7.367-.255V4.849zm2 0v14.669c1.633-1.056 4.63-1.981 7.367.255A1 1 0 0 0 22 19V6.603a1 1 0 0 0-.367-.774C18.52 3.285 15.195 3.828 13 4.849z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M7 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H7zm0 4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V6zm1 7a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H8zm3 1a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1zm1 2a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H12zm-5 1a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1zm10-3a1 1 0 1 0-2 0v3a1 1 0 1 0 2 0v-3z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M9.024 2.783A1 1 0 0 1 10 2h4a1 1 0 0 1 .976.783l.44 1.981c.4.19.781.41 1.14.66l1.938-.61a1 1 0 0 1 1.166.454l2 3.464a1 1 0 0 1-.19 1.237l-1.497 1.373a8.1 8.1 0 0 1 0 1.316l1.497 1.373a1 1 0 0 1 .19 1.237l-2 3.464a1 1 0 0 1-1.166.454l-1.937-.61c-.36.25-.741.47-1.14.66l-.44 1.98A1 1 0 0 1 14 22h-4a1 1 0 0 1-.976-.783l-.44-1.981c-.4-.19-.781-.41-1.14-.66l-1.938.61a1 1 0 0 1-1.166-.454l-2-3.464a1 1 0 0 1 .19-1.237l1.497-1.373a8.097 8.097 0 0 1 0-1.316L2.53 9.97a1 1 0 0 1-.19-1.237l2-3.464a1 1 0 0 1 1.166-.454l1.937.61c.36-.25.741-.47 1.14-.66l.44-1.98zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"
android:fillColor="#FFFFFFFF"
android:fillType="evenOdd" />
</vector>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M13 4h4v4h-4v9c0 1-.6 3-3 3s-3-2-3-3 .6-3 3-3 3 2 3 3V4z"
android:fillColor="#FFFFFFFF" />
<path
android:pathData="M13 17V8m0 9c0 1-.6 3-3 3s-3-2-3-3 .6-3 3-3 3 2 3 3zm0-9V4h4v4h-4z"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M2 13.5C2 17.9 5.667 19 7.5 19h10c1.5 0 4.5-.9 4.5-4.5S19 10 17.5 10c0-1.5-1.5-5-5-5-2.8 0-4.5 2-5 3C5.667 8 2 9.1 2 13.5z"
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

Some files were not shown because too many files have changed in this diff Show More