[AC-267] INSTALL_PARSE_FAILED_NO_CERTIFICATES on Android 4.3 older devices
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Cannot Reproduce |
| Resolution Date | 2015-11-05T06:44:56.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Studio |
| Labels | android, build, certificate, java |
| Reporter | carlo |
| Assignee | Motiur Rahman |
| Created | 2015-07-28T09:03:01.000+0000 |
| Updated | 2015-11-18T13:38:24.000+0000 |
Description
If I use a signature file with signature algorithm SHA256withRSA script _build.js stores "SHA256withRSA" as sigalg parameter, the project build, but is impossible to install on older devices that exits with INSTALL_PARSE_FAILED_NO_CERTIFICATES error
As [documentation says](http://developer.android.com/tools/publishing/app-signing.html#signapp) -sigalg should always be "SHA1withRSA", so I modified line 828:
t.keystoreAliases.push({
name: m[1],
sigalg: "MD5withRSA"
});
and it works
[~c3k] which file you modified? Can you please create a test case demonstrating the issue? and if you found the solution, you can create a pull request to fix it, but we need the whole information about this Best
[here](https://www.dropbox.com/sh/7w2wp628jzqb7xl/AABY-eI3fkvq2bdcj7khX_9_a?dl=0) you can find two apk, same signature, different sigalog parameter "KO_sigalg_SHA256withRSA.apk" is the one that sdk 4.1.0 creates and throw INSTALL_PARSE_FAILED_NO_CERTIFICATES while installing on older device I edit 4.1.0.GA\android\cli\commands\_build.js but seems that store sigalg in keystoreAliases is useless (no other file in SDK seems to use it) and everything should work using MD5withRSA at build command (line 4117):
I'm pretty new to this things, will be better if someone can confirm thisAndroidBuilder.prototype.createSignedApk = function createSignedApk(next) { //var sigalg = this.keystoreAlias.sigalg || 'MD5withRSA', signerArgs = [ //'-sigalg', sigalg, '-sigalg', 'MD5withRSA', '-digestalg', 'SHA1', '-keystore', this.keystore, '-storepass', this.keystoreStorePassword ];We have tested this issue on our updated environment .This is not a bug .If we edit 4.1.0.GA\android\cli\commands\_build.js as like reporter , generated APK is not working on devices . It seems that store sigalg in keystoreAliases is needed . Using MD5withRSA only is not working . we get the following log :
*modified code*Test devices :AndroidBuilder.prototype.createSignedApk = function createSignedApk(next) { //var sigalg = this.keystoreAlias.sigalg || 'MD5withRSA', signerArgs = [ //'-sigalg', sigalg, '-sigalg', 'MD5withRSA', '-digestalg', 'SHA1', '-keystore', this.keystore, '-storepass', this.keystoreStorePassword ];Test EnvironmentThanksOperating System Name = Mac OS X Version = 10.10.3 Architecture = 64bit # CPUs = 4 Memory = 8589934592 Node.js Node.js Version = 0.10.37 npm Version = 1.4.28 Titanium CLI CLI Version = 4.0.1 Titanium SDK SDK Version = 4.1.0.GA SDK Path = /Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA Target Platform = androidThere's a sintax error in the code I've posted, sorry. Decomment first of two commented line: {{ AndroidBuilder.prototype.createSignedApk = function createSignedApk(next) { var sigalg = this.keystoreAlias.sigalg || 'MD5withRSA', signerArgs = [ //'-sigalg', sigalg, '-sigalg', 'MD5withRSA', '-digestalg', 'SHA1', '-keystore', this.keystore, '-storepass', this.keystoreStorePassword ]; }} Alernative mod in the same file on line 796: {{ _t.keystoreAliases.push({ name: m[1], sigalg: "MD5withRSA" }); }} I've compiled new test app and I confirm the problem with Titanium SDK 5.0.2. Try "Fiorentinanews_sdk_5.0.2_orginal.apk" from my [Dropbox folder](https://www.dropbox.com/home/_tmp/AC-267/new%20tests%20november%202015%20sdk%205.0.2) on a 4.2 or lower emulator. Apps compiled with the modiefied code are on [Play](https://play.google.com/store/apps/details?id=com.fiorentinanews.app) [Store](https://play.google.com/store/apps/details?id=it.jn24.app) and have 1000+ installs, 25% from 4.2 and lower devices.