(转载一个文章,不做解释)

From:http://android-dls.com/wiki/index.php?title=Generating_Keys

When publishing an app for everyone to use, be it with a custom ROM or on the Android market, you need to sign the .apk with a personal private key. The old way of doing this was to use keytool and then sign it with jarsigner, but the way detailed below is a lot easier for most people and uses a standard toolset that should be available on almost any operating system.

One tool for signing .apk is a utility aptly named "SignApk.jar", which is just about the easiest way to sign .apk files. SignApk.jar comes with some test keys, but it's generally advised that you generate your own. The steps below can be used to create some personal private keys and a certificate for use with SignApk.jar.

The "SignApk.jar" file may be downloaded from the Git repo, or you can use Google to search for "AndroidMod.zip download", which also contains the tool.

openssl genrsa -out key.pem 1024 openssl req -new -key key.pem -out request.pem openssl x509 -req -days 9999 -in request.pem -signkey key.pem -out certificate.pem openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8 -nocrypt

Then, you can sign an .apk file using the SignApk.jar tool and the key.pk8 and certificate.pem files you created

java -jar SignApk.jar certificate.pem key.pk8 Application.apk Application_signed.apk

About "AndroidMod.zip":

http://forum.xda-developers.com/showthread.php?t=442480&page=83

本文内容归CSDN博客博主Sodino 所有

转载请注明出处:http://blog.csdn.net/sodino/archive/2011/01/26/6165143.aspx

更多相关文章

  1. Android TestView文本文字修改实例
  2. Android 系统中 gps Location Service 的实现与架构,本文可以帮助
  3. Android 点击按钮,文本文字改变
  4. 分析脚本文件AndroidInitProcess分析心得(1)
  5. Android通知栏消息(基本文字通知)
  6. Android判断网络状态是否断开+Android完全关闭应用程序+ 本文讲
  7. Android下载文本文件和mp3文件
  8. Android-TextView多行本文滚动轻松实现
  9. 解析PHP的基本文本输出

随机推荐

  1. Android开发实战二之Hello Android实例
  2. Android(安卓)2.2兼容性移植
  3. android init 进程分析 (1 简介)
  4. Android五大基本组件
  5. Android(安卓)快速开发系列 ORMLite 框架
  6. android_API -- Android 包的分类
  7. android 进程与线程 - 开发文档翻译 - 进
  8. Android夸进程通信机制七:使用 Socket进行
  9. Android Native与Html互相调用
  10. Android应用开发Android 常见的设计模式