BuildConfig: use build time instead of current time for timestamp

pull/2/head
Ricki Hirner 9 years ago
parent b63fc70cfb
commit 9dbc32d30b
No known key found for this signature in database
GPG Key ID: C4A212CF0B2B4566

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

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

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

Loading…
Cancel
Save