mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-06 03:18:23 +00:00
add sorting
This commit is contained in:
@@ -224,3 +224,35 @@ dependencies {
|
||||
freeImplementation(libs.okhttp)
|
||||
playImplementation(libs.okhttp)
|
||||
}
|
||||
|
||||
// https://gitlab.com/fdroid/wiki/-/wikis/HOWTO:-diff-&-fix-APKs-for-Reproducible-Builds#differing-assetsdexoptbaselineprofm-easy-to-fix
|
||||
// NB: Android Studio can't find the imports; this does not affect the
|
||||
// actual build since Gradle can find them just fine.
|
||||
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, "")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -11,10 +11,23 @@
|
||||
"type": "UNIVERSAL",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 60,
|
||||
"versionCode": 61,
|
||||
"versionName": "1.0.0",
|
||||
"outputFile": "app-play-universal-release.apk"
|
||||
},
|
||||
{
|
||||
"type": "ONE_OF_MANY",
|
||||
"filters": [
|
||||
{
|
||||
"filterType": "ABI",
|
||||
"value": "x86_64"
|
||||
}
|
||||
],
|
||||
"attributes": [],
|
||||
"versionCode": 61,
|
||||
"versionName": "1.0.0",
|
||||
"outputFile": "app-play-x86_64-release.apk"
|
||||
},
|
||||
{
|
||||
"type": "ONE_OF_MANY",
|
||||
"filters": [
|
||||
@@ -24,7 +37,7 @@
|
||||
}
|
||||
],
|
||||
"attributes": [],
|
||||
"versionCode": 60,
|
||||
"versionCode": 61,
|
||||
"versionName": "1.0.0",
|
||||
"outputFile": "app-play-armeabi-v7a-release.apk"
|
||||
},
|
||||
@@ -37,23 +50,10 @@
|
||||
}
|
||||
],
|
||||
"attributes": [],
|
||||
"versionCode": 60,
|
||||
"versionCode": 61,
|
||||
"versionName": "1.0.0",
|
||||
"outputFile": "app-play-arm64-v8a-release.apk"
|
||||
},
|
||||
{
|
||||
"type": "ONE_OF_MANY",
|
||||
"filters": [
|
||||
{
|
||||
"filterType": "ABI",
|
||||
"value": "x86_64"
|
||||
}
|
||||
],
|
||||
"attributes": [],
|
||||
"versionCode": 60,
|
||||
"versionName": "1.0.0",
|
||||
"outputFile": "app-play-x86_64-release.apk"
|
||||
},
|
||||
{
|
||||
"type": "ONE_OF_MANY",
|
||||
"filters": [
|
||||
@@ -63,7 +63,7 @@
|
||||
}
|
||||
],
|
||||
"attributes": [],
|
||||
"versionCode": 60,
|
||||
"versionCode": 61,
|
||||
"versionName": "1.0.0",
|
||||
"outputFile": "app-play-x86-release.apk"
|
||||
}
|
||||
@@ -75,9 +75,9 @@
|
||||
"maxApi": 30,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/1/app-play-universal-release.dm",
|
||||
"baselineProfiles/1/app-play-x86_64-release.dm",
|
||||
"baselineProfiles/1/app-play-armeabi-v7a-release.dm",
|
||||
"baselineProfiles/1/app-play-arm64-v8a-release.dm",
|
||||
"baselineProfiles/1/app-play-x86_64-release.dm",
|
||||
"baselineProfiles/1/app-play-x86-release.dm"
|
||||
]
|
||||
},
|
||||
@@ -86,9 +86,9 @@
|
||||
"maxApi": 2147483647,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/0/app-play-universal-release.dm",
|
||||
"baselineProfiles/0/app-play-x86_64-release.dm",
|
||||
"baselineProfiles/0/app-play-armeabi-v7a-release.dm",
|
||||
"baselineProfiles/0/app-play-arm64-v8a-release.dm",
|
||||
"baselineProfiles/0/app-play-x86_64-release.dm",
|
||||
"baselineProfiles/0/app-play-x86-release.dm"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user