You've already forked TrickyStore
mirror of
https://github.com/5ec1cff/TrickyStore.git
synced 2025-09-06 06:37:07 +00:00
verify module.prop
This commit is contained in:
@@ -1,10 +1,33 @@
|
||||
import android.databinding.tool.ext.capitalizeUS
|
||||
import org.jetbrains.kotlin.daemon.common.toHexString
|
||||
import java.security.MessageDigest
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.jetbrains.kotlin.android)
|
||||
alias(libs.plugins.agp.app)
|
||||
}
|
||||
|
||||
val moduleId: String by rootProject.extra
|
||||
val moduleName: String by rootProject.extra
|
||||
val verCode: Int by rootProject.extra
|
||||
val verName: String by rootProject.extra
|
||||
val commitHash: String by rootProject.extra
|
||||
val author: String by rootProject.extra
|
||||
val description: String by rootProject.extra
|
||||
val moduleDescription = description
|
||||
|
||||
fun calculateChecksum(variantLowered: String): String {
|
||||
return MessageDigest.getInstance("SHA-256").run {
|
||||
update(moduleId.toByteArray(Charsets.UTF_8))
|
||||
update(moduleName.toByteArray(Charsets.UTF_8))
|
||||
update("$verName ($verCode-$commitHash-$variantLowered)".toByteArray(Charsets.UTF_8))
|
||||
update(verCode.toString().toByteArray(Charsets.UTF_8))
|
||||
update(author.toByteArray(Charsets.UTF_8))
|
||||
update(description.toByteArray(Charsets.UTF_8))
|
||||
digest().toHexString()
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "io.github.a13e300.tricky_store"
|
||||
compileSdk = 34
|
||||
@@ -22,6 +45,10 @@ android {
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
forEach {
|
||||
val checksum = calculateChecksum(it.name)
|
||||
it.buildConfigField("String", "CHECKSUM", "\"$checksum\"")
|
||||
}
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
@@ -44,6 +71,11 @@ android {
|
||||
checkReleaseBuilds = false
|
||||
abortOnError = true
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
Reference in New Issue
Block a user