diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/testutils/TestUtils.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/testutils/TestUtils.kt index 3b7127692..c6c55613c 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/testutils/TestUtils.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/testutils/TestUtils.kt @@ -25,7 +25,6 @@ import android.content.pm.PackageManager import android.graphics.Bitmap import android.os.Build import android.os.Environment -import androidx.annotation.RequiresApi import androidx.core.content.ContextCompat import androidx.test.core.app.canTakeScreenshot import androidx.test.core.app.takeScreenshot @@ -91,10 +90,6 @@ object TestUtils { Manifest.permission.WRITE_EXTERNAL_STORAGE ) == PackageManager.PERMISSION_GRANTED - @RequiresApi(Build.VERSION_CODES.R) - private fun hasManageExternalStoragePermission(): Boolean = - Environment.isExternalStorageManager() - @JvmStatic fun hasStoragePermission() = Build.VERSION.SDK_INT > Build.VERSION_CODES.M && hasReadExternalStoragePermission() && hasWriteExternalStoragePermission() diff --git a/app/src/test/java/org/kiwix/kiwixmobile/zimManager/ZimManageViewModelTest.kt b/app/src/test/java/org/kiwix/kiwixmobile/zimManager/ZimManageViewModelTest.kt index c4d3c09db..b2b1bd54d 100644 --- a/app/src/test/java/org/kiwix/kiwixmobile/zimManager/ZimManageViewModelTest.kt +++ b/app/src/test/java/org/kiwix/kiwixmobile/zimManager/ZimManageViewModelTest.kt @@ -51,6 +51,8 @@ import org.kiwix.kiwixmobile.core.utils.files.ScanningProgressListener import org.kiwix.kiwixmobile.core.zim_manager.ConnectivityBroadcastReceiver import org.kiwix.kiwixmobile.core.zim_manager.Language import org.kiwix.kiwixmobile.core.zim_manager.NetworkState +import org.kiwix.kiwixmobile.core.zim_manager.NetworkState.CONNECTED +import org.kiwix.kiwixmobile.core.zim_manager.NetworkState.NOT_CONNECTED import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode.MULTI import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.SelectionMode.NORMAL import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDiskListItem @@ -58,8 +60,6 @@ import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDis import org.kiwix.kiwixmobile.zimManager.Fat32Checker.FileSystemState import org.kiwix.kiwixmobile.zimManager.Fat32Checker.FileSystemState.CanWrite4GbFile import org.kiwix.kiwixmobile.zimManager.Fat32Checker.FileSystemState.CannotWrite4GbFile -import org.kiwix.kiwixmobile.core.zim_manager.NetworkState.CONNECTED -import org.kiwix.kiwixmobile.core.zim_manager.NetworkState.NOT_CONNECTED import org.kiwix.kiwixmobile.zimManager.ZimManageViewModel.FileSelectActions.MultiModeFinished import org.kiwix.kiwixmobile.zimManager.ZimManageViewModel.FileSelectActions.RequestDeleteMultiSelection import org.kiwix.kiwixmobile.zimManager.ZimManageViewModel.FileSelectActions.RequestMultiSelection @@ -139,7 +139,7 @@ class ZimManageViewModelTest { every { newLanguagesDao.languages() } returns languages every { fat32Checker.fileSystemStates } returns fileSystemStates every { connectivityBroadcastReceiver.networkStates } returns networkStates - every { application.registerReceiver(any(), any()) } returns mockk() + every { application.registerReceiver(any(), any(), any()) } returns mockk() every { dataSource.booksOnDiskAsListItems() } returns booksOnDiskListItems every { connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork) @@ -168,7 +168,7 @@ class ZimManageViewModelTest { @Test fun `registers broadcastReceiver in init`() { verify { - application.registerReceiver(connectivityBroadcastReceiver, any()) + application.registerReceiver(connectivityBroadcastReceiver, any(), any()) } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 40967373a..b8c6df09d 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -13,7 +13,7 @@ repositories { dependencies { implementation("com.android.tools.build:gradle:8.4.0") implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0") - implementation("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:2.1.0-1.0.29") + implementation("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:2.0.0-1.0.24") implementation("org.jacoco:org.jacoco.core:0.8.12") implementation("org.jlleitschuh.gradle:ktlint-gradle:10.3.0") implementation("com.google.apis:google-api-services-androidpublisher:v3-rev20230406-2.0.0") { diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index bb664ad7e..3c02b8cf8 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -28,7 +28,7 @@ object Versions { const val org_jetbrains_kotlin: String = "2.0.0" - const val kotlin_ksp: String = "2.1.0-1.0.29" + const val kotlin_ksp: String = "2.0.0-1.0.24" const val androidx_navigation: String = "2.5.3" diff --git a/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt b/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt index f90c0f340..13daa7d14 100644 --- a/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt +++ b/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt @@ -217,8 +217,8 @@ class AllProjectConfigurer { compileOnly(Libs.javax_annotation_api) implementation(Libs.dagger) implementation(Libs.dagger_android) - annotationProcessor(Libs.dagger_compiler) - annotationProcessor(Libs.dagger_android_processor) + kapt(Libs.dagger_compiler) + kapt(Libs.dagger_android_processor) implementation(Libs.core_ktx) implementation(Libs.fragment_ktx) implementation(Libs.collection_ktx) @@ -230,7 +230,7 @@ class AllProjectConfigurer { annotationProcessor(Libs.roomCompiler) implementation(Libs.roomRuntime) implementation(Libs.roomRxjava2) - ksp(Libs.roomCompiler) + kapt(Libs.roomCompiler) implementation(Libs.tracing) implementation(Libs.fetchOkhttp) } diff --git a/core/build.gradle.kts b/core/build.gradle.kts index ffa77eac9..1d61d4aee 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,4 +1,3 @@ -import com.android.build.gradle.internal.utils.isKotlinKaptPluginApplied import plugin.KiwixConfigurationPlugin buildscript { diff --git a/core/src/main/java/eu/mhutti1/utils/storage/StorageDeviceUtils.kt b/core/src/main/java/eu/mhutti1/utils/storage/StorageDeviceUtils.kt index e2b56964d..62ccb01af 100644 --- a/core/src/main/java/eu/mhutti1/utils/storage/StorageDeviceUtils.kt +++ b/core/src/main/java/eu/mhutti1/utils/storage/StorageDeviceUtils.kt @@ -21,12 +21,10 @@ package eu.mhutti1.utils.storage import android.content.Context import android.content.ContextWrapper import android.os.Environment -import androidx.core.content.ContextCompat import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil import java.io.File import java.io.FileFilter import java.io.RandomAccessFile -import java.util.ArrayList object StorageDeviceUtils { @JvmStatic @@ -63,7 +61,7 @@ object StorageDeviceUtils { private fun externalFilesDirsDevices( context: Context, writable: Boolean - ) = ContextCompat.getExternalFilesDirs(context, "") + ) = context.getExternalFilesDirs("") .filterNotNull() .mapIndexed { index, dir -> StorageDevice(generalisePath(dir.path, writable), index == 0) } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/base/adapter/AdapterDelegateManager.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/base/adapter/AdapterDelegateManager.kt index 82a657fa4..4b6d30687 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/base/adapter/AdapterDelegateManager.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/base/adapter/AdapterDelegateManager.kt @@ -45,7 +45,7 @@ class AdapterDelegateManager { private fun getDelegateIndexFor(item: T): Int { for (index in 0..delegates.size()) { val valueAt = delegates.valueAt(index) - if (valueAt?.isFor(item) == true) { + if (valueAt.isFor(item) == true) { return index } } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/error/ErrorActivity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/error/ErrorActivity.kt index 2cd0d1f1f..19817ef02 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/error/ErrorActivity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/error/ErrorActivity.kt @@ -24,7 +24,6 @@ import android.os.Build import android.os.Bundle import android.os.Process import androidx.activity.result.contract.ActivityResultContracts -import androidx.core.content.ContextCompat import androidx.core.content.FileProvider import androidx.lifecycle.lifecycleScope import kotlinx.coroutines.launch @@ -101,7 +100,7 @@ open class ErrorActivity : BaseActivity() { val targetedIntents = createEmailIntents(emailIntent, activities) if (activities.isNotEmpty() && targetedIntents.isNotEmpty()) { val chooserIntent = - Intent.createChooser(targetedIntents.removeFirst(), "Send email...") + Intent.createChooser(targetedIntents.removeAt(0), "Send email...") chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetedIntents.toTypedArray()) sendEmailLauncher.launch(chooserIntent) } else { @@ -245,7 +244,7 @@ open class ErrorActivity : BaseActivity() { """.trimIndent() private fun externalFileDetails(): String = - ContextCompat.getExternalFilesDirs(this, null).joinToString("\n") { it?.path ?: "null" } + getExternalFilesDirs(null).joinToString("\n") { it?.path ?: "null" } private fun safeContains(extras: Bundle): Boolean { return try { @@ -272,7 +271,7 @@ open class ErrorActivity : BaseActivity() { private val versionName: String @SuppressLint("WrongConstant") get() = packageManager - .getPackageInformation(packageName, ZERO).versionName + .getPackageInformation(packageName, ZERO).versionName.toString() private fun toStackTraceString(exception: Throwable): String = try { diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.kt index 055f1d909..5a353ce2f 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.kt @@ -1869,9 +1869,9 @@ abstract class CoreReaderFragment : } reopenBook() showTabSwitcher() - setUpWithTextToSpeech(tempWebViewListForUndo.last()) + setUpWithTextToSpeech(tempWebViewListForUndo[tempWebViewListForUndo.lastIndex]) updateBottomToolbarVisibility() - safelyAddWebView(tempWebViewListForUndo.last()) + safelyAddWebView(tempWebViewListForUndo[tempWebViewListForUndo.lastIndex]) } } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/settings/CorePrefsFragment.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/CorePrefsFragment.kt index ac8638fd1..8278b8128 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/settings/CorePrefsFragment.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/CorePrefsFragment.kt @@ -229,7 +229,7 @@ abstract class CorePrefsFragment : @Suppress("TooGenericExceptionThrown") get() = try { requireActivity().packageManager - .getPackageInformation(requireActivity().packageName, 0).versionName + .getPackageInformation(requireActivity().packageName, 0).versionName.toString() } catch (e: PackageManager.NameNotFoundException) { throw RuntimeException(e) } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt index 1e261a2fa..5556425b9 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt @@ -129,7 +129,7 @@ class SharedPreferenceUtil @Inject constructor(val context: Context) { get() = sharedPreferences.getInt(STORAGE_POSITION, 0) fun defaultStorage(): String = - getExternalFilesDirs(context, null)[0]?.path + context.getExternalFilesDirs(null)[0]?.path ?: context.filesDir.path // a workaround for emulators fun defaultPublicStorage(): String = diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileUtils.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileUtils.kt index db3621797..b4d482946 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileUtils.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/files/FileUtils.kt @@ -30,7 +30,6 @@ import android.os.storage.StorageManager import android.provider.DocumentsContract import android.provider.MediaStore import android.webkit.URLUtil -import androidx.core.content.ContextCompat import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -583,7 +582,7 @@ object FileUtils { @JvmStatic fun getDemoFilePathForCustomApp(context: Context) = - "${ContextCompat.getExternalFilesDirs(context, null)[0]}/demo.zim" + "${context.getExternalFilesDirs(null)[0]}/demo.zim" @SuppressLint("Recycle") @JvmStatic diff --git a/core/src/main/res/values-qq/strings.xml b/core/src/main/res/values-qq/strings.xml index 81084bde6..d75566233 100644 --- a/core/src/main/res/values-qq/strings.xml +++ b/core/src/main/res/values-qq/strings.xml @@ -143,7 +143,7 @@ This is a descriptive message explaining where the Zim files are located after downloading. It is showing on the help screen. {{Identical|Storage}} This is showing on the preference settings screen, it shows the currently selected storage in which we are downloading the zim files, whether it is internal or external. - This refers to free (unused) storage space, ’’not’’ to free as in free of charge. + This refers to free (unused) storage space, ’’not’’ to free as in free of charge. Here %s will be replaced by the free space e.g. 20GB. This message appears in the “Android Toast” as an error message. When there are some files that could not be deleted, due to some reason. {{identical|pause}} {{identical|resume}} diff --git a/core/src/test/java/org/kiwix/kiwixmobile/core/dao/NewRecentSearchDaoTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/dao/NewRecentSearchDaoTest.kt index 3463ba837..44ddfc7a2 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/core/dao/NewRecentSearchDaoTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/dao/NewRecentSearchDaoTest.kt @@ -25,7 +25,7 @@ import io.objectbox.Box import io.objectbox.query.Query import io.objectbox.query.QueryBuilder import kotlinx.coroutines.flow.flowOf -import kotlinx.coroutines.test.runBlockingTest +import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test import org.kiwix.kiwixmobile.core.dao.entities.RecentSearchEntity @@ -43,7 +43,7 @@ internal class NewRecentSearchDaoTest { @Nested inner class RecentSearchTests { @Test - fun `recentSearches searches by Id passed`() = runBlockingTest { + fun `recentSearches searches by Id passed`() = runTest { val zimId = "id" val queryResult = listOf(recentSearchEntity()) expectFromRecentSearches(queryResult, zimId) @@ -56,7 +56,7 @@ internal class NewRecentSearchDaoTest { } @Test - fun `recentSearches searches with blank Id if null passed`() = runBlockingTest { + fun `recentSearches searches with blank Id if null passed`() = runTest { val queryResult = listOf(recentSearchEntity()) expectFromRecentSearches(queryResult, "") newRecentSearchDao.recentSearches(null) @@ -68,7 +68,7 @@ internal class NewRecentSearchDaoTest { } @Test - fun `recentSearches searches returns distinct entities by searchTerm`() = runBlockingTest { + fun `recentSearches searches returns distinct entities by searchTerm`() = runTest { val queryResult = listOf(recentSearchEntity(), recentSearchEntity()) expectFromRecentSearches(queryResult, "") newRecentSearchDao.recentSearches("") @@ -80,7 +80,7 @@ internal class NewRecentSearchDaoTest { } @Test - fun `recentSearches searches returns a limitedNumber of entities`() = runBlockingTest { + fun `recentSearches searches returns a limitedNumber of entities`() = runTest { val searchResults: List = (0..200).map { recentSearchEntity(searchTerm = "$it") } expectFromRecentSearches(searchResults, "") diff --git a/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/SearchViewModelTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/SearchViewModelTest.kt index b214e7190..e72e764ed 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/SearchViewModelTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/SearchViewModelTest.kt @@ -33,11 +33,9 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.consumeAsFlow import kotlinx.coroutines.launch import kotlinx.coroutines.sync.Mutex -import kotlinx.coroutines.test.TestCoroutineDispatcher -import kotlinx.coroutines.test.TestCoroutineScope +import kotlinx.coroutines.test.StandardTestDispatcher import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.resetMain -import kotlinx.coroutines.test.runBlockingTest import kotlinx.coroutines.test.runTest import kotlinx.coroutines.test.setMain import org.assertj.core.api.Assertions.assertThat @@ -84,7 +82,7 @@ internal class SearchViewModelTest { private val zimReaderContainer: ZimReaderContainer = mockk() private val searchResultGenerator: SearchResultGenerator = mockk() private val zimFileReader: ZimFileReader = mockk() - private val testDispatcher = TestCoroutineDispatcher() + private val testDispatcher = StandardTestDispatcher() private val searchMutex: Mutex = mockk() lateinit var viewModel: SearchViewModel @@ -115,7 +113,7 @@ internal class SearchViewModelTest { @Nested inner class StateTests { @Test - fun `initial state is Initialising`() = runBlockingTest { + fun `initial state is Initialising`() = runTest { viewModel.state.test(this).assertValue( SearchState("", SearchResultsWithTerm("", null, searchMutex), emptyList(), FromWebView) ).finish() @@ -152,12 +150,12 @@ internal class SearchViewModelTest { inner class ActionMapping { @Test - fun `ExitedSearch offers PopFragmentBackstack`() = runBlockingTest { + fun `ExitedSearch offers PopFragmentBackstack`() = runTest { actionResultsInEffects(ExitedSearch, PopFragmentBackstack) } @Test - fun `OnItemClick offers Saves and Opens`() = runBlockingTest { + fun `OnItemClick offers Saves and Opens`() = runTest { val searchListItem = RecentSearchListItem("", "") actionResultsInEffects( OnItemClick(searchListItem), @@ -170,7 +168,7 @@ internal class SearchViewModelTest { } @Test - fun `OnOpenInNewTabClick offers Saves and Opens in new tab`() = runBlockingTest { + fun `OnOpenInNewTabClick offers Saves and Opens in new tab`() = runTest { val searchListItem = RecentSearchListItem("", "") actionResultsInEffects( OnOpenInNewTabClick(searchListItem), @@ -183,7 +181,7 @@ internal class SearchViewModelTest { } @Test - fun `OnItemLongClick offers Saves and Opens`() = runBlockingTest { + fun `OnItemLongClick offers Saves and Opens`() = runTest { val searchListItem = RecentSearchListItem("", "") actionResultsInEffects( OnItemLongClick(searchListItem), @@ -192,12 +190,12 @@ internal class SearchViewModelTest { } @Test - fun `ClickedSearchInText offers SearchInPreviousScreen`() = runBlockingTest { + fun `ClickedSearchInText offers SearchInPreviousScreen`() = runTest { actionResultsInEffects(ClickedSearchInText, SearchInPreviousScreen("")) } @Test - fun `ConfirmedDelete offers Delete and Toast`() = runBlockingTest { + fun `ConfirmedDelete offers Delete and Toast`() = runTest { val searchListItem = RecentSearchListItem("", "") actionResultsInEffects( ConfirmedDelete(searchListItem), @@ -207,7 +205,7 @@ internal class SearchViewModelTest { } @Test - fun `CreatedWithArguments offers SearchArgumentProcessing`() = runBlockingTest { + fun `CreatedWithArguments offers SearchArgumentProcessing`() = runTest { val bundle = mockk() actionResultsInEffects( CreatedWithArguments(bundle), @@ -216,7 +214,7 @@ internal class SearchViewModelTest { } @Test - fun `ReceivedPromptForSpeechInput offers StartSpeechInput`() = runBlockingTest { + fun `ReceivedPromptForSpeechInput offers StartSpeechInput`() = runTest { actionResultsInEffects( ReceivedPromptForSpeechInput, StartSpeechInput(viewModel.actions) @@ -224,7 +222,7 @@ internal class SearchViewModelTest { } @Test - fun `StartSpeechInputFailed offers ShowToast`() = runBlockingTest { + fun `StartSpeechInputFailed offers ShowToast`() = runTest { actionResultsInEffects( StartSpeechInputFailed, ShowToast(string.speech_not_supported) @@ -232,14 +230,14 @@ internal class SearchViewModelTest { } @Test - fun `ActivityResultReceived offers ProcessActivityResult`() = runBlockingTest { + fun `ActivityResultReceived offers ProcessActivityResult`() = runTest { actionResultsInEffects( ActivityResultReceived(0, 1, null), ProcessActivityResult(0, 1, null, viewModel.actions) ) } - private fun TestCoroutineScope.actionResultsInEffects( + private fun TestScope.actionResultsInEffects( action: Action, vararg effects: SideEffect<*> ) { diff --git a/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomFileValidator.kt b/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomFileValidator.kt index 4fb5b1de8..7a4022594 100644 --- a/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomFileValidator.kt +++ b/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomFileValidator.kt @@ -22,7 +22,6 @@ import android.content.Context import android.content.pm.PackageManager import android.content.res.AssetFileDescriptor import android.content.res.AssetManager -import androidx.core.content.ContextCompat import org.kiwix.kiwixmobile.core.utils.files.Log import org.kiwix.kiwixmobile.custom.main.ValidationState.HasBothFiles import org.kiwix.kiwixmobile.custom.main.ValidationState.HasFile @@ -96,7 +95,7 @@ class CustomFileValidator @Inject constructor(private val context: Context) { private fun obbFiles() = scanDirs( - ContextCompat.getObbDirs(context).filterNotNull().filter(File::exists).toTypedArray(), + context.obbDirs.filterNotNull().filter(File::exists).toTypedArray(), "obb" ) @@ -105,7 +104,7 @@ class CustomFileValidator @Inject constructor(private val context: Context) { val directoryList = mutableListOf() // Get the external files directories for the app - ContextCompat.getExternalFilesDirs(context, null).filterNotNull() + context.getExternalFilesDirs(null).filterNotNull() .filter(File::exists) .forEach { dir -> // Check if the directory's parent is not null diff --git a/lintConfig.xml b/lintConfig.xml index 48d9225f6..cc5dd1156 100644 --- a/lintConfig.xml +++ b/lintConfig.xml @@ -1,6 +1,6 @@ - +