How to sign Android app with system signature?

I’ve downloaded and compiled Android 2.1 version with image for my HTC phone. The compile completed successfully and so the system image flash.
How can I sign my own Android application with the system signature?

Can someone describe the whole process for signing a user application with system signature as I am completely new to the signing process.

  • Is there a way to check if “Install from unknown source” is enabled on Android?
  • Can an Android App connect directly to an online mysql database
  • How to record screen with Android Studio
  • Error Launching AVD - “Could not open file: (null)/system/build.prop: No such file or directory”
  • How to draw filled polygon?
  • How to put a CardView attribute in a style?
  • Related posts:

    how to get html content from a webview?
    Load a file from external storage to Inputstream
    Android Bitmap.createBitmap() returning a bitmap with -1 for height and width
    Android ICS: Remove blue divider in ActionBar?
    create vertical gradient in android
    How to get ISO Country code in android applications?
  • How can I overlay a native view on top of PhoneGap's CordovaWebView in Android?
  • Testing onActivityResult()
  • how to calculate distance while walking in android?
  • How to correctly notify MediaScanner about a folder, even on Nexus/Kitkat devices?
  • android listviews: header and footer views
  • EditText: Center hint but have entered text start from top
  • 2 Solutions collect form web for “How to sign Android app with system signature?”

    Finally I managed to discover a way to sign my application with the platform signature. You need to use keys located in <root-of-android-source-tree>/build/target/product/security/ and add android:sharedUserId="android.uid.system" in your AndroidManifest.xml file.

    Details from this google groups thread:

    On top of signing Android 1.6 for Dream with certificates generated by
    myself, I’ve also managed to sign my app with the platform certificate
    and run it with the system sharedUserId. These are the steps I took:

    • Build and flash to your Dream your own Android using Use the script on to create
      new certificates, including x509 certificates before you do ‘make’.
    • In the AndroidManifest.xml of your application: under the <manifest> element, add the attribute android:sharedUserId="android.uid.system".
    • Export an unsigned version of your Android application using Eclipse: right-click on the project >> Android Tools >> Export
      Unsigned Application Package.
    • Use <root-of-android-source-tree>/out/host/<your-host>/framework/signapk.jar to sign your app using platform.x509.pem and platform.pk8 in <root-of-android-source-tree>/build/target/product/security
      generated earlier:

      java -jar signapk.jar platform.x509.pem platform.pk8 YourApp-unsigned.apk YourApp-signed.apk.
    • Install the app to your device:

      adb install YourApp-signed.apk
    • Run your app
    • Use adb shell ps to confirm that your app is running as system.

    The procedure works fine I have tried it.
    So long as you don’t forget to run zipalign after signing as the signing processes leaves the APK unaligned and it will NOT install. You will need to install the aligned APK.

    zipalign -fv 4 YourApplication-signed.apk YourApplication-aligned.apk
    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.