0

There are lots of free android appmarket but Mobogenie is genuine and robust android application container but when i go to upload my android .apk file it is showing me a error "the signature is in debug mode".

How can i fix it?

so what is signature in android?

Pranav P
  • 1,755
  • 19
  • 39

2 Answers2

1

Signature is an engine class which is capable of creating and verifying digital signatures, using different algorithms that have been registered with the Security class.
first import following..and then try to debuggled your methods this way..

import android.content.pm.Signature;  
import java.security.cert.CertificateException;  
import java.security.cert.X509Certificate; 

private static final X500Principal DEBUG_DN = new X500Principal("CN=Android Debug,O=Android,C=US");  
private boolean isDebuggable(Context ctx)
{ 
boolean debuggable = false;

try
{
    PackageInfo pinfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(),PackageManager.GET_SIGNATURES);
    Signature signatures[] = pinfo.signatures;

    CertificateFactory cf = CertificateFactory.getInstance("X.509");

    for ( int i = 0; i < signatures.length;i++)
    {   
        ByteArrayInputStream stream = new ByteArrayInputStream(signatures[i].toByteArray());
        X509Certificate cert = (X509Certificate) cf.generateCertificate(stream);       
        debuggable = cert.getSubjectX500Principal().equals(DEBUG_DN);
        if (debuggable)
            break;
    }
}
catch (NameNotFoundException e)
{
    //debuggable variable will remain false
}
catch (CertificateException e)
{
    //debuggable variable will remain false
}
return debuggable;
}
Aditya Vyas-Lakhan
  • 13,409
  • 16
  • 61
  • 96
1

Android requires that all apps be digitally signed with a certificate before they can be installed. Android uses this certificate to identify the author of an app, and the certificate does not need to be signed by a certificate authority. Android apps often use self-signed certificates. The app developer holds the certificate's private key.

You can sign an app in debug or release mode. You sign your app in debug mode during development and in release mode when you are ready to distribute your app. The Android SDK generates a certificate to sign apps in debug mode. To sign apps in release mode, you need to generate your own certificate.

To Sign your App to relese it, Right click on Project, Go to Android tools, now click on export a sign APK and follow the process, If its first time then you have to create a new keystore and an aliasis into it, after that all process, Eclipse will give you a signed apk which is signed as release mode, Now you have to save that keystore file for later use like whenever you will update your apk then you have to use the same file to export new updated apk.

Cheers -Aman

AmniX
  • 653
  • 5
  • 12