Skip to content

Commit d4e60ac

Browse files
committed
build: Sign releases using keystore if available
1 parent 1ab74ac commit d4e60ac

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/build.gradle.kts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,21 @@ android {
4040
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
4141
}
4242

43-
if (project.hasProperty("signAsDebug")) {
43+
val keystoreFile = file("keystore.jks")
44+
45+
if (project.hasProperty("signAsDebug") || !keystoreFile.exists()) {
4446
applicationIdSuffix = ".debug_signed"
4547
resValue("string", "app_name", "ReVanced Manager (Debug signed)")
4648
signingConfig = signingConfigs.getByName("debug")
4749

4850
isPseudoLocalesEnabled = true
51+
} else {
52+
signingConfig = signingConfigs.create("release") {
53+
storeFile = keystoreFile
54+
storePassword = System.getenv("KEYSTORE_PASSWORD")
55+
keyAlias = System.getenv("KEYSTORE_ENTRY_ALIAS")
56+
keyPassword = System.getenv("KEYSTORE_ENTRY_PASSWORD")
57+
}
4958
}
5059

5160
buildConfigField("long", "BUILD_ID", "0L")

0 commit comments

Comments
 (0)