Skip to content

Commit

Permalink
fix(#275): tries to get the current build date directly from applicat…
Browse files Browse the repository at this point in the history
…ion info
  • Loading branch information
sgrimault committed Jan 7, 2025
1 parent 1f4159d commit 322260e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 0 additions & 1 deletion occtax/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ android {
targetSdkVersion 34
versionCode 3320
versionName "2.7.1"
buildConfigField "String", "BUILD_DATE", "\"" + new Date().getTime() + "\""
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
archivesBaseName = project.name + "-" + versionName
}
Expand Down
11 changes: 10 additions & 1 deletion occtax/src/main/java/fr/geonature/occtax/ui/home/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,16 @@ class HomeActivity : AppCompatActivity(),
BuildConfig.VERSION_NAME,
BuildConfig.VERSION_CODE,
DateFormat.getDateTimeInstance()
.format(Date(BuildConfig.BUILD_DATE.toLong()))
.format(
Date(
File(
packageManager.getApplicationInfo(
packageName,
0
).sourceDir
).lastModified()
)
)
)
)
}
Expand Down

0 comments on commit 322260e

Please sign in to comment.