Compare commits

..

No commits in common. "cb553b1a33b2390bc8ae89cbcd37ae8adbb2c9c7" and "f2857bdece93437212bdb9bece3407725b1931ec" have entirely different histories.

24 changed files with 137 additions and 249 deletions

View File

@ -8,34 +8,30 @@
* Skrýt komentáře. * Skrýt komentáře.
* falešná docházka % * falešná docházka %
Chcete-li se dostat na skrytý panel: Přístup ke skrytému panelu:
1. Přejděte na kartu „Další“. 1. přejděte na záložku "Více".
2. Přejděte na panel „Nastavení“. 2. přejděte na panel "Nastavení".
3. Přejděte na panel „O aplikaci“. 3. přejděte na panel "O aplikaci".
4. Klikněte 5x na logo aplikace 4. klikněte pětkrát na logo aplikace
5. Přejděte na domovskou obrazovku 5. přejděte zpět do nastavení (budete muset obnovit zobrazení, přejít na domovskou obrazovku a vrátit se do nastavení).
6. Přejděte do nastavení
7. Zadejte „tajná nastavení“
# Instalace # Instalace
Legenda:
| Název souboru | Přizpůsobeno | - `*-fdroid-*` - verze přizpůsobená F-Droid
| ---------------- | ----------------- | - `*-hms-*` - verze přizpůsobená Huawei AppGallery
| `*-fdroid-*.apk` | F-Droid | - `*-play-*` - verze přizpůsobená Obchodu Play
| `*-hms-*.apk` | Huawei AppGallery |
| `*-play-*.apk` | Play Store |
1. Vydaná verze (**doporučeno pro většinu uživatelů**): - Verze vydání (**doporučeno pro většinu uživatelů**)
Stáhněte si vybranou verzi z [releases](https://git.sador.me/sadorowo/wulkanowy-mod/releases). Stáhněte si vybranou verzi z [releases](https://git.sador.me/sadorowo/wulkanowy-mod/releases).
Doporučujeme stáhnout nejnovější dostupnou verzi. Doporučujeme stáhnout nejnovější dostupnou verzi.
- Verze ladění (pro lidi, kteří chtějí ladit aplikaci, zejména požadavky na server VULCAN)
2. Verze ladění (pro lidi, kteří chtějí ladit aplikaci, zejména požadavky na server VULCAN):
Přejděte [sem](https://git.sador.me/sadorowo/wulkanowy-mod/actions?workflow=build_android_debug.yml).
Přejděte [sem](https://git.sador.me/sadorowo/wulkanowy-mod/actions?workflow=build_android_debug.yml). Přejděte na první výsledek shora nebo vyberte verzi DEV, kterou chcete stáhnout.
Přejděte na první výsledek shora nebo vyberte verzi DEV, kterou chcete stáhnout. Stáhněte si vybranou verzi ze souborů vygenerovaných při sestavování aplikace.
Stáhněte si vybranou verzi ze souborů vygenerovaných při sestavování aplikace.
> Chcete si přečíst více o projektu Wulkanowy?
# O projektu Wulkanowy >
> [Klikněte zde](https://github.com/wulkanowy/wulkanowy)
Chcete si přečíst více o projektu Wulkanowy? [Klikněte sem](https://github.com/wulkanowy/wulkanowy)

View File

@ -8,34 +8,30 @@
* Kommentare ausblenden. * Kommentare ausblenden.
* Anwesenheit fälschen % * Anwesenheit fälschen %
So gelangen Sie zum ausgeblendeten Bereich: So greifen Sie auf das verborgene Panel zu:
1. Gehen Sie zur Registerkarte „Mehr“. 1. Gehen Sie auf die Registerkarte "Mehr".
2. Gehen Sie zum Bereich „Einstellungen“. 2. Gehen Sie zum Bereich "Einstellungen".
3. Gehen Sie zum Bereich „Über die Anwendung“. 3. Gehen Sie auf das Feld "Über die Anwendung".
4. Klicken Sie fünfmal auf das Anwendungslogo 4. Klicken Sie 5 Mal auf das Logo der Anwendung
5. Gehen Sie zum Startbildschirm 5. Gehen Sie zurück zu den Einstellungen (Sie müssen die Ansicht aktualisieren, zum Startbildschirm wechseln und zu den Einstellungen zurückkehren)
6. Gehen Sie zu den Einstellungen
7. Geben Sie „Geheime Einstellungen“ ein
# Installation # Installation
Legende:
| Dateiname | Angepasst an | - `*-fdroid-*` an F-Droid angepasste Version
| ---------------- | ----------------- | - `*-hms-*` an Huawei AppGallery angepasste Version
| `*-fdroid-*.apk` | F-Droid | - `*-play-*` an den Play Store angepasste Version
| `*-hms-*.apk` | Huawei AppGallery |
| `*-play-*.apk` | Play Store |
1. Release-Version (**empfohlen für die meisten Benutzer**): - Release-Version (**für die meisten Benutzer empfohlen**)
Laden Sie die ausgewählte Version von [releases](https://git.sador.me/sadorowo/wulkanowy-mod/releases) herunter.
Wir empfehlen, die neueste verfügbare Version herunterzuladen.
- Debug-Version (für Leute, die die Anwendung debuggen möchten, insbesondere Anfragen an den VULCAN-Server)
Gehen Sie [hier](https://git.sador.me/sadorowo/wulkanowy-mod/actions?workflow=build_android_debug.yml).
Gehen Sie zum ersten Ergebnis von oben oder wählen Sie die DEV-Version aus, die Sie herunterladen möchten.
Laden Sie die ausgewählte Version aus den beim Erstellen der Anwendung generierten Dateien herunter.
Laden Sie die ausgewählte Version von [releases](https://git.sador.me/sadorowo/wulkanowy-mod/releases) herunter. > Möchten Sie mehr über das Wulkanowy-Projekt lesen?
Wir empfehlen, die neueste verfügbare Version herunterzuladen. >
> [Klicken Sie hier](https://github.com/wulkanowy/wulkanowy)
2. Debug-Version (für Leute, die die Anwendung debuggen möchten, insbesondere Anfragen an den VULCAN-Server):
Gehen Sie [hier](https://git.sador.me/sadorowo/wulkanowy-mod/actions?workflow=build_android_debug.yml).
Gehen Sie zum ersten Ergebnis von oben oder wählen Sie die DEV-Version aus, die Sie herunterladen möchten.
Laden Sie die ausgewählte Version aus den beim Erstellen der Anwendung generierten Dateien herunter.
# Über das Wulkanowy-Projekt
Möchten Sie mehr über das Wulkanowy-Projekt lesen? [Hier klicken](https://github.com/wulkanowy/wulkanowy)

View File

@ -9,33 +9,29 @@
* fake attendance %. * fake attendance %.
To get to the hidden panel: To get to the hidden panel:
1. Go to the "More" tab 1. go to the "More" tab
2. Go to the "Settings" panel 2. go to the "Settings" panel
3. Go to the "About application" panel 3. go to the "About application" panel
4. Click on the application logo 5 times 4. click 5 times on the application logo
5. Go to the home screen 5. go back to settings (a refresh of the view will be required, go to the home screen and return to settings)
6. Go to settings
7. Enter "secret settings"
# Installation # Installation
Legend:
| File name | Adapted to | - `*-fdroid-*` - version adapted to F-Droid
| ---------------- | ----------------- | - `*-hms-*` - version adapted to Huawei AppGallery
| `*-fdroid-*.apk` | F-Droid | - `*-play-*` - version adapted to the Play Store
| `*-hms-*.apk` | Huawei AppGallery |
| `*-play-*.apk` | Play Store |
1. Release version (**recommended for most users**): - Release version (**recommended for most users**)
Download the selected version from [releases](https://git.sador.me/sadorowo/wulkanowy-mod/releases).
We recommend downloading the latest available version.
- Debug version (for people who want to debug the application, especially requests to the VULCAN server)
Go [here](https://git.sador.me/sadorowo/wulkanowy-mod/actions?workflow=build_android_debug.yml).
Go to the first result from the top or select the DEV version you want to download.
Download the selected version from artifacts generated when building the application.
Download the selected version from [releases](https://git.sador.me/sadorowo/wulkanowy-mod/releases). > Do you want to read more about the Wulkanowy project?
We recommend downloading the latest available version. >
> [Click here](https://github.com/wulkanowy/wulkanowy)
2. Debug version (for people who want to debug the application, especially requests to the VULCAN server):
Go [here](https://git.sador.me/sadorowo/wulkanowy-mod/actions?workflow=build_android_debug.yml).
Go to the first result from the top or select the DEV version you want to download.
Download the selected version from the files generated when building the application.
# About the Wulkanowy project
Want to read more about the Wulkanowy project? [Click here](https://github.com/wulkanowy/wulkanowy)

View File

@ -13,29 +13,25 @@ Aby dostać się do ukrytego panelu:
2. Przejdź do panelu "Ustawienia" 2. Przejdź do panelu "Ustawienia"
3. Przejdź do panelu "O aplikacji" 3. Przejdź do panelu "O aplikacji"
4. Kliknij 5 razy w logo aplikacji 4. Kliknij 5 razy w logo aplikacji
5. Przejdź na ekran główny 5. Wróć do ustawień (wymagane będzie odświeżenie widoku, przejdź na ekran główny i wróć do ustawień)
6. Wejdź w ustawienia
7. Wejdź w "sekretne ustawienia"
# Instalacja # Instalacja
Legenda:
| Nazwa pliku | Przystosowana do | - `*-fdroid-*` - wersja przystosowana do F-Droid
| ---------------- | ----------------- | - `*-hms-*` - wersja przystosowana do Huawei AppGallery
| `*-fdroid-*.apk` | F-Droid | - `*-play-*` - wersja przystosowana do Play Store
| `*-hms-*.apk` | Huawei AppGallery |
| `*-play-*.apk` | Sklep Play |
1. Wersja release (**zalecana dla większości użytkowników**): - Wersja release (**zalecana dla większości użytkowników**)
Pobierz wybraną wersję z [wydań](https://git.sador.me/sadorowo/wulkanowy-mod/releases).
Zalecamy pobranie najnowszej dostępnej wersji.
- Wersja debug (dla osób chcących debugować aplikację, a w szczególności żądania do serwera VULCANa)
Udaj się [tutaj](https://git.sador.me/sadorowo/wulkanowy-mod/actions?workflow=build_android_debug.yml).
Wejdź na pierwszy wynik od góry, bądź wybierz wersję DEV którą chcesz pobrać.
Pobierz wybraną wersję z plików wygenerowanych podczas budowania aplikacji.
Pobierz wybraną wersję z [wydań](https://git.sador.me/sadorowo/wulkanowy-mod/releases). > Chcesz poczytać więcej o projekcie Wulkanowy?
Zalecamy pobranie najnowszej dostępnej wersji. >
> [Kliknij tutaj](https://github.com/wulkanowy/wulkanowy)
2. Wersja debug (dla osób chcących debugować aplikację, a w szczególności żądania do serwera VULCANa):
Udaj się [tutaj](https://git.sador.me/sadorowo/wulkanowy-mod/actions?workflow=build_android_debug.yml).
Wejdź na pierwszy wynik od góry, bądź wybierz wersję DEV którą chcesz pobrać.
Pobierz wybraną wersję z plików wygenerowanych podczas budowania aplikacji.
# O projekcie Wulkanowy
Chcesz poczytać więcej o projekcie Wulkanowy? [Kliknij tutaj](https://github.com/wulkanowy/wulkanowy)

View File

@ -8,34 +8,30 @@
* Skryť komentáre. * Skryť komentáre.
* falošná dochádzka % * falošná dochádzka %
Ak chcete prejsť na skrytý panel: Prístup k skrytému panelu:
1. Prejdite na kartu „Viac“. 1. prejdite na kartu "Viac".
2. Prejdite na panel „Nastavenia“. 2. prejdite na panel "Nastavenia".
3. Prejdite na panel „O aplikácii“. 3. prejdite na panel "O aplikácii"
4. Kliknite 5-krát na logo aplikácie 4. 5-krát kliknite na logo aplikácie
5. Prejdite na domovskú obrazovku 5. vráťte sa do nastavení (budete musieť obnoviť zobrazenie, prejsť na domovskú obrazovku a vrátiť sa do nastavení)
6. Prejdite do nastavení
7. Zadajte „tajné nastavenia“
# Inštalácia # Inštalácia
Legenda:
| Názov súboru | Prispôsobené | - `*-fdroid-*` - verzia prispôsobená pre F-Droid
| ---------------- | ----------------- | - `*-hms-*` - verzia prispôsobená Huawei AppGallery
| `*-fdroid-*.apk` | F-Droid | - `*-play-*` - verzia prispôsobená Obchodu Play
| `*-hms-*.apk` | Huawei AppGallery |
| `*-play-*.apk` | Play Store |
1. Verzia vydania (**odporúčané pre väčšinu používateľov**): - Verzia vydania (**odporúčané pre väčšinu používateľov**)
Stiahnite si vybranú verziu z [releases](https://git.sador.me/sadorowo/wulkanowy-mod/releases). Stiahnite si vybranú verziu z [releases](https://git.sador.me/sadorowo/wulkanowy-mod/releases).
Odporúčame stiahnuť najnovšiu dostupnú verziu. Odporúčame stiahnuť najnovšiu dostupnú verziu.
- Verzia ladenia (pre ľudí, ktorí chcú ladiť aplikáciu, najmä požiadavky na server VULCAN)
Choďte [sem](https://git.sador.me/sadorowo/wulkanowy-mod/actions?workflow=build_android_debug.yml).
Prejdite na prvý výsledok zhora alebo vyberte verziu DEV, ktorú chcete stiahnuť.
Stiahnite si vybranú verziu zo súborov vygenerovaných pri zostavovaní aplikácie.
2. Verzia ladenia (pre ľudí, ktorí chcú ladiť aplikáciu, najmä požiadavky na server VULCAN): > Chcete si prečítať viac o projekte Wulkanowy?
>
Choďte [sem](https://git.sador.me/sadorowo/wulkanowy-mod/actions?workflow=build_android_debug.yml). > [Kliknite sem](https://github.com/wulkanowy/wulkanowy)
Prejdite na prvý výsledok zhora alebo vyberte verziu DEV, ktorú chcete stiahnuť.
Stiahnite si vybranú verziu zo súborov vygenerovaných pri zostavovaní aplikácie.
# O projekte Wulkanowy
Chcete si prečítať viac o projekte Wulkanowy? [Kliknite sem](https://github.com/wulkanowy/wulkanowy)

View File

@ -27,8 +27,8 @@ android {
testApplicationId "io.github.tests.wulkanowy" testApplicationId "io.github.tests.wulkanowy"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 34 targetSdkVersion 34
versionCode 165 versionCode 164
versionName "2.6.5" versionName "2.6.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resValue "string", "app_name", "Wulkanowy" resValue "string", "app_name", "Wulkanowy"
@ -161,7 +161,7 @@ play {
track = 'production' track = 'production'
releaseStatus = ReleaseStatus.IN_PROGRESS releaseStatus = ReleaseStatus.IN_PROGRESS
userFraction = 0.99d userFraction = 0.99d
updatePriority = 3 updatePriority = 4
enabled.set(false) enabled.set(false)
} }
@ -191,7 +191,7 @@ ext {
} }
dependencies { dependencies {
implementation 'io.github.wulkanowy:sdk:2.6.4' implementation 'io.github.wulkanowy:sdk:2.6.3'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'

View File

@ -13,8 +13,8 @@ import dagger.Provides
import dagger.hilt.InstallIn import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent import dagger.hilt.components.SingletonComponent
import io.github.wulkanowy.data.api.services.SchoolsService import io.github.wulkanowy.data.api.AdminMessageService
import io.github.wulkanowy.data.api.services.WulkanowyService import io.github.wulkanowy.data.api.SchoolsService
import io.github.wulkanowy.data.db.AppDatabase import io.github.wulkanowy.data.db.AppDatabase
import io.github.wulkanowy.data.db.SharedPrefProvider import io.github.wulkanowy.data.db.SharedPrefProvider
import io.github.wulkanowy.data.repositories.PreferencesRepository import io.github.wulkanowy.data.repositories.PreferencesRepository
@ -71,7 +71,7 @@ internal class DataModule {
okHttpClient: OkHttpClient, okHttpClient: OkHttpClient,
json: Json, json: Json,
appInfo: AppInfo appInfo: AppInfo
): WulkanowyService = Retrofit.Builder() ): AdminMessageService = Retrofit.Builder()
.baseUrl(appInfo.messagesBaseUrl) .baseUrl(appInfo.messagesBaseUrl)
.client(okHttpClient) .client(okHttpClient)
.addConverterFactory(json.asConverterFactory("application/json".toMediaType())) .addConverterFactory(json.asConverterFactory("application/json".toMediaType()))

View File

@ -5,7 +5,6 @@ import io.github.wulkanowy.data.db.dao.StudentDao
import io.github.wulkanowy.data.db.entities.Semester import io.github.wulkanowy.data.db.entities.Semester
import io.github.wulkanowy.data.db.entities.Student import io.github.wulkanowy.data.db.entities.Student
import io.github.wulkanowy.data.db.entities.StudentIsEduOne import io.github.wulkanowy.data.db.entities.StudentIsEduOne
import io.github.wulkanowy.data.repositories.WulkanowyRepository
import io.github.wulkanowy.sdk.Sdk import io.github.wulkanowy.sdk.Sdk
import io.github.wulkanowy.utils.RemoteConfigHelper import io.github.wulkanowy.utils.RemoteConfigHelper
import io.github.wulkanowy.utils.WebkitCookieManagerProxy import io.github.wulkanowy.utils.WebkitCookieManagerProxy
@ -21,7 +20,6 @@ class WulkanowySdkFactory @Inject constructor(
private val remoteConfig: RemoteConfigHelper, private val remoteConfig: RemoteConfigHelper,
private val webkitCookieManagerProxy: WebkitCookieManagerProxy, private val webkitCookieManagerProxy: WebkitCookieManagerProxy,
private val studentDb: StudentDao, private val studentDb: StudentDao,
private val wulkanowyRepository: WulkanowyRepository,
) { ) {
private val eduOneMutex = Mutex() private val eduOneMutex = Mutex()
@ -38,29 +36,14 @@ class WulkanowySdkFactory @Inject constructor(
addInterceptor(chuckerInterceptor, network = true) addInterceptor(chuckerInterceptor, network = true)
} }
fun createBase() = sdk fun create() = sdk
suspend fun create(): Sdk {
val mapping = wulkanowyRepository.getMapping()
return createBase().apply {
if (mapping != null) {
endpointsMapping = mapping.endpoints
vTokenMapping = mapping.vTokens
}
}
}
suspend fun create(student: Student, semester: Semester? = null): Sdk { suspend fun create(student: Student, semester: Semester? = null): Sdk {
val overrideIsEduOne = checkEduOneAndMigrateIfNecessary(student) val overrideIsEduOne = checkEduOneAndMigrateIfNecessary(student)
return buildSdk(student, semester, overrideIsEduOne) return buildSdk(student, semester, overrideIsEduOne)
} }
private suspend fun buildSdk( private fun buildSdk(student: Student, semester: Semester?, isStudentEduOne: Boolean): Sdk {
student: Student,
semester: Semester?,
isStudentEduOne: Boolean
): Sdk {
return create().apply { return create().apply {
email = student.email email = student.email
password = student.password password = student.password

View File

@ -1,16 +1,12 @@
package io.github.wulkanowy.data.api.services package io.github.wulkanowy.data.api
import io.github.wulkanowy.data.api.models.Mapping
import io.github.wulkanowy.data.db.entities.AdminMessage import io.github.wulkanowy.data.db.entities.AdminMessage
import retrofit2.http.GET import retrofit2.http.GET
import javax.inject.Singleton import javax.inject.Singleton
@Singleton @Singleton
interface WulkanowyService { interface AdminMessageService {
@GET("/v1.json") @GET("/v1.json")
suspend fun getAdminMessages(): List<AdminMessage> suspend fun getAdminMessages(): List<AdminMessage>
}
@GET("/mapping1.json")
suspend fun getMapping(): Mapping
}

View File

@ -1,4 +1,4 @@
package io.github.wulkanowy.data.api.services package io.github.wulkanowy.data.api
import io.github.wulkanowy.data.pojos.IntegrityRequest import io.github.wulkanowy.data.pojos.IntegrityRequest
import io.github.wulkanowy.data.pojos.LoginEvent import io.github.wulkanowy.data.pojos.LoginEvent

View File

@ -1,14 +0,0 @@
package io.github.wulkanowy.data.api.models
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class Mapping(
@SerialName("endpoints")
val endpoints: Map<String, Map<String, Map<String, String>>>,
@SerialName("vTokens")
val vTokens: Map<String, Map<String, Map<String, String>>>,
)

View File

@ -1,23 +1,20 @@
package io.github.wulkanowy.data.repositories package io.github.wulkanowy.data.repositories
import io.github.wulkanowy.data.Resource import io.github.wulkanowy.data.Resource
import io.github.wulkanowy.data.api.models.Mapping import io.github.wulkanowy.data.api.AdminMessageService
import io.github.wulkanowy.data.api.services.WulkanowyService
import io.github.wulkanowy.data.db.dao.AdminMessageDao import io.github.wulkanowy.data.db.dao.AdminMessageDao
import io.github.wulkanowy.data.db.entities.AdminMessage import io.github.wulkanowy.data.db.entities.AdminMessage
import io.github.wulkanowy.data.networkBoundResource import io.github.wulkanowy.data.networkBoundResource
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.filterNot import kotlinx.coroutines.flow.filterNot
import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.Mutex
import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
@Singleton @Singleton
class WulkanowyRepository @Inject constructor( class AdminMessageRepository @Inject constructor(
private val wulkanowyService: WulkanowyService, private val adminMessageService: AdminMessageService,
private val adminMessageDao: AdminMessageDao, private val adminMessageDao: AdminMessageDao,
private val preferencesRepository: PreferencesRepository,
) { ) {
private val saveFetchResultMutex = Mutex() private val saveFetchResultMutex = Mutex()
@ -27,28 +24,11 @@ class WulkanowyRepository @Inject constructor(
mutex = saveFetchResultMutex, mutex = saveFetchResultMutex,
isResultEmpty = { false }, isResultEmpty = { false },
query = { adminMessageDao.loadAll() }, query = { adminMessageDao.loadAll() },
fetch = { wulkanowyService.getAdminMessages() }, fetch = { adminMessageService.getAdminMessages() },
shouldFetch = { true }, shouldFetch = { true },
saveFetchResult = { oldItems, newItems -> saveFetchResult = { oldItems, newItems ->
adminMessageDao.removeOldAndSaveNew(oldItems, newItems) adminMessageDao.removeOldAndSaveNew(oldItems, newItems)
}, },
) )
.filterNot { it is Resource.Intermediate } .filterNot { it is Resource.Intermediate }
suspend fun getMapping(): Mapping? {
var savedMapping = preferencesRepository.mapping
if (savedMapping == null) {
fetchMapping()
savedMapping = preferencesRepository.mapping
}
return savedMapping
}
suspend fun fetchMapping() {
runCatching { wulkanowyService.getMapping() }
.onFailure { Timber.e(it) }
.onSuccess { preferencesRepository.mapping = it }
}
} }

View File

@ -10,7 +10,6 @@ import com.fredporciuncula.flow.preferences.Serializer
import com.fredporciuncula.flow.preferences.map import com.fredporciuncula.flow.preferences.map
import dagger.hilt.android.qualifiers.ApplicationContext import dagger.hilt.android.qualifiers.ApplicationContext
import io.github.wulkanowy.R import io.github.wulkanowy.R
import io.github.wulkanowy.data.api.models.Mapping
import io.github.wulkanowy.data.enums.AppTheme import io.github.wulkanowy.data.enums.AppTheme
import io.github.wulkanowy.data.enums.AttendanceCalculatorSortingMode import io.github.wulkanowy.data.enums.AttendanceCalculatorSortingMode
import io.github.wulkanowy.data.enums.GradeColorTheme import io.github.wulkanowy.data.enums.GradeColorTheme
@ -446,15 +445,6 @@ class PreferencesRepository @Inject constructor(
get() = sharedPref.getString(PREF_KEY_INSTALLATION_ID, null).orEmpty() get() = sharedPref.getString(PREF_KEY_INSTALLATION_ID, null).orEmpty()
private set(value) = sharedPref.edit { putString(PREF_KEY_INSTALLATION_ID, value) } private set(value) = sharedPref.edit { putString(PREF_KEY_INSTALLATION_ID, value) }
var mapping: Mapping?
get() {
val value = sharedPref.getString("mapping", null)
return value?.let { json.decodeFromString(it) }
}
set(value) = sharedPref.edit(commit = true) {
putString("mapping", value?.let { json.encodeToString(it) })
}
init { init {
if (installationId.isEmpty()) { if (installationId.isEmpty()) {
installationId = UUID.randomUUID().toString() installationId = UUID.randomUUID().toString()

View File

@ -1,7 +1,7 @@
package io.github.wulkanowy.data.repositories package io.github.wulkanowy.data.repositories
import io.github.wulkanowy.data.WulkanowySdkFactory import io.github.wulkanowy.data.WulkanowySdkFactory
import io.github.wulkanowy.data.api.services.SchoolsService import io.github.wulkanowy.data.api.SchoolsService
import io.github.wulkanowy.data.db.entities.Semester import io.github.wulkanowy.data.db.entities.Semester
import io.github.wulkanowy.data.db.entities.Student import io.github.wulkanowy.data.db.entities.Student
import io.github.wulkanowy.data.db.entities.StudentWithSemesters import io.github.wulkanowy.data.db.entities.StudentWithSemesters

View File

@ -5,14 +5,14 @@ import io.github.wulkanowy.data.db.entities.AdminMessage
import io.github.wulkanowy.data.db.entities.Student import io.github.wulkanowy.data.db.entities.Student
import io.github.wulkanowy.data.enums.MessageType import io.github.wulkanowy.data.enums.MessageType
import io.github.wulkanowy.data.mapResourceData import io.github.wulkanowy.data.mapResourceData
import io.github.wulkanowy.data.repositories.AdminMessageRepository
import io.github.wulkanowy.data.repositories.PreferencesRepository import io.github.wulkanowy.data.repositories.PreferencesRepository
import io.github.wulkanowy.data.repositories.WulkanowyRepository
import io.github.wulkanowy.utils.AppInfo import io.github.wulkanowy.utils.AppInfo
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import javax.inject.Inject import javax.inject.Inject
class GetAppropriateAdminMessageUseCase @Inject constructor( class GetAppropriateAdminMessageUseCase @Inject constructor(
private val wulkanowyRepository: WulkanowyRepository, private val adminMessageRepository: AdminMessageRepository,
private val preferencesRepository: PreferencesRepository, private val preferencesRepository: PreferencesRepository,
private val appInfo: AppInfo private val appInfo: AppInfo
) { ) {
@ -22,7 +22,7 @@ class GetAppropriateAdminMessageUseCase @Inject constructor(
} }
operator fun invoke(scrapperBaseUrl: String, type: MessageType): Flow<Resource<AdminMessage?>> { operator fun invoke(scrapperBaseUrl: String, type: MessageType): Flow<Resource<AdminMessage?>> {
return wulkanowyRepository.getAdminMessages().mapResourceData { adminMessages -> return adminMessageRepository.getAdminMessages().mapResourceData { adminMessages ->
adminMessages adminMessages
.asSequence() .asSequence()
.filter { it.isNotDismissed() } .filter { it.isNotDismissed() }

View File

@ -59,7 +59,7 @@ class CaptchaDialog : BaseDialogFragment<DialogCaptchaBinding>() {
webView = this webView = this
with(settings) { with(settings) {
javaScriptEnabled = true javaScriptEnabled = true
userAgentString = wulkanowySdkFactory.createBase().userAgent userAgentString = wulkanowySdkFactory.create().userAgent
} }
webViewClient = object : WebViewClient() { webViewClient = object : WebViewClient() {

View File

@ -118,6 +118,5 @@ class LoginActivity : BaseActivity<LoginPresenter, ActivityLoginBinding>(), Logi
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
inAppUpdateHelper.onResume() inAppUpdateHelper.onResume()
presenter.updateSdkMappings()
} }
} }

View File

@ -1,15 +1,12 @@
package io.github.wulkanowy.ui.modules.login package io.github.wulkanowy.ui.modules.login
import io.github.wulkanowy.data.repositories.StudentRepository import io.github.wulkanowy.data.repositories.StudentRepository
import io.github.wulkanowy.data.repositories.WulkanowyRepository
import io.github.wulkanowy.ui.base.BasePresenter import io.github.wulkanowy.ui.base.BasePresenter
import io.github.wulkanowy.ui.base.ErrorHandler import io.github.wulkanowy.ui.base.ErrorHandler
import kotlinx.coroutines.launch
import timber.log.Timber import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
class LoginPresenter @Inject constructor( class LoginPresenter @Inject constructor(
private val wulkanowyRepository: WulkanowyRepository,
errorHandler: ErrorHandler, errorHandler: ErrorHandler,
studentRepository: StudentRepository studentRepository: StudentRepository
) : BasePresenter<LoginView>(errorHandler, studentRepository) { ) : BasePresenter<LoginView>(errorHandler, studentRepository) {
@ -19,11 +16,4 @@ class LoginPresenter @Inject constructor(
view.initView() view.initView()
Timber.i("Login view was initialized") Timber.i("Login view was initialized")
} }
fun updateSdkMappings() {
presenterScope.launch {
runCatching { wulkanowyRepository.fetchMapping() }
.onFailure { Timber.e(it) }
}
}
} }

View File

@ -138,7 +138,6 @@ class MainActivity : BaseActivity<MainPresenter, ActivityMainBinding>(), MainVie
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
inAppUpdateHelper.onResume() inAppUpdateHelper.onResume()
presenter.updateSdkMappings()
} }
override fun onCreateOptionsMenu(menu: Menu): Boolean { override fun onCreateOptionsMenu(menu: Menu): Boolean {

View File

@ -6,7 +6,6 @@ import io.github.wulkanowy.data.onResourceError
import io.github.wulkanowy.data.onResourceSuccess import io.github.wulkanowy.data.onResourceSuccess
import io.github.wulkanowy.data.repositories.PreferencesRepository import io.github.wulkanowy.data.repositories.PreferencesRepository
import io.github.wulkanowy.data.repositories.StudentRepository import io.github.wulkanowy.data.repositories.StudentRepository
import io.github.wulkanowy.data.repositories.WulkanowyRepository
import io.github.wulkanowy.data.resourceFlow import io.github.wulkanowy.data.resourceFlow
import io.github.wulkanowy.services.sync.SyncManager import io.github.wulkanowy.services.sync.SyncManager
import io.github.wulkanowy.ui.base.BasePresenter import io.github.wulkanowy.ui.base.BasePresenter
@ -30,7 +29,6 @@ class MainPresenter @Inject constructor(
errorHandler: ErrorHandler, errorHandler: ErrorHandler,
studentRepository: StudentRepository, studentRepository: StudentRepository,
private val preferencesRepository: PreferencesRepository, private val preferencesRepository: PreferencesRepository,
private val wulkanowyRepository: WulkanowyRepository,
private val syncManager: SyncManager, private val syncManager: SyncManager,
private val analytics: AnalyticsHelper, private val analytics: AnalyticsHelper,
private val json: Json, private val json: Json,
@ -201,11 +199,4 @@ class MainPresenter @Inject constructor(
.onFailure { errorHandler.dispatch(it) } .onFailure { errorHandler.dispatch(it) }
} }
} }
fun updateSdkMappings() {
presenterScope.launch {
runCatching { wulkanowyRepository.fetchMapping() }
.onFailure { Timber.e(it) }
}
}
} }

View File

@ -1,5 +1,5 @@
Wersja 2.6.5 Wersja 2.6.4
— naprawiliśmy pozostałe bieżące problemy spowodowane ostatnimi blokadami Wulkanowego przez wiadomo kogo — naprawiliśmy dostęp do modułu ucznia i modułu wiadomości po kolejnej próbie blokady nas (niestety jeszcze bez nowego modułu ucznia)
Pełna lista zmian: https://github.com/wulkanowy/wulkanowy/releases Pełna lista zmian: https://github.com/wulkanowy/wulkanowy/releases

View File

@ -8,7 +8,6 @@ import io.mockk.mockk
fun createWulkanowySdkFactoryMock(sdk: Sdk) = mockk<WulkanowySdkFactory>() fun createWulkanowySdkFactoryMock(sdk: Sdk) = mockk<WulkanowySdkFactory>()
.apply { .apply {
every { createBase() } returns sdk every { create() } returns sdk
coEvery { create() } returns sdk
coEvery { create(any(), any()) } returns sdk coEvery { create(any(), any()) } returns sdk
} }

View File

@ -11,6 +11,7 @@ import io.github.wulkanowy.sdk.pojo.RegisterStudent
import io.mockk.Runs import io.mockk.Runs
import io.mockk.coEvery import io.mockk.coEvery
import io.mockk.coVerify import io.mockk.coVerify
import io.mockk.every
import io.mockk.just import io.mockk.just
import io.mockk.mockk import io.mockk.mockk
import io.mockk.spyk import io.mockk.spyk
@ -39,12 +40,11 @@ class WulkanowySdkFactoryTest {
chuckerInterceptor = mockk(), chuckerInterceptor = mockk(),
remoteConfig = mockk(relaxed = true), remoteConfig = mockk(relaxed = true),
webkitCookieManagerProxy = mockk(), webkitCookieManagerProxy = mockk(),
studentDb = studentDao, studentDb = studentDao
wulkanowyRepository = mockk(relaxed = true),
) )
) )
coEvery { wulkanowySdkFactory.create() } returns sdk every { wulkanowySdkFactory.create() } returns sdk
} }
@Test @Test

View File

@ -3,7 +3,6 @@ package io.github.wulkanowy.ui.modules.main
import io.github.wulkanowy.MainCoroutineRule import io.github.wulkanowy.MainCoroutineRule
import io.github.wulkanowy.data.repositories.PreferencesRepository import io.github.wulkanowy.data.repositories.PreferencesRepository
import io.github.wulkanowy.data.repositories.StudentRepository import io.github.wulkanowy.data.repositories.StudentRepository
import io.github.wulkanowy.data.repositories.WulkanowyRepository
import io.github.wulkanowy.services.sync.SyncManager import io.github.wulkanowy.services.sync.SyncManager
import io.github.wulkanowy.ui.base.ErrorHandler import io.github.wulkanowy.ui.base.ErrorHandler
import io.github.wulkanowy.utils.AdsHelper import io.github.wulkanowy.utils.AdsHelper
@ -32,9 +31,6 @@ class MainPresenterTest {
@MockK @MockK
lateinit var studentRepository: StudentRepository lateinit var studentRepository: StudentRepository
@MockK(relaxed = true)
lateinit var wulkanowyRepository: WulkanowyRepository
@MockK(relaxed = true) @MockK(relaxed = true)
lateinit var prefRepository: PreferencesRepository lateinit var prefRepository: PreferencesRepository
@ -69,8 +65,7 @@ class MainPresenterTest {
analytics = analytics, analytics = analytics,
json = Json, json = Json,
appInfo = appInfo, appInfo = appInfo,
adsHelper = adsHelper, adsHelper = adsHelper
wulkanowyRepository = wulkanowyRepository
) )
presenter.onAttachView(mainView, null) presenter.onAttachView(mainView, null)
} }