From 832e103a11655c5e58fb5f889a9345553e9ec0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schu=CC=88ller?= Date: Wed, 8 Jul 2020 12:31:30 +0200 Subject: [PATCH] Reproducible Builds --- CHANGELOG.md | 3 +-- app/build.gradle | 5 +---- .../schueller/peertube/activity/SettingsActivity.java | 9 +++++++++ app/src/main/res/xml/root_preferences.xml | 3 ++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a58607a..b474dcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,6 @@ -### Version 1.0.45 Tag: v1.0.45 (2020-07-??) +### Version 1.0.45 Tag: v1.0.45 (2020-07-08) * Added token refresh - ### Version 1.0.44 Tag: v1.0.44 (2020-07-05) * Completed implementation of Likes & Dislikes (@Poslovitch) * Added preview of the current playback speed and video quality in the VideoOptionsFragment (@Poslovitch) diff --git a/app/build.gradle b/app/build.gradle index ce3bd4e..d8b2be1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,9 +25,7 @@ android { targetSdkVersion 29 versionCode 1045 versionName "1.0.45" - //buildTime readPropertyWithDefault('buildTimestamp', System.currentTimeMillis()) + 'L' - //buildConfigField "long", "BUILD_TIME", readPropertyWithDefault('buildTimestamp', System.currentTimeMillis()) + 'L' - //resValue "string", "BUILD_TIME", readPropertyWithDefault('buildTimestamp', System.currentTimeMillis()) + 'L' + buildConfigField "long", "BUILD_TIME", readPropertyWithDefault('buildTimestamp', System.currentTimeMillis()) + 'L' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ext { libVersions = [ @@ -107,7 +105,6 @@ android { applicationVariants.all { variant -> variant.resValue "string", "versionName", variant.versionName - variant.resValue "string", "buildTime", readPropertyWithDefault('buildTimestamp', System.currentTimeMillis()) + '' } } diff --git a/app/src/main/java/net/schueller/peertube/activity/SettingsActivity.java b/app/src/main/java/net/schueller/peertube/activity/SettingsActivity.java index 6f559b2..c2e0083 100644 --- a/app/src/main/java/net/schueller/peertube/activity/SettingsActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/SettingsActivity.java @@ -18,11 +18,14 @@ package net.schueller.peertube.activity; import android.os.Bundle; +import android.view.View; import androidx.appcompat.app.ActionBar; import androidx.appcompat.widget.Toolbar; +import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; +import net.schueller.peertube.BuildConfig; import net.schueller.peertube.R; public class SettingsActivity extends CommonActivity { @@ -59,6 +62,12 @@ public class SettingsActivity extends CommonActivity { @Override public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { setPreferencesFromResource(R.xml.root_preferences, rootKey); + + // write Build Time into pref + Preference pref = findPreference("pref_buildtime"); + assert pref != null; + pref.setSummary(Long.toString(BuildConfig.BUILD_TIME)); + } } } \ No newline at end of file diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index bff8b4c..795ebb8 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -85,7 +85,8 @@ app:iconSpaceReserved="false"/>