Skip to content

Commit

Permalink
1,适配26.6.179020。
Browse files Browse the repository at this point in the history
  • Loading branch information
keluokeda committed Jul 2, 2023
1 parent d662068 commit 7f8abe6
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 57 deletions.
7 changes: 2 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId "com.ke.hs_tracker.app"
minSdk libs.versions.minsdk.get().toInteger()
targetSdk libs.versions.targetsdk.get().toInteger()
versionCode 29
versionName "1.2.9"
versionCode 30
versionName "1.3.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down Expand Up @@ -64,9 +64,6 @@ dependencies {

implementation project(path: ':module')

testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation(libs.core.ktx)
implementation(libs.appcompat)
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 29,
"versionName": "1.2.9",
"versionCode": 30,
"versionName": "1.3.0",
"outputFile": "app-release.apk"
}
],
Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions app/src/main/java/com/ke/hs_tracker/app/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ import com.ke.hs_tracker.module.MainApplication
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class App : MainApplication() {
}
class App : MainApplication()
17 changes: 0 additions & 17 deletions app/src/test/java/com/ke/hs_tracker/app/ExampleUnitTest.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ fun Context.findHSDataFilesDir(
// listFiles().forEach {
// if (it.name == applicationId) {
val filesDir = this.findFile("files") ?: return null



return if (fileName == null) filesDir else filesDir.findFile(
fileName
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import android.content.Context
import androidx.documentfile.provider.DocumentFile
import com.ke.hs_tracker.module.di.IoDispatcher
import com.ke.hs_tracker.module.findHSDataFilesDir
import com.ke.hs_tracker.module.log
import com.ke.mvvm.base.domian.UseCase
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.CoroutineDispatcher
import java.io.File
import javax.inject.Inject

class GetRealLogDirUseCase @Inject constructor(
Expand All @@ -16,16 +16,31 @@ class GetRealLogDirUseCase @Inject constructor(
) :
UseCase<Unit, DocumentFile?>(dispatcher) {

private var documentFile: DocumentFile? = null
// private var documentFile: DocumentFile? = null

override suspend fun execute(parameters: Unit): DocumentFile? {

if (documentFile != null) {
return documentFile
}
// if (documentFile != null) {
// return documentFile
// }

val logsDir = context.findHSDataFilesDir("Logs")
?: return null

val listFiles = logsDir.listFiles()


return context.findHSDataFilesDir("Logs")?.apply {
documentFile = this

return listFiles.filter {
"${it.name} ${it.lastModified()}".log()

(it.name?.startsWith("Hearthstone") ?: false) && it.isDirectory
}.maxByOrNull {
it.lastModified()
}?.apply {
"找到了目标目录 ${this.name} ${this.lastModified()}".log()
}


}
}

0 comments on commit 7f8abe6

Please sign in to comment.