1
0
mirror of https://github.com/etesync/android synced 2024-12-23 15:18:14 +00:00

BuildConfig: use build time instead of current time for timestamp

This commit is contained in:
Ricki Hirner 2015-11-27 14:04:24 +01:00
parent b63fc70cfb
commit 9dbc32d30b
No known key found for this signature in database
GPG Key ID: C4A212CF0B2B4566
3 changed files with 5 additions and 3 deletions

View File

@ -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 {

View File

@ -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;
}

View File

@ -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"
);