Android jar 使用有效的密钥库未签名,需要 SHA1 证书吗?
Android jar is unsigned using valid keystore, needs SHA1 certificate?
我正在尝试为我的应用程序生成签名的 APK。我正在使用 Android Studio 生成发布 APK:构建 > 生成签名 APK。然后我得到一个关于我的密钥库、别名和密码的弹出窗口。这个过程在过去有效,但我怀疑在最近升级工具和其他支持后停止工作。我该怎么做才能让 Android Studio 生成具有有效签名的签名 APK?
当我使用 jarsigner 检查 APK 时,从 Java 1.8 版本开始,我收到消息:
jar is unsigned. (signatures missing or not parsable)
如果我使用 jarsigner 对应用程序进行签名,它会安装在大多数设备上,但不会安装在我的设备上 运行ning Android 4.1。我使用的命令是:
jarsigner -verbose -keystore "...path...\perinote-release.keystore" app-release.apk perinote
此外,如果我添加到 jarsigner 选项:
-digestalg SHA1 -sigalg MD5withRSA
它被 Android 4.1 设备接受。我在另一个 post、no manifest. jar is unsigned. (signatures missing or not parsable) 中找到了这些选项,表明在某些时候,加密从 SHA1 更改为 SHA2。
这是我的 build.gradle "app"
apply plugin: 'com.android.application'
android {
signingConfigs {
release {
keyAlias 'perinote'
storeFile file('...path.../perinote-release.keystore')
}
}
compileSdkVersion 24
buildToolsVersion "25.0.0"
compileOptions.encoding = 'UTF-8'
defaultConfig {
applicationId "com.perinote.camera"
minSdkVersion 15
targetSdkVersion 24
renderscriptTargetApi 20
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
compile 'com.android.support:support-v4:24.0.0'
testCompile 'junit:junit:4.12'
}
如何配置 Android Studio 以使用 SHA1,以便我的应用程序可以继续在 Android 4.1 设备上运行?或者还有什么我应该做的吗?
编辑: 我意识到我应该切换到 SHA256。但我仍然需要一种方法让我的应用程序在 Android 4.1 上达到 运行。我需要生成两个版本并发布它们吗?
要获得两个签名版本,只需选中第二个生成签名 APK 对话框底部的 V1 和 V2 复选框。
我没有注意到这个对话框在更新 AS 后发生了变化,然后就过去了。
我正在尝试为我的应用程序生成签名的 APK。我正在使用 Android Studio 生成发布 APK:构建 > 生成签名 APK。然后我得到一个关于我的密钥库、别名和密码的弹出窗口。这个过程在过去有效,但我怀疑在最近升级工具和其他支持后停止工作。我该怎么做才能让 Android Studio 生成具有有效签名的签名 APK?
当我使用 jarsigner 检查 APK 时,从 Java 1.8 版本开始,我收到消息:
jar is unsigned. (signatures missing or not parsable)
如果我使用 jarsigner 对应用程序进行签名,它会安装在大多数设备上,但不会安装在我的设备上 运行ning Android 4.1。我使用的命令是:
jarsigner -verbose -keystore "...path...\perinote-release.keystore" app-release.apk perinote
此外,如果我添加到 jarsigner 选项:
-digestalg SHA1 -sigalg MD5withRSA
它被 Android 4.1 设备接受。我在另一个 post、no manifest. jar is unsigned. (signatures missing or not parsable) 中找到了这些选项,表明在某些时候,加密从 SHA1 更改为 SHA2。
这是我的 build.gradle "app"
apply plugin: 'com.android.application'
android {
signingConfigs {
release {
keyAlias 'perinote'
storeFile file('...path.../perinote-release.keystore')
}
}
compileSdkVersion 24
buildToolsVersion "25.0.0"
compileOptions.encoding = 'UTF-8'
defaultConfig {
applicationId "com.perinote.camera"
minSdkVersion 15
targetSdkVersion 24
renderscriptTargetApi 20
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
compile 'com.android.support:support-v4:24.0.0'
testCompile 'junit:junit:4.12'
}
如何配置 Android Studio 以使用 SHA1,以便我的应用程序可以继续在 Android 4.1 设备上运行?或者还有什么我应该做的吗?
编辑: 我意识到我应该切换到 SHA256。但我仍然需要一种方法让我的应用程序在 Android 4.1 上达到 运行。我需要生成两个版本并发布它们吗?
要获得两个签名版本,只需选中第二个生成签名 APK 对话框底部的 V1 和 V2 复选框。
我没有注意到这个对话框在更新 AS 后发生了变化,然后就过去了。