diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d9a0d3ee..69341db8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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 @@ -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 { @@ -200,3 +201,5 @@ compose { tasks.withType().all { duplicatesStrategy = DuplicatesStrategy.EXCLUDE } + +apply(from = "fix-profm.gradle") diff --git a/app/fix-profm.gradle b/app/fix-profm.gradle new file mode 100644 index 00000000..cb26f7c3 --- /dev/null +++ b/app/fix-profm.gradle @@ -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, "") + } + } + } + } + } + } +} \ No newline at end of file