Skip to content

Commit

Permalink
added fixes for reproducible builds
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed Feb 19, 2023
1 parent 2ea800e commit aa925d7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ val exoplayer = "1.0.0-rc01"
val accompanist = "0.25.1"

val artifact = "dev.datlag.burningseries"
val appVersion = "4.3.1"
val appCode = 431
val appVersion = "4.3.2"
val appCode = 432

group = artifact
version = appVersion
Expand Down Expand Up @@ -138,6 +138,7 @@ aboutLibraries {
includePlatform = true
duplicationMode = com.mikepenz.aboutlibraries.plugin.DuplicateMode.MERGE
duplicationRule = com.mikepenz.aboutlibraries.plugin.DuplicateRule.GROUP
excludeFields = arrayOf("generated")
}

compose {
Expand Down Expand Up @@ -200,3 +201,5 @@ compose {
tasks.withType<Copy>().all {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

apply(from = "fix-profm.gradle")
38 changes: 38 additions & 0 deletions app/fix-profm.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.3.1"
}
}

import com.android.tools.profgen.ArtProfileKt
import com.android.tools.profgen.ArtProfileSerializer
import com.android.tools.profgen.DexFile

project.afterEvaluate {
tasks.each { task ->
if (task.name.startsWith("compile") && task.name.endsWith("ReleaseArtProfile")) {
task.doLast {
outputs.files.each { file ->
if (file.name.endsWith(".profm")) {
println("Sorting ${file} ...")
def version = ArtProfileSerializer.valueOf("METADATA_0_0_2")
def profile = ArtProfileKt.ArtProfile(file)
def keys = new ArrayList(profile.profileData.keySet())
def sortedData = new LinkedHashMap()
Collections.sort keys, new DexFile.Companion()
keys.each { key -> sortedData[key] = profile.profileData[key] }
new FileOutputStream(file).with {
write(version.magicBytes$profgen)
write(version.versionBytes$profgen)
version.write$profgen(it, sortedData, "")
}
}
}
}
}
}
}

0 comments on commit aa925d7

Please sign in to comment.