我使用keytool,jarsigner和zipalign utlities签署了APK。
我使用了以下命令:
keytool -genkey -v -keystore myAppTransporterKey.keystore -alias myTransporter -keyalg RSA -keysize 2048 -validity 10000
cordova插件rm cordova-plugin-console
cordova build --release android
jarsigner -verbose -keystore C:\Users\ali\Documents\transporterApp\myAppKey.keystore C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk myTransporter
jarsigner -verify C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk
跑完后:
jarsigner -verify -verbose -certs C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk
收到此消息:jar已验证
跑完后:
zipalign -v 4 C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\myTransporter-Final.apk
获取消息:验证成功
在Google Play控制台上传到ALPAH后我收到以下错误
将新APK上传到Alpha
上传
您上传了一个带有无效签名的APK(详情请参阅 签字)。来自apksigner的错误:ERROR(Jar签名者D2DTRANS.RSA):JAR 签名META-INF / D2DTRANS.RSA使用摘要算法 2.16.840.1.101.3.4.2.1和签名算法1.2.840.113549.1.1.1 API级别不支持[[16,17]]
答案 0 :(得分:11)
你需要这些步骤:
1)jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore C:\ Users \ ali \ Documents \ transporterApp \ myAppKey.keystore C:\ Users \ ali \ Documents \ transporterApp \ platforms \ android \ build \ outputs \ apk \ android-release-unsigned.apk myTransporter
2)jarsigner -verify C:\ Users \ ali \ Documents \ transporterApp \ platforms \ android \ build \ outputs \ apk \ android-release-unsigned.apk
3)zipalign -v 4 C:\ Users \ ali \ Documents \ transporterApp \ platforms \ android \ build \ outputs \ apk \ android-release-unsigned.apk C:\ Users \ ali \ Documents \ transporterApp \ platforms \机器人\构建\输出\ APK \ myTransporter-Final.apk
希望这会对你有帮助^^
答案 1 :(得分:1)
您需要执行以下步骤:
zipalign -v 4 C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned.apk C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned-aligned.apk
apksigner sign --ks C:\Users\ali\Documents\transporterApp\myAppKey.keystore --ks-pass pass:[PASSWORD] --key-pass pass:[PASSWORD] --out C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-singned.apk C:\Users\ali\Documents\transporterApp\platforms\android\build\outputs\apk\android-release-unsigned-aligned.apk
要签署应用程序,请使用BuildTools 24.0.3
https://developer.android.com/studio/releases/build-tools.html
答案 2 :(得分:0)
根据official documentation,您可以执行以下步骤:
gbs.AddGrowableCol(1)
文件navigator.storage.estimate()
navigator.webkitTemporaryStorage.queryUsageAndQuota()
您可能需要使用.apk
选项定义密钥库的类型:
zipalign -v -p 4 my-app-unsigned.apk my-app-unsigned-aligned.apk
答案 3 :(得分:0)
已在 Android SDK Build Tools 26.0.2 中发布的 apksigner 0.8 中修复此问题。< / p>
如果问题仍然存在,请在Google issue tracker报告,然后重新审核。