Android上的keystore类型更改为BKS-V1,避免签名失败的问题

This commit is contained in:
Wind 2020-02-23 23:58:31 +08:00
parent d4c62aff2b
commit c558a112d7
2 changed files with 10 additions and 1 deletions

Binary file not shown.

View File

@ -38,7 +38,16 @@ public class BuildAndSignApkTask implements Runnable {
File keyStoreFile = new File(keyStoreFilePath); File keyStoreFile = new File(keyStoreFilePath);
// assets/keystore分隔符不能使用File.separator否则在windows上抛出IOException !!! // assets/keystore分隔符不能使用File.separator否则在windows上抛出IOException !!!
FileUtils.copyFileFromJar("assets/keystore", keyStoreFilePath); String keyStoreAssetPath;
if (isAndroid()) {
// BKS-V1 类型
keyStoreAssetPath = "assets/android.keystore";
} else {
// BKS 类型
keyStoreAssetPath = "assets/keystore";
}
FileUtils.copyFileFromJar(keyStoreAssetPath, keyStoreFilePath);
boolean signResult = signApk(unsignedApkPath, keyStoreFilePath, signedApkPath); boolean signResult = signApk(unsignedApkPath, keyStoreFilePath, signedApkPath);