我有两台机器在两台Android设备上安装相同的签名apk。其中一台计算机无法安装,并且正在从adb获取失败[INSTALL_PARSE_FAILED_NO_CERTIFICATES] 错误消息。第二台机器可以在不同的设备上安装应用程序,没有任何问题。
有趣的是,在APK文件上使用-verify和-cert进行jarsigner会在不同的计算机上产生不同的结果。无法安装应用程序的人将所有JavaScript文件视为文本文件:
244 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/jqueryMobile/jquery.mobile-1.4.0.txt
236 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/js/initOptions.txt
229 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/js/main.txt
233 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/js/messages.txt
232 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.battery-status/www/battery.txt
231 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.camera/www/Camera.txt
240 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.camera/www/CameraConstants.txt
244 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.camera/www/CameraPopoverHandle.txt
245 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.camera/www/CameraPopoverOptions.txt
232 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.contacts/www/Contact.txt
239 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.contacts/www/ContactAddress.txt
237 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.contacts/www/ContactError.txt
237 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.contacts/www/ContactField.txt
243 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.contacts/www/ContactFindOptions.txt
236 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.contacts/www/ContactName.txt
244 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.contacts/www/ContactOrganization.txt
233 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.contacts/www/contacts.txt
231 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.device/www/device.txt
237 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.device-motion/www/Acceleration.txt
238 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.device-motion/www/accelerometer.txt
237 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.device-orientation/www/CompassError.txt
239 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.device-orientation/www/CompassHeading.txt
232 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.device-orientation/www/compass.txt
237 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.dialogs/www/android/notification.txt
237 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.dialogs/www/notification.txt
239 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/DirectoryEntry.txt
240 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/DirectoryReader.txt
230 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/Entry.txt
229 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/File.txt
234 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/FileEntry.txt
234 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/FileError.txt
235 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/FileReader.txt
235 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/FileSystem.txt
242 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/FileUploadOptions.txt
241 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/FileUploadResult.txt
235 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/FileWriter.txt
230 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/Flags.txt
240 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/LocalFileSystem.txt
233 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/Metadata.txt
238 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/ProgressEvent.txt
242 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/requestFileSystem.txt
250 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file/www/resolveLocalFileSystemURI.txt
237 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file-transfer/www/FileTransfer.txt
242 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.file-transfer/www/FileTransferError.txt
236 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.geolocation/www/Coordinates.txt
233 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.geolocation/www/Position.txt
238 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.geolocation/www/PositionError.txt
236 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.geolocation/www/geolocation.txt
243 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.globalization/www/GlobalizationError.txt
238 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.globalization/www/globalization.txt
237 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.inappbrowser/www/InAppBrowser.txt
230 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.media/www/Media.txt
235 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.media/www/MediaError.txt
244 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.media-capture/www/CaptureAudioOptions.txt
237 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.media-capture/www/CaptureError.txt
244 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.media-capture/www/CaptureImageOptions.txt
244 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.media-capture/www/CaptureVideoOptions.txt
234 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.media-capture/www/MediaFile.txt
238 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.media-capture/www/MediaFileData.txt
232 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.media-capture/www/capture.txt
235 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.network-information/www/Connection.txt
232 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.network-information/www/network.txt
237 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.splashscreen/www/splashscreen.txt
234 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/plugins/org.apache.cordova.vibration/www/vibration.txt
233 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/checksum.txt
232 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/cordova.txt
240 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/cordova_plugins.txt
229 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/wljq.txt
234 Tue Mar 11 11:18:24 PDT 2014 assets/www/default/worklight/worklight.txt
任何建议都非常感谢!
答案 0 :(得分:0)
Hívkislicins,
我有同样的问题,它已签名但拒绝安装给我完全相同的错误。
首先看一下你目前的签名
$ jarsigner -verify -verbose -certs yourPackageName.apk
如果你得到类似的东西
jarsigner: java.lang.SecurityException: invalid SHA-256 signature file digest for classes.dex
尝试从apk中删除META-INF文件夹,然后重新签名。
希望能帮助你。
答案 1 :(得分:0)
导出未签名的APK时,顾名思义是 - 根本没有签名,甚至没有使用调试密钥。调试签名的APK应该驻留在项目的bin
文件夹中!
答案 2 :(得分:0)
感谢大家的建议!这就是实际发生的事情:
因为APK是混合应用程序,所以它包含JS文件。我们通过电子邮件在两台机器之间传输了APK。显然,Microsoft Exchange Server决定检查APK的“危险”文件的内部,并且它这样做,发现了一堆“危险的”JS文件,删除了所有JS文件并用有用的文本文件替换它们来解释它的操作。因此,APK将不再安装,因为它被Microsoft Exchange篡改。显然我们最初并没有注意到,因为我们没想到会有任何篡改APK的行为。