Merge pull request #2911 from element-hq/feature/bma/reproducibleBuild
Reproducible build
This commit is contained in:
commit
436a876317
7 changed files with 58 additions and 6 deletions
|
|
@ -28,6 +28,7 @@ import android.widget.Toast
|
|||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.annotation.ChecksSdkIntAtLeast
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.core.content.pm.PackageInfoCompat
|
||||
import io.element.android.libraries.androidutils.R
|
||||
import io.element.android.libraries.androidutils.compat.getApplicationInfoCompat
|
||||
import io.element.android.libraries.core.mimetype.MimeTypes
|
||||
|
|
@ -47,6 +48,19 @@ fun Context.getApplicationLabel(packageName: String): String {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the versionCode from the Manifest.
|
||||
* The value is more accurate than BuildConfig.VERSION_CODE, as it is correct according to the
|
||||
* computation in the `androidComponents` block of the app build.gradle.kts file.
|
||||
* In other words, the last digit (for the architecture) will be set, whereas BuildConfig.VERSION_CODE
|
||||
* last digit will always be 0.
|
||||
*/
|
||||
fun Context.getVersionCodeFromManifest(): Long {
|
||||
return PackageInfoCompat.getLongVersionCode(
|
||||
packageManager.getPackageInfo(packageName, 0)
|
||||
)
|
||||
}
|
||||
|
||||
// ==============================================================================================================
|
||||
// Clipboard helper
|
||||
// ==============================================================================================================
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ data class BuildMeta(
|
|||
val applicationId: String,
|
||||
val lowPrivacyLoggingEnabled: Boolean,
|
||||
val versionName: String,
|
||||
val versionCode: Int,
|
||||
val versionCode: Long,
|
||||
val gitRevision: String,
|
||||
val gitBranchName: String,
|
||||
val flavorDescription: String,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ fun aBuildMeta(
|
|||
applicationId: String = "",
|
||||
lowPrivacyLoggingEnabled: Boolean = true,
|
||||
versionName: String = "",
|
||||
versionCode: Int = 0,
|
||||
versionCode: Long = 0,
|
||||
gitRevision: String = "",
|
||||
gitBranchName: String = "",
|
||||
flavorDescription: String = "",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue