diff --git a/app/build.gradle b/app/build.gradle index ef3e8a7f..297dbfc6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,7 +20,7 @@ android { versionCode 86 versionName "0.9.1.2" - buildConfigField "java.util.Date", "buildTime", "new java.util.Date()" + buildConfigField "long", "buildTime", System.currentTimeMillis() + "L" } buildTypes { diff --git a/app/src/main/java/at/bitfire/davdroid/HttpClient.java b/app/src/main/java/at/bitfire/davdroid/HttpClient.java index b40f2e42..108352a1 100644 --- a/app/src/main/java/at/bitfire/davdroid/HttpClient.java +++ b/app/src/main/java/at/bitfire/davdroid/HttpClient.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.io.StringReader; import java.net.CookieManager; import java.text.SimpleDateFormat; +import java.util.Date; import java.util.Locale; import java.util.concurrent.TimeUnit; @@ -40,7 +41,7 @@ public class HttpClient extends OkHttpClient { static final String userAgent; static { - String date = new SimpleDateFormat("yyyy/MM/dd", Locale.US).format(BuildConfig.buildTime); + String date = new SimpleDateFormat("yyyy/MM/dd", Locale.US).format(new Date(BuildConfig.buildTime)); userAgent = "DAVdroid/" + BuildConfig.VERSION_NAME + " (" + date + "; dav4android) Android/" + Build.VERSION.RELEASE; } diff --git a/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java b/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java index 41d8e779..05ebb9b2 100644 --- a/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java +++ b/app/src/main/java/at/bitfire/davdroid/ui/DebugInfoActivity.java @@ -34,6 +34,7 @@ import org.apache.commons.lang3.text.WordUtils; import java.io.File; import java.io.FileWriter; import java.io.IOException; +import java.util.Date; import at.bitfire.dav4android.exception.HttpException; import at.bitfire.davdroid.BuildConfig; @@ -191,7 +192,7 @@ public class DebugInfoActivity extends Activity implements LoaderManager.LoaderC } catch(PackageManager.NameNotFoundException e) {} report.append( "SOFTWARE INFORMATION\n" + - "DAVdroid version: " + BuildConfig.VERSION_NAME + " (" + BuildConfig.VERSION_CODE + ") " + BuildConfig.buildTime.toString() + "\n" + + "DAVdroid version: " + BuildConfig.VERSION_NAME + " (" + BuildConfig.VERSION_CODE + ") " + new Date(BuildConfig.buildTime) + "\n" + "Installed from: " + installedFrom + "\n" + "JB Workaround installed: " + (workaroundInstalled ? "yes" : "no") + "\n\n" );