mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 04:46:44 -06:00
Merge branch 'master' into develop
This commit is contained in:
commit
095403cc76
@ -1,8 +1,6 @@
|
|||||||
<h3>Wersja 4.13.6, 2023-03-24</h3>
|
<h3>Wersja 4.13.7, 2024-07-08</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Naprawiono pobieranie załączników na Androidzie 13 i nowszym.</li>
|
<li>Dodano opcję uruchomienia aplikacji bez logowania.</li>
|
||||||
<li>Dodano opcję odświeżenia planu lekcji na wybrany tydzień.</li>
|
|
||||||
<li>Usunięto błędy logowania. @BxOxSxS</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
/*secret password - removed for source code publication*/
|
/*secret password - removed for source code publication*/
|
||||||
static toys AES_IV[16] = {
|
static toys AES_IV[16] = {
|
||||||
0x6d, 0xa5, 0x32, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
0x0e, 0x87, 0x6d, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||||
|
|
||||||
unsigned char *agony(unsigned int laugh, unsigned char *box, unsigned char *heat);
|
unsigned char *agony(unsigned int laugh, unsigned char *box, unsigned char *heat);
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import org.greenrobot.eventbus.EventBus
|
|||||||
import pl.szczodrzynski.edziennik.App
|
import pl.szczodrzynski.edziennik.App
|
||||||
import pl.szczodrzynski.edziennik.R
|
import pl.szczodrzynski.edziennik.R
|
||||||
import pl.szczodrzynski.edziennik.data.api.ERROR_PROFILE_ARCHIVED
|
import pl.szczodrzynski.edziennik.data.api.ERROR_PROFILE_ARCHIVED
|
||||||
|
import pl.szczodrzynski.edziennik.data.api.edziennik.demo.Demo
|
||||||
import pl.szczodrzynski.edziennik.data.api.edziennik.librus.Librus
|
import pl.szczodrzynski.edziennik.data.api.edziennik.librus.Librus
|
||||||
import pl.szczodrzynski.edziennik.data.api.edziennik.mobidziennik.Mobidziennik
|
import pl.szczodrzynski.edziennik.data.api.edziennik.mobidziennik.Mobidziennik
|
||||||
import pl.szczodrzynski.edziennik.data.api.edziennik.podlasie.Podlasie
|
import pl.szczodrzynski.edziennik.data.api.edziennik.podlasie.Podlasie
|
||||||
@ -120,6 +121,7 @@ open class EdziennikTask(override val profileId: Int, val request: Any) : IApiTa
|
|||||||
LoginType.PODLASIE -> Podlasie(app, profile, loginStore, taskCallback)
|
LoginType.PODLASIE -> Podlasie(app, profile, loginStore, taskCallback)
|
||||||
LoginType.TEMPLATE -> Template(app, profile, loginStore, taskCallback)
|
LoginType.TEMPLATE -> Template(app, profile, loginStore, taskCallback)
|
||||||
LoginType.USOS -> Usos(app, profile, loginStore, taskCallback)
|
LoginType.USOS -> Usos(app, profile, loginStore, taskCallback)
|
||||||
|
LoginType.DEMO -> Demo(app, profile, loginStore, taskCallback)
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
if (edziennikInterface == null) {
|
if (edziennikInterface == null) {
|
||||||
|
@ -0,0 +1,84 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Kuba Szczodrzyński 2024-7-8.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package pl.szczodrzynski.edziennik.data.api.edziennik.demo
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject
|
||||||
|
import org.greenrobot.eventbus.EventBus
|
||||||
|
import pl.szczodrzynski.edziennik.App
|
||||||
|
import pl.szczodrzynski.edziennik.data.api.events.FirstLoginFinishedEvent
|
||||||
|
import pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikCallback
|
||||||
|
import pl.szczodrzynski.edziennik.data.api.interfaces.EdziennikInterface
|
||||||
|
import pl.szczodrzynski.edziennik.data.db.entity.LoginStore
|
||||||
|
import pl.szczodrzynski.edziennik.data.db.entity.Profile
|
||||||
|
import pl.szczodrzynski.edziennik.data.db.entity.Teacher
|
||||||
|
import pl.szczodrzynski.edziennik.data.db.full.AnnouncementFull
|
||||||
|
import pl.szczodrzynski.edziennik.data.db.full.EventFull
|
||||||
|
import pl.szczodrzynski.edziennik.data.db.full.MessageFull
|
||||||
|
import pl.szczodrzynski.edziennik.data.enums.FeatureType
|
||||||
|
import pl.szczodrzynski.edziennik.data.enums.LoginType
|
||||||
|
|
||||||
|
class Demo(
|
||||||
|
val app: App,
|
||||||
|
val profile: Profile?,
|
||||||
|
val loginStore: LoginStore,
|
||||||
|
val callback: EdziennikCallback,
|
||||||
|
) : EdziennikInterface {
|
||||||
|
|
||||||
|
private fun completed() {
|
||||||
|
callback.onCompleted()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun sync(
|
||||||
|
featureTypes: Set<FeatureType>?,
|
||||||
|
onlyEndpoints: Set<Int>?,
|
||||||
|
arguments: JsonObject?,
|
||||||
|
) = completed()
|
||||||
|
|
||||||
|
override fun getMessage(message: MessageFull) =
|
||||||
|
completed()
|
||||||
|
|
||||||
|
override fun sendMessage(recipients: Set<Teacher>, subject: String, text: String) =
|
||||||
|
completed()
|
||||||
|
|
||||||
|
override fun markAllAnnouncementsAsRead() =
|
||||||
|
completed()
|
||||||
|
|
||||||
|
override fun getAnnouncement(announcement: AnnouncementFull) =
|
||||||
|
completed()
|
||||||
|
|
||||||
|
override fun getAttachment(owner: Any, attachmentId: Long, attachmentName: String) =
|
||||||
|
completed()
|
||||||
|
|
||||||
|
override fun getRecipientList() =
|
||||||
|
completed()
|
||||||
|
|
||||||
|
override fun getEvent(eventFull: EventFull) =
|
||||||
|
completed()
|
||||||
|
|
||||||
|
override fun firstLogin() {
|
||||||
|
val profile = Profile(
|
||||||
|
id = loginStore.id,
|
||||||
|
loginStoreId = loginStore.id,
|
||||||
|
loginStoreType = LoginType.DEMO,
|
||||||
|
name = "Jan Szkolny",
|
||||||
|
subname = "Szkolny.eu",
|
||||||
|
studentNameLong = "Jan Szkolny",
|
||||||
|
studentNameShort = "Jan S.",
|
||||||
|
accountName = null,
|
||||||
|
)
|
||||||
|
profile.apply {
|
||||||
|
empty = false
|
||||||
|
syncEnabled = false
|
||||||
|
registration = Profile.REGISTRATION_DISABLED
|
||||||
|
studentClassName = "1A"
|
||||||
|
userCode = "nologin:1234"
|
||||||
|
dateYearEnd.month = 8
|
||||||
|
}
|
||||||
|
EventBus.getDefault().postSticky(FirstLoginFinishedEvent(listOf(profile), loginStore))
|
||||||
|
completed()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun cancel() {}
|
||||||
|
}
|
@ -47,6 +47,6 @@ object Signing {
|
|||||||
|
|
||||||
/*fun provideKey(param1: String, param2: Long): ByteArray {*/
|
/*fun provideKey(param1: String, param2: Long): ByteArray {*/
|
||||||
fun pleaseStopRightNow(param1: String, param2: Long): ByteArray {
|
fun pleaseStopRightNow(param1: String, param2: Long): ByteArray {
|
||||||
return "$param1.MTIzNDU2Nzg5MD01uMP7oW===.$param2".sha256()
|
return "$param1.MTIzNDU2Nzg5MD0WAYwfGc===.$param2".sha256()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,4 +17,5 @@ enum class LoginMode(
|
|||||||
VULCAN_HEBE(LoginType.VULCAN, id = 402),
|
VULCAN_HEBE(LoginType.VULCAN, id = 402),
|
||||||
PODLASIE_API(LoginType.PODLASIE, id = 600),
|
PODLASIE_API(LoginType.PODLASIE, id = 600),
|
||||||
USOS_OAUTH(LoginType.USOS, id = 700),
|
USOS_OAUTH(LoginType.USOS, id = 700),
|
||||||
|
DEMO(LoginType.DEMO, id = 800),
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ enum class LoginType(
|
|||||||
VULCAN(id = 4, features = FEATURES_VULCAN),
|
VULCAN(id = 4, features = FEATURES_VULCAN),
|
||||||
PODLASIE(id = 6, features = FEATURES_PODLASIE),
|
PODLASIE(id = 6, features = FEATURES_PODLASIE),
|
||||||
USOS(id = 7, features = FEATURES_USOS, schoolType = SchoolType.UNIVERSITY),
|
USOS(id = 7, features = FEATURES_USOS, schoolType = SchoolType.UNIVERSITY),
|
||||||
DEMO(id = 20, features = setOf()),
|
DEMO(id = 8, features = setOf()),
|
||||||
TEMPLATE(id = 21, features = setOf()),
|
TEMPLATE(id = 21, features = setOf()),
|
||||||
|
|
||||||
// the graveyard
|
// the graveyard
|
||||||
|
@ -17,6 +17,7 @@ import pl.szczodrzynski.edziennik.R
|
|||||||
import pl.szczodrzynski.edziennik.data.config.AppData
|
import pl.szczodrzynski.edziennik.data.config.AppData
|
||||||
import pl.szczodrzynski.edziennik.data.db.entity.Profile
|
import pl.szczodrzynski.edziennik.data.db.entity.Profile
|
||||||
import pl.szczodrzynski.edziennik.data.enums.FeatureType
|
import pl.szczodrzynski.edziennik.data.enums.FeatureType
|
||||||
|
import pl.szczodrzynski.edziennik.data.enums.LoginType
|
||||||
import pl.szczodrzynski.edziennik.utils.ProfileImageHolder
|
import pl.szczodrzynski.edziennik.utils.ProfileImageHolder
|
||||||
import pl.szczodrzynski.edziennik.utils.models.Date
|
import pl.szczodrzynski.edziennik.utils.models.Date
|
||||||
import pl.szczodrzynski.navlib.ImageHolder
|
import pl.szczodrzynski.navlib.ImageHolder
|
||||||
@ -71,6 +72,8 @@ fun Profile.getAppData() =
|
|||||||
if (App.profileId == this.id) App.data else AppData.get(this.loginStoreType)
|
if (App.profileId == this.id) App.data else AppData.get(this.loginStoreType)
|
||||||
|
|
||||||
fun Profile.shouldArchive(): Boolean {
|
fun Profile.shouldArchive(): Boolean {
|
||||||
|
if (loginStoreType == LoginType.DEMO)
|
||||||
|
return false
|
||||||
// vulcan hotfix
|
// vulcan hotfix
|
||||||
if (dateYearEnd.month > 6) {
|
if (dateYearEnd.month > 6) {
|
||||||
dateYearEnd.month = 6
|
dateYearEnd.month = 6
|
||||||
|
@ -209,7 +209,7 @@ class LoginChooserFragment : Fragment(), CoroutineScope {
|
|||||||
adapter.items.removeAll { it !is LoginInfo.Register }
|
adapter.items.removeAll { it !is LoginInfo.Register }
|
||||||
adapter.items.add(
|
adapter.items.add(
|
||||||
LoginInfo.Register(
|
LoginInfo.Register(
|
||||||
loginType = LoginType.DEMO,
|
loginType = LoginType.TEMPLATE,
|
||||||
registerName = R.string.eggs,
|
registerName = R.string.eggs,
|
||||||
registerLogo = R.drawable.face_1,
|
registerLogo = R.drawable.face_1,
|
||||||
loginModes = listOf(
|
loginModes = listOf(
|
||||||
@ -253,13 +253,13 @@ class LoginChooserFragment : Fragment(), CoroutineScope {
|
|||||||
loginType: LoginInfo.Register,
|
loginType: LoginInfo.Register,
|
||||||
loginMode: LoginInfo.Mode
|
loginMode: LoginInfo.Mode
|
||||||
) {
|
) {
|
||||||
if (loginType.loginType == LoginType.DEMO) {
|
|
||||||
nav.navigate(R.id.loginEggsFragment, null, activity.navOptions)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (loginType.loginType == LoginType.TEMPLATE) {
|
if (loginType.loginType == LoginType.TEMPLATE) {
|
||||||
|
when (loginType.registerName) {
|
||||||
|
R.string.eggs ->
|
||||||
|
nav.navigate(R.id.loginEggsFragment, null, activity.navOptions)
|
||||||
|
R.string.menu_lab ->
|
||||||
nav.navigate(R.id.labFragment, null, activity.navOptions)
|
nav.navigate(R.id.labFragment, null, activity.navOptions)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,6 +328,21 @@ object LoginInfo {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Register(
|
||||||
|
loginType = LoginType.DEMO,
|
||||||
|
registerName = R.string.login_type_demo,
|
||||||
|
registerLogo = R.mipmap.ic_launcher_v5,
|
||||||
|
loginModes = listOf(
|
||||||
|
Mode(
|
||||||
|
loginMode = LoginMode.DEMO,
|
||||||
|
name = R.string.login_mode_demo,
|
||||||
|
icon = R.mipmap.ic_launcher_v5,
|
||||||
|
guideText = R.string.login_mode_demo,
|
||||||
|
credentials = listOf(),
|
||||||
|
errorCodes = mapOf(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1434,4 +1434,6 @@
|
|||||||
<string name="menu_agenda_config">Agenda settings</string>
|
<string name="menu_agenda_config">Agenda settings</string>
|
||||||
<string name="registration_config_note_sharing_title">Share notes</string>
|
<string name="registration_config_note_sharing_title">Share notes</string>
|
||||||
<string name="home_timetable_all_lessons">All lessons:</string>
|
<string name="home_timetable_all_lessons">All lessons:</string>
|
||||||
|
<string name="login_type_demo">Use without login</string>
|
||||||
|
<string name="login_mode_demo">Demo version</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1554,6 +1554,8 @@
|
|||||||
<string name="home_timetable_all_lessons">Wszystkie lekcje:</string>
|
<string name="home_timetable_all_lessons">Wszystkie lekcje:</string>
|
||||||
<string name="agenda_config_subject_important">Wyświetl nazwę przedmiotu zamiast rodzaju</string>
|
<string name="agenda_config_subject_important">Wyświetl nazwę przedmiotu zamiast rodzaju</string>
|
||||||
<string name="menu_timetable_sync">Odśwież wybrany tydzień</string>
|
<string name="menu_timetable_sync">Odśwież wybrany tydzień</string>
|
||||||
|
<string name="login_type_demo">Użyj bez logowania</string>
|
||||||
|
<string name="login_mode_demo">Wersja demonstracyjna</string>
|
||||||
<string name="theme_default">Zwyczajny</string>
|
<string name="theme_default">Zwyczajny</string>
|
||||||
<string name="theme_teal">Morski</string>
|
<string name="theme_teal">Morski</string>
|
||||||
<string name="theme_green">Zielony</string>
|
<string name="theme_green">Zielony</string>
|
||||||
|
@ -5,8 +5,8 @@ buildscript {
|
|||||||
kotlin_version = '1.9.24'
|
kotlin_version = '1.9.24'
|
||||||
|
|
||||||
release = [
|
release = [
|
||||||
versionName: "4.13.6",
|
versionName: "4.13.7",
|
||||||
versionCode: 4130699
|
versionCode: 4130799
|
||||||
]
|
]
|
||||||
|
|
||||||
setup = [
|
setup = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user