Notes by freyo

Displaying keyword search results 1 - 10
Created by freyo on August 31, 2011 15:49:54    Last update: August 31, 2011 15:49:54
Got this error while trying to build Android app: [apkbuilder] Creating AppInfo-debug-unaligned.ap... Solution: Delete the Android debug keystore: $ rm ~/.android/debug.keystore Build again: $ ant debug The new key is valid for 30 years (keystore password is 'android'): $ keytool -list -v -keystore ~/.android/debug.keys...
Created by freyo on August 04, 2011 14:50:32    Last update: August 04, 2011 14:50:32
Take these steps to automate Android APK signing with release key: Put the release key in the Java keystore, for example: /home/freyo/.keystore Create build.properties file with key.store and key.alias entries: key.store=/home/freyo/.keystore key.alias=andro... Build APK with ant release : $ ant release Buildfile: /home/freyo/AndroidApp...
Created by freyo on June 28, 2011 11:11:03    Last update: June 28, 2011 11:11:03
This exception occurs when trying to get a private key: PrivateKey privateKey = (PrivateKey) keyStore.getK... Stack trace: Exception in thread "main" java.security.Unrecover... which was caused by giving a wrong private key password. The solution is to correct the key password in your code, or change the password in the keystore to match that in your code: keytool -keypasswd -alias mykey -keypass oldpasswo...
Created by freyo on June 09, 2011 15:52:12    Last update: June 09, 2011 15:52:30
Follow these steps to add a device administrator application to Android, i.e., make the application appear in the "Select device administrators" screen (Settings -> Location & Security -> Select device administrators): Add a receiver in AndroidManifest.xml : <receiver android:name="android.app.admin.DeviceAd... All elements and attributes listed above are needed. The attribute android:description must be a string resource, not a literal string. The meta-data element points to an XML resource. Create the meta-data resource res/xml/admin_app_resource.xml : <device-admin xmlns:android="http://schemas.androi... Define values for string resources ( res/values/strings.xml ): <?xml version="1.0" encoding="utf-8"?> <resourc...
Created by freyo on May 06, 2011 16:07:33    Last update: May 06, 2011 16:08:36
Private key: -----BEGIN PRIVATE KEY----- MIIEvAIBADANBgkqhki... Certificate: -----BEGIN CERTIFICATE----- MIIEqDCCA5CgAwIBAgI... Import the key pair to the debug keystore: $ cat platform.pem platform.x509.pem >platform-key...
Created by freyo on May 05, 2011 14:40:07    Last update: May 05, 2011 14:40:36
The Android debug key store is located at ${user.home}/.android . On Windows XP, this is: C:\Documents and Settings\<user>\.android\ . Keystore name, password, etc: Keystore name: "debug.keystore" Keystore password: "android" Key alias: "androiddebugkey" Key password: "android" CN: "CN=Android Debug,O=Android,C=US"
Created by freyo on April 20, 2011 15:10:03    Last update: April 20, 2011 15:10:03
When you sign an APK with existing signature, the new certificate is appended to the existing one. If you want to replace the existing certificate, you need to remove it first. But since an APK is just a zip file, this is pretty easy: Remove existing signature: $ zip -d HelloWorld-new.apk META-INF/* deleting... Verify: $ unzip -l HelloWorld-new.apk Archive: HelloWo... Sign it again: $ jarsigner HelloWorld-new.apk android-root Ent...
Created by freyo on April 20, 2011 12:50:09    Last update: April 20, 2011 12:50:09
To sign an Android APK from command line: Sign the APK with jarsigner (using default keystore, android-root is the alias of the signing key): $ jarsigner -signedjar HelloWorld-new.apk HelloWor... Verify signature (optional) $ jarsigner -verify -verbose -certs HelloWorld-new... Align the APK (must use -v 4 option): $ ~/android-sdk-linux_86/tools/zipalign -v 4 Hello...
Created by freyo on April 20, 2011 12:26:08    Last update: April 20, 2011 12:26:08
When you create a new key with Java keytool , it wraps the public key in a self signed certificate. You can generate a certificate signing request with the keytool -certreq command. After a certificate authority (CA) signs the certificate request, you can import the certificate received (a .crt file) back into the key store. Instead of using a CA, you can sign the certificate request with another key (with openssl, for example). If the certificate is not signed by a CA, you'll receive an error: $ keytool -import -alias android-root -file androi... To fix the problem, import the certificate of the signer: $ keytool -import -trustcacerts -file openssl.crt ... Import the certificate again (alias is the alias of the private key whose certificate was...
Created by freyo on April 07, 2011 15:29:01    Last update: April 07, 2011 15:29:01
Format Name Description PKCS #7 Cryptographic Message Syntax Standard A PKCS #7 file can be used to store certificates, which is a SignedData structure without data (just the certificates). The file name extension is usually .p7b , .p7c PKCS #8 Private-Key Information Syntax Standard. Used to carry private certificate keypairs (encrypted or unencrypted). PKCS #12 Personal Information Exchange Syntax Standard. Defines a file format commonly used to store private keys with accompanying public key certificates, protected with a password-based symmetric key. It is the successor to PFX from Microsoft. DER Distinguished Encoding Rules A binary format for keys or certificates. It is a message transfer syntax specified by the ITU in X.690. PEM Privacy Enhanced Mail Base64 encoded DER certificates or keys, with additional header...
Previous  1 2 Next