From 2e68798e2c73c577d5e4542049389d4a327bb412 Mon Sep 17 00:00:00 2001 From: Jonas Lochmann Date: Mon, 28 Apr 2025 02:00:00 +0200 Subject: [PATCH 1/3] Update buildtools and dependencies --- ...otlin-compiler-10945293377659253515.salive | 0 app/build.gradle | 22 +++++++++---------- .../manage/user/ManageDeviceUserScreen.kt | 4 ++-- .../android/ui/overview/overview/Device.kt | 10 ++++----- .../android/ui/overview/overview/Intro.kt | 12 +++++----- .../android/ui/overview/overview/User.kt | 10 ++++----- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 8 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 .kotlin/sessions/kotlin-compiler-10945293377659253515.salive diff --git a/.kotlin/sessions/kotlin-compiler-10945293377659253515.salive b/.kotlin/sessions/kotlin-compiler-10945293377659253515.salive new file mode 100644 index 0000000..e69de29 diff --git a/app/build.gradle b/app/build.gradle index 7c07449..3816ea0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -167,24 +167,24 @@ wire { dependencies { def nav_version = "2.5.3" - def room_version = "2.6.1" - def work_version = '2.10.0' - def paging_version = "3.3.2" + def room_version = "2.7.1" + def work_version = '2.10.1' + def paging_version = "3.3.6" implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.21" implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'androidx.core:core:1.15.0' + implementation 'androidx.core:core:1.16.0' implementation 'androidx.cardview:cardview:1.0.0' - implementation 'androidx.gridlayout:gridlayout:1.0.0' + implementation 'androidx.gridlayout:gridlayout:1.1.0' implementation "com.google.android.material:material:1.12.0" - implementation 'androidx.compose.material:material:1.7.5' - implementation 'androidx.activity:activity-compose:1.9.3' + implementation 'androidx.compose.material:material:1.8.0' + implementation 'androidx.activity:activity-compose:1.10.1' implementation "com.google.accompanist:accompanist-flowlayout:0.30.0" - implementation 'androidx.compose.material:material-icons-extended:1.7.6' - debugImplementation "androidx.compose.ui:ui-tooling:1.7.6" - implementation 'androidx.fragment:fragment-ktx:1.8.5' - implementation 'androidx.fragment:fragment-compose:1.8.5' + implementation 'androidx.compose.material:material-icons-extended:1.7.8' + debugImplementation "androidx.compose.ui:ui-tooling:1.8.0" + implementation 'androidx.fragment:fragment-ktx:1.8.6' + implementation 'androidx.fragment:fragment-compose:1.8.6' implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-ui:$nav_version" diff --git a/app/src/main/java/io/timelimit/android/ui/manage/device/manage/user/ManageDeviceUserScreen.kt b/app/src/main/java/io/timelimit/android/ui/manage/device/manage/user/ManageDeviceUserScreen.kt index 7a9aeee..55cef2a 100644 --- a/app/src/main/java/io/timelimit/android/ui/manage/device/manage/user/ManageDeviceUserScreen.kt +++ b/app/src/main/java/io/timelimit/android/ui/manage/device/manage/user/ManageDeviceUserScreen.kt @@ -1,5 +1,5 @@ /* - * TimeLimit Copyright 2019 - 2023 Jonas Lochmann + * TimeLimit Copyright 2019 - 2025 Jonas Lochmann * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,7 +49,7 @@ fun ManageDeviceUserScreen( Card( onClick = { actions.select(item) }, modifier = Modifier - .animateItemPlacement() + .animateItem() .fillMaxWidth(), backgroundColor = when (item.selected) { true -> MaterialTheme.colors.secondary diff --git a/app/src/main/java/io/timelimit/android/ui/overview/overview/Device.kt b/app/src/main/java/io/timelimit/android/ui/overview/overview/Device.kt index 5580924..2640d9e 100644 --- a/app/src/main/java/io/timelimit/android/ui/overview/overview/Device.kt +++ b/app/src/main/java/io/timelimit/android/ui/overview/overview/Device.kt @@ -1,5 +1,5 @@ /* - * TimeLimit Copyright 2019 - 2023 Jonas Lochmann + * TimeLimit Copyright 2019 - 2025 Jonas Lochmann * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ import io.timelimit.android.ui.model.main.OverviewHandling @OptIn(ExperimentalFoundationApi::class) fun LazyListScope.deviceItems(screen: OverviewHandling.OverviewScreen) { item (key = Pair("devices", "header")) { - ListCommon.SectionHeader(stringResource(R.string.overview_header_devices), Modifier.animateItemPlacement()) + ListCommon.SectionHeader(stringResource(R.string.overview_header_devices), Modifier.animateItem()) } items(screen.devices.list, key = { Pair("device", it.device.id) }) { @@ -48,7 +48,7 @@ fun LazyListScope.deviceItems(screen: OverviewHandling.OverviewScreen) { icon = Icons.Default.Add, label = stringResource(R.string.add_device), action = screen.actions.addDevice, - modifier = Modifier.animateItemPlacement() + modifier = Modifier.animateItem() ) } } @@ -56,7 +56,7 @@ fun LazyListScope.deviceItems(screen: OverviewHandling.OverviewScreen) { if (screen.devices.canShowMore != null) { item (key = Pair("devices", "more")) { ListCommon.ShowMoreItem( - modifier = Modifier.animateItemPlacement(), + modifier = Modifier.animateItem(), action = { screen.actions.showMoreDevices(screen.devices.canShowMore) } ) } @@ -71,7 +71,7 @@ fun LazyItemScope.DeviceItem( ) { ListCardCommon.Card( Modifier - .animateItemPlacement() + .animateItem() .padding(horizontal = 8.dp) .clickable(onClick = { openAction(item) }) ) { diff --git a/app/src/main/java/io/timelimit/android/ui/overview/overview/Intro.kt b/app/src/main/java/io/timelimit/android/ui/overview/overview/Intro.kt index 8099c13..b05a8d4 100644 --- a/app/src/main/java/io/timelimit/android/ui/overview/overview/Intro.kt +++ b/app/src/main/java/io/timelimit/android/ui/overview/overview/Intro.kt @@ -1,5 +1,5 @@ /* - * TimeLimit Copyright 2019 - 2023 Jonas Lochmann + * TimeLimit Copyright 2019 - 2025 Jonas Lochmann * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ fun LazyListScope.introItems( item (key = Pair("intro", "finish setup")) { ListCardCommon.Card( modifier = Modifier - .animateItemPlacement() + .animateItem() .padding(horizontal = 8.dp) ) { Text( @@ -62,7 +62,7 @@ fun LazyListScope.introItems( item (key = Pair("intro", "outdated server")) { ListCardCommon.Card( modifier = Modifier - .animateItemPlacement() + .animateItem() .padding(horizontal = 8.dp) ) { Text( @@ -79,7 +79,7 @@ fun LazyListScope.introItems( item (key = Pair("intro", "server message")) { ListCardCommon.Card( modifier = Modifier - .animateItemPlacement() + .animateItem() .padding(horizontal = 8.dp) ) { Text( @@ -108,7 +108,7 @@ fun LazyListScope.introItems( SwipeToDismiss( state = state, background = {}, - modifier = Modifier.animateItemPlacement() + modifier = Modifier.animateItem() ) { ListCardCommon.Card( modifier = Modifier.padding(horizontal = 8.dp) @@ -133,7 +133,7 @@ fun LazyListScope.introItems( item (key = Pair("intro", "task review")) { ListCardCommon.Card( modifier = Modifier - .animateItemPlacement() + .animateItem() .padding(horizontal = 8.dp) ) { Text( diff --git a/app/src/main/java/io/timelimit/android/ui/overview/overview/User.kt b/app/src/main/java/io/timelimit/android/ui/overview/overview/User.kt index 7cd85d5..7805783 100644 --- a/app/src/main/java/io/timelimit/android/ui/overview/overview/User.kt +++ b/app/src/main/java/io/timelimit/android/ui/overview/overview/User.kt @@ -1,5 +1,5 @@ /* - * TimeLimit Copyright 2019 - 2023 Jonas Lochmann + * TimeLimit Copyright 2019 - 2025 Jonas Lochmann * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ import io.timelimit.android.ui.model.main.OverviewHandling @OptIn(ExperimentalFoundationApi::class) fun LazyListScope.userItems(screen: OverviewHandling.OverviewScreen) { item (key = Pair("users", "header")) { - ListCommon.SectionHeader(stringResource(R.string.overview_header_users), Modifier.animateItemPlacement()) + ListCommon.SectionHeader(stringResource(R.string.overview_header_users), Modifier.animateItem()) } items(screen.users.list, key = { Pair("user", it.id) }) { UserItem(it, screen.actions) } @@ -45,13 +45,13 @@ fun LazyListScope.userItems(screen: OverviewHandling.OverviewScreen) { icon = Icons.Default.Add, label = stringResource(R.string.add_user_title), action = screen.actions.addUser, - modifier = Modifier.animateItemPlacement() + modifier = Modifier.animateItem() ) } if (screen.users.canShowMore) item (key = Pair("users", "more")) { ListCommon.ShowMoreItem ( - modifier = Modifier.animateItemPlacement(), + modifier = Modifier.animateItem(), action = screen.actions.showMoreUsers ) } @@ -65,7 +65,7 @@ fun LazyItemScope.UserItem( ) { ListCardCommon.Card( Modifier - .animateItemPlacement() + .animateItem() .padding(horizontal = 8.dp) .clickable(onClick = { actions.openUser(user) }) ) { diff --git a/build.gradle b/build.gradle index 27845eb..b574be7 100644 --- a/build.gradle +++ b/build.gradle @@ -15,8 +15,8 @@ */ plugins { - id 'com.android.application' version '8.8.0' apply false - id 'com.android.library' version '8.8.0' apply false + id 'com.android.application' version '8.9.2' apply false + id 'com.android.library' version '8.9.2' apply false id 'org.jetbrains.kotlin.android' version "2.0.21" apply false id 'com.google.devtools.ksp' version '1.9.21-1.0.16' apply false id 'androidx.navigation.safeargs' version '2.6.0' apply false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 04ad34c..c6c1c0c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,5 +2,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip -distributionSha256Sum=2ab88d6de2c23e6adae7363ae6e29cbdd2a709e992929b48b6530fd0c7133bd6 \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip +distributionSha256Sum=89d4e70e4e84e2d2dfbb63e4daa53e21b25017cc70c37e4eea31ee51fb15098a \ No newline at end of file From de0b6d1c8f0f09d2ce44913a49ac4f09a2b713e1 Mon Sep 17 00:00:00 2001 From: Jonas Lochmann Date: Mon, 28 Apr 2025 02:00:00 +0200 Subject: [PATCH 2/3] Fix parsing u2f counter bytes >= 0x80 --- .../io/timelimit/android/u2f/protocol/U2FResponse.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/timelimit/android/u2f/protocol/U2FResponse.kt b/app/src/main/java/io/timelimit/android/u2f/protocol/U2FResponse.kt index ee43d8c..84afa7b 100644 --- a/app/src/main/java/io/timelimit/android/u2f/protocol/U2FResponse.kt +++ b/app/src/main/java/io/timelimit/android/u2f/protocol/U2FResponse.kt @@ -1,5 +1,5 @@ /* - * TimeLimit Copyright 2019 - 2022 Jonas Lochmann + * TimeLimit Copyright 2019 - 2025 Jonas Lochmann * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,10 +64,10 @@ object U2FResponse { val flags = rawResponse.payload[0] - val counter = rawResponse.payload[4].toUInt() or - rawResponse.payload[3].toUInt().shl(8) or - rawResponse.payload[2].toUInt().shl(16) or - rawResponse.payload[1].toUInt().shl(24) + val counter = rawResponse.payload[4].toUByte().toUInt() or + rawResponse.payload[3].toUByte().toUInt().shl(8) or + rawResponse.payload[2].toUByte().toUInt().shl(16) or + rawResponse.payload[1].toUByte().toUInt().shl(24) val signature = rawResponse.payload.sliceArray(5 until rawResponse.payload.size) From a36ffa861ab943e2b32828e149b2ff03f20d10a2 Mon Sep 17 00:00:00 2001 From: Jonas Lochmann Date: Mon, 28 Apr 2025 02:00:00 +0200 Subject: [PATCH 3/3] remove obsolete tests --- .../blocked_times/MinutesOfWeekItemsTest.kt | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 app/src/test/java/io/timelimit/android/ui/manage/category/blocked_times/MinutesOfWeekItemsTest.kt diff --git a/app/src/test/java/io/timelimit/android/ui/manage/category/blocked_times/MinutesOfWeekItemsTest.kt b/app/src/test/java/io/timelimit/android/ui/manage/category/blocked_times/MinutesOfWeekItemsTest.kt deleted file mode 100644 index c712f0d..0000000 --- a/app/src/test/java/io/timelimit/android/ui/manage/category/blocked_times/MinutesOfWeekItemsTest.kt +++ /dev/null @@ -1,23 +0,0 @@ -package io.timelimit.android.ui.manage.category.blocked_times - -import org.junit.Assert.assertEquals -import org.junit.Test - -class MinutesOfWeekItemsTest { - @Test - fun canGetAllItems() { - for (i in 0 until MinuteOfWeekItems.itemsPerWeek) { - MinuteOfWeekItems.getItemAtPosition(i) - } - } - - @Test - fun reverseLookupReturnsSameItem() { - for (i in 0 until MinuteOfWeekItems.itemsPerWeek) { - val item = MinuteOfWeekItems.getItemAtPosition(i) - val index = MinuteOfWeekItems.getPositionOfItem(item) - - assertEquals(item.toString(), i, index) - } - } -} \ No newline at end of file