zoukankan      html  css  js  c++  java
  • Android 修改 keystore 信息

    在进行 开放sdk接入的时候,比如微信sdk,就需要 对apk进行签名才能调用 频繁打包很繁琐,且不能调试,这就需要对debug包进行签名, 而eclipse等工具是用默认 密钥文件 的别名和密码进行签名的(居然不能自定义!!!),而我们自己的密钥文件一般跟ide的默认名字不一致,这就需要我们将debug.keystore 修改为eclipse的默认 别名和密码。

    Android 默认的debug keystore信息

    Keystore name: “debug.keystore”
    Keystore password: “android”
    Key alias: “androiddebugkey”
    Key password: “android”
    CN: “CN=Android Debug,O=Android,C=US”

    修改keystore的别名和密码是通过 keytool 这个工具来进行的,这个工具在jdk的bin目录下,

    看看这个工具能干啥?

    cd进入keystore 文件所在目录
    keytool -storepasswd -new android -keystore debug.keystore
    // 这里 会让你输入 原来的密码 和 新密码
    
    修改 别名
    keytool -changealias -keystore debug.keystore -alias xxx -destalias androiddebugkey
    // 这里 会要求 输入 新key密码 和 alias密码
    
    修改 别名对应的密码
    keytool -keypasswd -keystore my.keystore -alias androiddebugkey
    // 这里输入你老alias密码 和 你新的alias密码

    Eclipse -》 Window -》 Preferences -》 Android -》Build -》 Custom debug keystore

    在Android Studio中 就可以直接 对 别名和pwd进行指定

    在项目的build.gradle的中引入如下代码:
    android {
             //配置keystore签名
            signingConfigs {
                release {
                    storeFile file("debug.keystore")
                    storePassword "xxxxxxx"
                    keyAlias "xxxxxxx"
                    keyPassword "xxxxxxx"
                }
            }
            buildTypes {
                debug {
                    signingConfig signingConfigs.release
                }
                release {
                    signingConfig signingConfigs.release
                }
            }
    }

    参考:  https://www.jianshu.com/p/2546743bc00f

  • 相关阅读:
    [网络流24题]方格取数
    [网络流24题]太空飞行计划
    网络流24题题解合集【不定期更新】【附常见套路分析】
    【优先队列】POJ3614-Sunscreen
    【优先队列】POJ1442-Black Box
    【Huffman树贪心+优先队列】POJ3253-Fence Repair
    【优先队列+贪心】POJ2431-Expedition
    【专题笔记】优先队列和堆
    【动态规划】POJ1664-放苹果
    【动态规划+二分查找】POJ2533&POJ1631最长上升子序列(LIS)
  • 原文地址:https://www.cnblogs.com/lesten/p/10086971.html
Copyright © 2011-2022 走看看