美文网首页
apk签名配置

apk签名配置

作者: 火星局 | 来源:发表于2018-09-21 13:35 被阅读0次

    build.gradle文件中增加如下的配置:

    // Create a variable called keystorePropertiesFile, and initialize it to your
    // keystore.properties file, in the rootProject folder.
    def keystorePropertiesFile = rootProject.file("keystore.properties")
    // Initialize a new Properties() object called keystoreProperties.
    def keystoreProperties = new Properties()
    // Load your keystore.properties file into the keystoreProperties object.
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
    
    android {
        signingConfigs {
            release {
                keyAlias keystoreProperties['keyAlias']
                keyPassword keystoreProperties['keyPassword']
                storeFile file(keystoreProperties['storeFile'])
                storePassword keystoreProperties['storePassword']
            }
        }
    }
    

    注意“keystore.properties”文件是在项目的根目录,其内容如下:

    storePassword=guiying712
    keyPassword=guiying712
    keyAlias=guiying712
    storeFile=/mykey.jks
    

    相关文章

      网友评论

          本文标题:apk签名配置

          本文链接:https://www.haomeiwen.com/subject/vvmanftx.html