生成签名文件

narakuyang
2024-10-08 / 0 评论 / 12 阅读 / 正在检测是否收录...

生成自签名

keytool -genkey -v -keystore ./key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

在项目的android目录下创建key.properties

storePassword=123456(密码)
keyPassword=123456(密码)
keyAlias=key
storeFile=jks路径

android/app/build.gradle下修改

    def keystorePropertiesFile = rootProject.file("key.properties")
    def keystoreProperties = new Properties()
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            shrinkResources false
        }
    }
0

评论

博主关闭了所有页面的评论