mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 04:46:44 -06:00
Merge branch 'develop'
This commit is contained in:
commit
46de915965
@ -1,23 +1,8 @@
|
||||
<h3>Wersja 4.11, 2021-11-01</h3>
|
||||
<h3>Wersja 4.11.2, 2022-02-05</h3>
|
||||
<ul>
|
||||
<li>Nowości w module Wiadomości:</li>
|
||||
<li>→ <b>Formatowanie tekstu</b> przy wysyłaniu wiadomości oraz dodawaniu wydarzeń.</li>
|
||||
<li>→ Zapisywanie <b>wersji roboczych</b> wiadomości, do późniejszej edycji i wysłania.</li>
|
||||
<li>→ Możliwość <b>wyszukiwania zadań domowych</b>, podobnie jak wiadomości.</li>
|
||||
<li>→ Dodawanie gwiazdki do wiadomości, w celu "przypięcia" na górę listy.</li>
|
||||
<br>
|
||||
<li>Opcja <b>dodawania notatek</b> do wydarzeń, ocen, lekcji, itp.</li>
|
||||
<li>Możliwość udostępniania notatek w klasie, jako "ogłoszenia" widoczne na ekranie głównym.</li>
|
||||
<br>
|
||||
<li>Dodano <b>listę nauczycieli</b> w menu Więcej. @Antoni-Czaplicki</li>
|
||||
<li>Logowanie: skaner kodów QR, uproszczone pole adresu w Mobidzienniku.</li>
|
||||
<li>Naprawiono filtrowanie powiadomień.</li>
|
||||
<li>Mobidziennik: dodano wyświetlanie lekcji z planów "pozalekcyjnych".</li>
|
||||
<li>Mobidziennik: dodano pobieranie pełnej treści "informacji" w kalendarzu.</li>
|
||||
<li>Mobidziennik: poprawiono wyświetlanie załączników oraz ich wielkości.</li>
|
||||
<li>Dodano tajne funkcje. @Antoni-Czaplicki</li>
|
||||
<li>Mobidziennik: naprawiono brak nadawców w liście wiadomości.</li>
|
||||
</ul>
|
||||
<br>
|
||||
<br>
|
||||
Dzięki za korzystanie ze Szkolnego!<br>
|
||||
<i>© [Kuba Szczodrzyński](@kuba2k2), [Kacper Ziubryniewicz](@kapi2289) 2021</i>
|
||||
<i>© [Kuba Szczodrzyński](@kuba2k2), [Kacper Ziubryniewicz](@kapi2289) 2022</i>
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
/*secret password - removed for source code publication*/
|
||||
static toys AES_IV[16] = {
|
||||
0x17, 0xf8, 0xac, 0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
0x66, 0xae, 0x85, 0x2a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
|
||||
unsigned char *agony(unsigned int laugh, unsigned char *box, unsigned char *heat);
|
||||
|
||||
|
@ -182,10 +182,6 @@ class LibrusData(val data: DataLibrus, val onSuccess: () -> Unit) {
|
||||
data.startProgress(R.string.edziennik_progress_endpoint_pt_meetings)
|
||||
LibrusApiPtMeetings(data, lastSync, onSuccess)
|
||||
}
|
||||
ENDPOINT_LIBRUS_API_TEACHER_FREE_DAY_TYPES -> {
|
||||
data.startProgress(R.string.edziennik_progress_endpoint_teacher_free_day_types)
|
||||
LibrusApiTeacherFreeDayTypes(data, lastSync, onSuccess)
|
||||
}
|
||||
ENDPOINT_LIBRUS_API_TEACHER_FREE_DAYS -> {
|
||||
data.startProgress(R.string.edziennik_progress_endpoint_teacher_free_days)
|
||||
LibrusApiTeacherFreeDays(data, lastSync, onSuccess)
|
||||
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Kacper Ziubryniewicz 2019-10-19
|
||||
*/
|
||||
|
||||
package pl.szczodrzynski.edziennik.data.api.edziennik.librus.data.api
|
||||
|
||||
import pl.szczodrzynski.edziennik.*
|
||||
import pl.szczodrzynski.edziennik.data.api.edziennik.librus.DataLibrus
|
||||
import pl.szczodrzynski.edziennik.data.api.edziennik.librus.ENDPOINT_LIBRUS_API_TEACHER_FREE_DAY_TYPES
|
||||
import pl.szczodrzynski.edziennik.data.api.edziennik.librus.data.LibrusApi
|
||||
import pl.szczodrzynski.edziennik.data.db.entity.TeacherAbsenceType
|
||||
import pl.szczodrzynski.edziennik.ext.*
|
||||
|
||||
class LibrusApiTeacherFreeDayTypes(override val data: DataLibrus,
|
||||
override val lastSync: Long?,
|
||||
val onSuccess: (endpointId: Int) -> Unit
|
||||
) : LibrusApi(data, lastSync) {
|
||||
companion object {
|
||||
const val TAG = "LibrusApiTeacherFreeDayTypes"
|
||||
}
|
||||
|
||||
init {
|
||||
apiGet(TAG, "TeacherFreeDays/Types") { json ->
|
||||
val teacherAbsenceTypes = json.getJsonArray("Types")?.asJsonObjectList()
|
||||
|
||||
teacherAbsenceTypes?.forEach { teacherAbsenceType ->
|
||||
val id = teacherAbsenceType.getLong("Id") ?: return@forEach
|
||||
val name = teacherAbsenceType.getString("Name") ?: return@forEach
|
||||
|
||||
val teacherAbsenceTypeObject = TeacherAbsenceType(
|
||||
profileId,
|
||||
id,
|
||||
name
|
||||
)
|
||||
|
||||
data.teacherAbsenceTypes.put(id, teacherAbsenceTypeObject)
|
||||
}
|
||||
|
||||
data.setSyncNext(ENDPOINT_LIBRUS_API_TEACHER_FREE_DAY_TYPES, 7 * DAY)
|
||||
onSuccess(ENDPOINT_LIBRUS_API_TEACHER_FREE_DAY_TYPES)
|
||||
}
|
||||
}
|
||||
}
|
@ -36,8 +36,6 @@ class LibrusApiTeacherFreeDays(override val data: DataLibrus,
|
||||
val id = teacherAbsence.getLong("Id") ?: return@forEach
|
||||
val teacherId = teacherAbsence.getJsonObject("Teacher")?.getLong("Id")
|
||||
?: return@forEach
|
||||
val type = teacherAbsence.getJsonObject("Type").getLong("Id") ?: return@forEach
|
||||
val name = data.teacherAbsenceTypes.singleOrNull { it.id == type }?.name
|
||||
val dateFrom = Date.fromY_m_d(teacherAbsence.getString("DateFrom"))
|
||||
val dateTo = Date.fromY_m_d(teacherAbsence.getString("DateTo"))
|
||||
val timeFrom = teacherAbsence.getString("TimeFrom")?.let { Time.fromH_m_s(it) }
|
||||
@ -46,8 +44,8 @@ class LibrusApiTeacherFreeDays(override val data: DataLibrus,
|
||||
val teacherAbsenceObject = TeacherAbsence(
|
||||
profileId = profileId,
|
||||
id = id,
|
||||
type = type,
|
||||
name = name,
|
||||
type = -1L,
|
||||
name = null,
|
||||
dateFrom = dateFrom,
|
||||
dateTo = dateTo,
|
||||
timeFrom = timeFrom,
|
||||
|
@ -7,10 +7,12 @@ package pl.szczodrzynski.edziennik.data.api.edziennik.mobidziennik
|
||||
import android.util.LongSparseArray
|
||||
import pl.szczodrzynski.edziennik.App
|
||||
import pl.szczodrzynski.edziennik.data.api.LOGIN_METHOD_MOBIDZIENNIK_WEB
|
||||
import pl.szczodrzynski.edziennik.data.api.Regexes
|
||||
import pl.szczodrzynski.edziennik.data.api.models.Data
|
||||
import pl.szczodrzynski.edziennik.data.db.entity.LoginStore
|
||||
import pl.szczodrzynski.edziennik.data.db.entity.Profile
|
||||
import pl.szczodrzynski.edziennik.ext.currentTimeUnix
|
||||
import pl.szczodrzynski.edziennik.ext.get
|
||||
import pl.szczodrzynski.edziennik.ext.isNotNullNorEmpty
|
||||
import pl.szczodrzynski.edziennik.utils.models.Date
|
||||
import pl.szczodrzynski.edziennik.utils.models.Time
|
||||
@ -35,6 +37,31 @@ class DataMobidziennik(app: App, profile: Profile?, loginStore: LoginStore) : Da
|
||||
|
||||
override fun generateUserCode() = "$loginServerName:$loginUsername:$studentId"
|
||||
|
||||
fun parseDateTime(dateStr: String): Pair<Date, Time> {
|
||||
// pt, 4 lut, 09:11
|
||||
val dateParts = dateStr.split(',', ' ').filter { it.isNotEmpty() }
|
||||
// [pt], [4], [lut], [09:11]
|
||||
val date = Date.getToday()
|
||||
date.day = dateParts[1].toIntOrNull() ?: 1
|
||||
date.month = when (dateParts[2]) {
|
||||
"sty" -> 1
|
||||
"lut" -> 2
|
||||
"mar" -> 3
|
||||
"kwi" -> 4
|
||||
"maj" -> 5
|
||||
"cze" -> 6
|
||||
"lip" -> 7
|
||||
"sie" -> 8
|
||||
"wrz" -> 9
|
||||
"paź" -> 10
|
||||
"lis" -> 11
|
||||
"gru" -> 12
|
||||
else -> 1
|
||||
}
|
||||
val time = Time.fromH_m(dateParts[3])
|
||||
return date to time
|
||||
}
|
||||
|
||||
val teachersMap = LongSparseArray<String>()
|
||||
val subjectsMap = LongSparseArray<String>()
|
||||
|
||||
|
@ -36,6 +36,10 @@ class MobidziennikWebMessagesInbox(override val data: DataMobidziennik,
|
||||
|
||||
val doc = Jsoup.parse(text)
|
||||
|
||||
val today = Date.getToday()
|
||||
var currentYear = today.year
|
||||
var currentMonth = today.month
|
||||
|
||||
val list = doc.getElementsByClass("spis").first()?.getElementsByClass("podswietl")
|
||||
list?.forEach { item ->
|
||||
val id = item.attr("rel").toLongOrNull() ?: return@forEach
|
||||
@ -47,15 +51,20 @@ class MobidziennikWebMessagesInbox(override val data: DataMobidziennik,
|
||||
}
|
||||
val subject = subjectEl?.ownText() ?: ""
|
||||
|
||||
val addedDateEl = item.select("td:eq(1) small").first()
|
||||
val addedDate = Date.fromIsoHm(addedDateEl?.text())
|
||||
val addedDateEl = item.select("td:eq(4)").first()
|
||||
val (date, time) = data.parseDateTime(addedDateEl?.text()?.trim() ?: "")
|
||||
if (date.month > currentMonth) {
|
||||
currentYear--
|
||||
}
|
||||
currentMonth = date.month
|
||||
date.year = currentYear
|
||||
|
||||
val senderEl = item.select("td:eq(2)").first()
|
||||
val senderEl = item.select("td:eq(3)").first()
|
||||
val senderName = senderEl?.ownText().fixName()
|
||||
val senderId = data.teacherList.singleOrNull { it.fullNameLastFirst == senderName }?.id
|
||||
data.messageRecipientIgnoreList.add(MessageRecipient(profileId, -1, id))
|
||||
|
||||
val isRead = item.select("td:eq(3) span").first()?.hasClass("wiadomosc_przeczytana") == true
|
||||
val isRead = item.select("td:eq(5) span").first()?.hasClass("wiadomosc_przeczytana") == true
|
||||
|
||||
val message = Message(
|
||||
profileId = profileId,
|
||||
@ -64,7 +73,7 @@ class MobidziennikWebMessagesInbox(override val data: DataMobidziennik,
|
||||
subject = subject,
|
||||
body = null,
|
||||
senderId = senderId,
|
||||
addedDate = addedDate
|
||||
addedDate = date.combineWith(time)
|
||||
)
|
||||
|
||||
if (hasAttachments)
|
||||
|
@ -40,23 +40,29 @@ class MobidziennikWebMessagesSent(override val data: DataMobidziennik,
|
||||
|
||||
val doc = Jsoup.parse(text)
|
||||
|
||||
val today = Date.getToday()
|
||||
var currentYear = today.year
|
||||
var currentMonth = today.month
|
||||
|
||||
val list = doc.getElementsByClass("spis").first()?.getElementsByClass("podswietl")
|
||||
list?.forEach { item ->
|
||||
val id = item.attr("rel").toLongOrNull() ?: return@forEach
|
||||
|
||||
val subjectEl = item.select("td:eq(0)").first()
|
||||
var hasAttachments = false
|
||||
if (subjectEl?.getElementsByTag("a")?.size ?: 0 > 0) {
|
||||
hasAttachments = true
|
||||
}
|
||||
val subject = subjectEl?.ownText() ?: ""
|
||||
|
||||
val readByString = item.select("td:eq(2)").first()?.text() ?: ""
|
||||
val attachmentsEl = item.select("td:eq(1)").first()
|
||||
var hasAttachments = false
|
||||
if (attachmentsEl?.getElementsByTag("a")?.size ?: 0 > 0) {
|
||||
hasAttachments = true
|
||||
}
|
||||
|
||||
val readByString = item.select("td:eq(4)").first()?.text() ?: ""
|
||||
val (readBy, sentTo) = Regexes.MOBIDZIENNIK_MESSAGE_SENT_READ_BY.find(readByString).let {
|
||||
(it?.get(1)?.toIntOrNull() ?: 0) to (it?.get(2)?.toIntOrNull() ?: 0)
|
||||
}
|
||||
|
||||
val recipientEl = item.select("td:eq(1) a span").first()
|
||||
val recipientEl = item.select("td:eq(2) a span").first()
|
||||
val recipientNames = recipientEl?.ownText()?.split(", ")
|
||||
val readState = when (readBy) {
|
||||
0 -> 0
|
||||
@ -69,8 +75,13 @@ class MobidziennikWebMessagesSent(override val data: DataMobidziennik,
|
||||
data.messageRecipientIgnoreList.add(MessageRecipient(profileId, recipientId, -1, readState, id))
|
||||
}
|
||||
|
||||
val addedDateEl = item.select("td:eq(3) small").first()
|
||||
val addedDate = Date.fromIsoHm(addedDateEl?.text())
|
||||
val addedDateEl = item.select("td:eq(3)").first()
|
||||
val (date, time) = data.parseDateTime(addedDateEl?.text()?.trim() ?: "")
|
||||
if (date.month > currentMonth) {
|
||||
currentYear--
|
||||
}
|
||||
currentMonth = date.month
|
||||
date.year = currentYear
|
||||
|
||||
val message = Message(
|
||||
profileId = profileId,
|
||||
@ -79,7 +90,7 @@ class MobidziennikWebMessagesSent(override val data: DataMobidziennik,
|
||||
subject = subject,
|
||||
body = null,
|
||||
senderId = null,
|
||||
addedDate = addedDate
|
||||
addedDate = date.combineWith(time)
|
||||
)
|
||||
|
||||
if (hasAttachments)
|
||||
|
@ -46,6 +46,6 @@ object Signing {
|
||||
|
||||
/*fun provideKey(param1: String, param2: Long): ByteArray {*/
|
||||
fun pleaseStopRightNow(param1: String, param2: Long): ByteArray {
|
||||
return "$param1.MTIzNDU2Nzg5MDlc1YQl9S===.$param2".sha256()
|
||||
return "$param1.MTIzNDU2Nzg5MDMIlcxGrq===.$param2".sha256()
|
||||
}
|
||||
}
|
||||
|
@ -857,7 +857,7 @@
|
||||
<string name="settings_about_licenses_text">Open-Source-Lizenzen</string>
|
||||
<string name="settings_about_privacy_policy_text">Datenschutzrichtlinie</string>
|
||||
<string name="settings_card_register_title">E-Klassenbuch</string>
|
||||
<string name="settings_about_title_subtext">© Kuba Szczodrzyński && Kacper Ziubryniewicz\nSeptember 2018 - Oktober 2021</string>
|
||||
<string name="settings_about_title_subtext">© Kuba Szczodrzyński && Kacper Ziubryniewicz\nSeptember 2018 - 2022</string>
|
||||
<string name="settings_about_update_subtext">Klicken Sie hier, um nach Aktualisierungen zu suchen</string>
|
||||
<string name="settings_about_update_text">Aktualisierung</string>
|
||||
<string name="settings_about_version_text">Version</string>
|
||||
|
@ -348,7 +348,7 @@
|
||||
<string name="event_information">information</string>
|
||||
<string name="event_list_added_by_format">Added %1$s by %2$s%3$s</string>
|
||||
<string name="event_list_added_by_self_format">Added %1$s by you%3$s</string>
|
||||
<string name="event_list_added_by_unknown_format">Adde %1$s%3$s</string>
|
||||
<string name="event_list_added_by_unknown_format">Added %1$s%3$s</string>
|
||||
<string name="event_list_shared_by_format">{cmd-share-variant} %1$s by %2$s%3$s</string>
|
||||
<string name="event_list_shared_by_self_format">{cmd-share-variant} %1$s by you%3$s</string>
|
||||
<string name="event_manual_remove">Removing event…</string>
|
||||
@ -859,7 +859,7 @@
|
||||
<string name="settings_about_licenses_text">Open-source licenses</string>
|
||||
<string name="settings_about_privacy_policy_text">Privacy policy</string>
|
||||
<string name="settings_card_register_title">E-register</string>
|
||||
<string name="settings_about_title_subtext">© Kuba Szczodrzyński && Kacper Ziubryniewicz\nSeptember 2018 - October 2021</string>
|
||||
<string name="settings_about_title_subtext">© Kuba Szczodrzyński && Kacper Ziubryniewicz\nSeptember 2018 - 2022</string>
|
||||
<string name="settings_about_update_subtext">Click to check for updates</string>
|
||||
<string name="settings_about_update_text">Update</string>
|
||||
<string name="settings_about_version_text">Version</string>
|
||||
|
@ -926,7 +926,7 @@
|
||||
<string name="settings_about_licenses_text">Licencje open-source</string>
|
||||
<string name="settings_about_privacy_policy_text">Polityka prywatności</string>
|
||||
<string name="settings_card_register_title">E-dziennik</string>
|
||||
<string name="settings_about_title_subtext">© Kuba Szczodrzyński && Kacper Ziubryniewicz\nwrzesień 2018 - październik 2021</string>
|
||||
<string name="settings_about_title_subtext">© Kuba Szczodrzyński && Kacper Ziubryniewicz\nwrzesień 2018 - 2022</string>
|
||||
<string name="settings_about_update_subtext">Kliknij, aby sprawdzić aktualizacje</string>
|
||||
<string name="settings_about_update_text">Aktualizacja</string>
|
||||
<string name="settings_about_version_text">Wersja</string>
|
||||
|
@ -5,8 +5,8 @@ buildscript {
|
||||
kotlin_version = '1.5.30'
|
||||
|
||||
release = [
|
||||
versionName: "4.11",
|
||||
versionCode: 4110099
|
||||
versionName: "4.11.2",
|
||||
versionCode: 4110299
|
||||
]
|
||||
|
||||
setup = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user