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

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手机状态解释,比如android.os.Build.VERSION.SDK
  2. Android(安卓)Studio 使用技巧(5)
  3. Android(安卓)Studio 使用技巧(4)
  4. Android(安卓)Studio 使用技巧(6)
  5. Android_判断文件是否存在并创建代码
  6. Android(安卓)GestureDetector手势识别类
  7. 关于android中的各种路径对应的方法
  8. Android(安卓)xxx is not translated in yyy, zzz 的解决方法
  9. Android之Telephony各文件解释

随机推荐

  1. Android游戏引擎Rokon宣布停止更新
  2. Android之AlertDialog的基础使用
  3. 如何检查后台服务(Android的Service类)是否
  4. android thread handler timertask
  5. Android中如何获得一些系统设置和环境变
  6. Android强制使用WebView不调用系统或外部
  7. androidPN体系结构
  8. Android开发指南(36) —— Search
  9. Android如何平移一个View
  10. android 开源的游戏引擎