日常开发中像使用到微信的登入的分享的 , 及百度地图等一些第三方的的使用 , 需要配置签名的使用 , 由于开发时的签名与正式版的签名是不一致的 , 或者多人开发的时候每个人的电脑的测试环境下的签名都是不同的导致 , 这些第三方的调试比较困难 , 所以在开发一个新的 app 时我通常会统一正式版和测试版的签名 . 这样每个人都可以通过xxx.jks文件生成相同的签名 , 这样每个人就都可以调试这些第三方的东西了
第一步:

第二步

第三步

之后生成如下代码

到此打出的测试包将会与正式包的签名一致, 有时候开源时要公开 build.gradle 密码什么的写在这里很不安全
可以这么设置
第一步
创建 keystore.properties 文件

第二步
向 keystore.properties 添加值

第三步
app 的 build.gradle 中加入如下代码

第四步
配置 .gitignore 不上传 keystore.properties

到此设置结束
网友评论