@@ -27,41 +27,16 @@ android {
2727 }
2828
2929 signingConfigs {
30- create(" custom-key" ) {
31- val keystoreAlias = System .getenv(" KEYSTORE_ALIAS" ) ? : " "
32- val keystorePassword = System .getenv(" KEYSTORE_PASSWORD" ) ? : " "
33- val keystorePath = System .getenv(" KEYSTORE_PATH" ) ? : " "
30+ val keystoreAlias = System .getenv(" KEYSTORE_ALIAS" ) ? : " "
31+ val keystorePassword = System .getenv(" KEYSTORE_PASSWORD" ) ? : " "
32+ val keystorePath = System .getenv(" KEYSTORE_PATH" ) ? : " "
3433
35- if (keystorePath.isNotEmpty() && file(keystorePath).exists() && file(keystorePath).length() > 0 ) {
34+ if (keystorePath.isNotEmpty() && file(keystorePath).exists() && file(keystorePath).length() > 0 ) {
35+ create(" custom-key" ) {
3636 keyAlias = keystoreAlias
3737 keyPassword = keystorePassword
3838 storeFile = file(keystorePath)
3939 storePassword = keystorePassword
40- } else {
41- val debugKeystoreFile = file(" ${System .getProperty(" user.home" )} /debug.keystore" )
42-
43- println (" ⚠️ Custom keystore not found or empty! creating debug keystore." )
44-
45- if (! debugKeystoreFile.exists()) {
46- Runtime .getRuntime().exec(
47- arrayOf(
48- " keytool" , " -genkeypair" ,
49- " -v" , " -keystore" , debugKeystoreFile.absolutePath,
50- " -storepass" , " android" ,
51- " -keypass" , " android" ,
52- " -alias" , " androiddebugkey" ,
53- " -keyalg" , " RSA" ,
54- " -keysize" , " 2048" ,
55- " -validity" , " 10000" ,
56- " -dname" , " CN=Android Debug,O=Android,C=US"
57- )
58- ).waitFor()
59- }
60-
61- keyAlias = " androiddebugkey"
62- keyPassword = " android"
63- storeFile = debugKeystoreFile
64- storePassword = " android"
6540 }
6641 }
6742 }
@@ -74,7 +49,7 @@ android {
7449 getDefaultProguardFile(" proguard-android-optimize.txt" ),
7550 " proguard-rules.pro"
7651 )
77- signingConfig = signingConfigs.getByName (" custom-key" ) ? : signingConfigs.getByName(" debug" )
52+ signingConfig = signingConfigs.findByName (" custom-key" ) ? : signingConfigs.getByName(" debug" )
7853 }
7954 }
8055
0 commit comments