Titanium JIRA Archive
Appcelerator Community (AC)

[AC-267] INSTALL_PARSE_FAILED_NO_CERTIFICATES on Android 4.3 older devices

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2015-11-05T06:44:56.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsStudio
Labelsandroid, build, certificate, java
Reportercarlo
AssigneeMotiur Rahman
Created2015-07-28T09:03:01.000+0000
Updated2015-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

Comments

  1. Radamantis Torres-Lechuga 2015-07-28

    [~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
  2. carlo 2015-07-29

    [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):
       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
       ];
       
    I'm pretty new to this things, will be better if someone can confirm this
  3. Harish Mridha 2015-08-18

    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 :
       [INFO] :   No aidl files to compile, continuing
       [INFO] :   Generating i18n files
       [INFO] :   Generating /Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/res/values/theme.xml
       [INFO] :   Packaging application: /Users/Raju/Library/android-sdk-macosx/build-tools/22.0.1/aapt "package" "-f" "-m" "-J" "/Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/gen" "-M" "/Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/AndroidManifest.xml" "-A" "/Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/bin/assets" "-S" "/Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/res" "-I" "/Users/Raju/Library/android-sdk-macosx/platforms/android-22/android.jar" "-F" "/Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/bin/app.ap_" "--auto-add-overlay" "--extra-packages" "ti.modules.titanium.ui:android.support.v7.appcompat" "-S" "/var/folders/47/ql8m2gld20g474cjx82w5fdr0000gp/T/115718-84330-qioa5q/res" "-S" "/var/folders/47/ql8m2gld20g474cjx82w5fdr0000gp/T/115718-84330-1azwbki/res"
       [INFO] :   Building Java source files: /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/javac "-J-Xmx256M" "-encoding" "utf8" "-bootclasspath" "/Users/Raju/Library/android-sdk-macosx/platforms/android-22/android.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/kroll-v8.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-analytics.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/aps-analytics.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-android.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/jaxen-1.1.1.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/ti-commons-codec-1.3.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/kroll-common.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/titanium.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-app.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-ui.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/nineoldandroids-appc-2.4.0.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-filesystem.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-media.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-appcompat.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/android-support-v4.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/android-support-v7-appcompat.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-locale.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-network.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/thirdparty.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-xml.jar:/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/lib/titanium-verify.jar:R.class:Ac267Activity.class:Ac267AppInfo.class:Ac267Application.class:ApplicationStylesheet.class:AssetCryptImpl.class" "-d" "/Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/bin/classes" "-proc:none" "-target" "1.6" "-source" "1.6" "@/Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/java-sources.txt"
       [INFO] :   Running dexer: /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java "-Xmx1024M" "-XX:-UseGCOverheadLimit" "-Djava.ext.dirs=/Users/Raju/Library/android-sdk-macosx/platform-tools" "-jar" "/Users/Raju/Library/android-sdk-macosx/build-tools/22.0.1/lib/dx.jar" "--dex" "--output=/Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/bin/classes.dex" "/Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/bin/classes" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/lib/titanium-verify.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/kroll-v8.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-analytics.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/aps-analytics.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-android.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/jaxen-1.1.1.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/ti-commons-codec-1.3.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/kroll-common.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/titanium.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-app.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-ui.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/nineoldandroids-appc-2.4.0.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-filesystem.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-media.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-appcompat.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/android-support-v4.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/android-support-v7-appcompat.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-locale.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-network.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/thirdparty.jar" "/Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA/android/modules/titanium-xml.jar"
       [INFO] :   Creating unsigned apk
       [INFO] :   Processing /Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/src
       [INFO] :   Writing unsigned apk: /Users/Raju/Documents/Appcelerator_Studio_Workspace/AC267/build/android/bin/app-unsigned.apk
       TRACE  | titanium exited with exit code 0
       
       
    *modified code*
       
       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 devices :
       1. Samsung 4.3
       2. Samsung Tab 4.4
       3 .Nexus 5.1.1
       
    Test Environment
       Operating 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             = android
       
    Thanks
  4. carlo 2015-11-18

    There'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.

JSON Source