用系统证书签名apk

时间:2014-02-11 06:09:04

标签: java android events keystore keytool

您好我正在编写一个使用事件注入的程序。为了获得系统权限,我必须使用系统证书对apk进行签名。我尝试过这个链接中提到的 http://paulononaka.wordpress.com/2011/10/19/apk-with-system-privileges/ https://github.com/getfatday/keytool-importkeypair

但是当我尝试时出现以下错误

C:\Program Files\Java\jdk1.7.0\bin>keytool -importkeypair -k ~/C:\Users\name\.androiddebug.keystore -p android -pk8 platform.pk8 -cert platform.x509.
pem -alias platform
Illegal option:  -importkeypair
Key and Certificate Management Tool

Commands:

 -certreq            Generates a certificate request
 -changealias        Changes an entry's alias
 -delete             Deletes an entry
 -exportcert         Exports certificate
 -genkeypair         Generates a key pair
 -genseckey          Generates a secret key
 -gencert            Generates certificate from a certificate request
 -importcert         Imports a certificate or a certificate chain
 -importkeystore     Imports one or all entries from another keystore
 -keypasswd          Changes the key password of an entry
 -list               Lists entries in a keystore
 -printcert          Prints the content of a certificate
 -printcertreq       Prints the content of a certificate request
 -printcrl           Prints the content of a CRL file
 -storepasswd        Changes the store password of a keystore

Use "keytool -command_name -help" for usage of command_name

3 个答案:

答案 0 :(得分:0)

转到C:\Program Files\Java\jdk1.7.0\bin>然后

试试这个

keytool -list -v -alias androiddebugkey -keystore C:\Users\[your_user_name]\.android\debug.keystore -storepass android -keypass android

答案 1 :(得分:0)

该命令是keytool-importkeypair,而不是keytool 您需要以某种方式将keytool-importkeypair添加到您的路径

答案 2 :(得分:0)

keytool-importkeypair是一个没有空格的命令。要做到这一点:

1)从以下位置下载keytool-importkeypair并将其保存到存在平台证书的同一文件夹中

https://github.com/getfatday/keytool-importkeypair

2)文件存在后,只需输入

即可使用

$。/ keytool-importkeypair“其余命令”

相关问题