如何在编译过后自动签名apk
2014-03-01 09:58
134 查看
1、使用keytool创建android的keystore
keytool -genkeypair -v -keystore android.keystore -alias android -keyalg RSA -validity 20000
-genkeypair 生成密钥对
-v 详细输出
-keystore <keystore> 密钥库名称
-alias <alias> 要处理的条目的别名
-keyalg <keyalg> 密钥算法名称
-validity <valDays> 有效天数
2、将生成的android.keystore写入ant.properties文件
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
key.store=D:\\tank\\MyKeystore.ks
key.alias=myalias
key.store.password=123456
key.alias.password=123456
添加创建时的密码 ,当创建批处理文件时可以自动添加。
3、使用ant进行编译
ant release
未对齐的apk:xxx-release-unaligned.apk
对齐后但未签名的apk:xxx--release-unsigned.apk
生成签名的apk:xxx-release.apk
【注】对齐的APK,就是使它所有没有被压缩的资源都4bytes对齐,这样提高API访问这些资源的速度。
keytool -genkeypair -v -keystore android.keystore -alias android -keyalg RSA -validity 20000
-genkeypair 生成密钥对
-v 详细输出
-keystore <keystore> 密钥库名称
-alias <alias> 要处理的条目的别名
-keyalg <keyalg> 密钥算法名称
-validity <valDays> 有效天数
2、将生成的android.keystore写入ant.properties文件
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
key.store=D:\\tank\\MyKeystore.ks
key.alias=myalias
key.store.password=123456
key.alias.password=123456
添加创建时的密码 ,当创建批处理文件时可以自动添加。
3、使用ant进行编译
ant release
未对齐的apk:xxx-release-unaligned.apk
对齐后但未签名的apk:xxx--release-unsigned.apk
生成签名的apk:xxx-release.apk
【注】对齐的APK,就是使它所有没有被压缩的资源都4bytes对齐,这样提高API访问这些资源的速度。
相关文章推荐
- mac os上android申请签名和使用ant自动编译打包签名apk
- Android Studio 如何使每次编译出来的APK都带签名
- 分享一个自动编译,打包,签名 android apk 的小脚本
- 【Android】打包过程:生成自动代码->编译->(混淆)->dex文件->生成资源文件->打apk包->(签名)->对齐
- [Android] mac上申请签名及使用ant自动编译打包签名APK
- 一个项目如何编译多个不同签名、包名、资源等,的apk?
- Android Apk包的签名出库、自动编译与混淆
- android编译时如何决定一个APK等Module是否被自动编译到system.img中
- [Android] mac上申请签名及使用ant自动编译打包签名APK
- 如何将Android 源码中编译出的apk进行自己的签名
- 在Ubuntu下,如何对APK进行反编译,回编译,以及签名
- 「转」Android如何防止apk程序被反编译
- 如何分析一个Android程序(反编译+重新编译+签名)
- 如何利用dex2jar反编译APK
- Flash AS3.0开发Android apk如何禁止自动翻转
- Tiny4412 Android5.0 定制:编译生成img后如何删除原厂的apk
- Android如何防止apk程序被反编译
- Android如何防止apk程序被反编译
- 用apktool工具反编译apk后怎么得到源码,重新打包,签名
- Android如何防止apk程序被反编译