Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/203.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用系统证书签署apk_Java_Android_Events_Keystore_Keytool - Fatal编程技术网

Java 使用系统证书签署apk

Java 使用系统证书签署apk,java,android,events,keystore,keytool,Java,Android,Events,Keystore,Keytool,您好,我正在编写一个使用事件注入的程序。因此,为了获得系统权限,我必须使用系统证书对apk进行签名。我尝试了这个链接中提到的方法 但是当我尝试时,我得到了以下错误 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 pla

您好,我正在编写一个使用事件注入的程序。因此,为了获得系统权限,我必须使用系统证书对apk进行签名。我尝试了这个链接中提到的方法

但是当我尝试时,我得到了以下错误

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

转到
C:\ProgramFiles\Java\jdk1.7.0\bin>
,然后

试试这个

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

该命令是keytool importkeypair命令,而不是keytool命令
您需要将keytool importkeypair添加到路径中,因为keytool importkeypair是一个没有空格的命令。要实现这一目标:

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

2) 一旦文件存在,您只需键入即可使用它


$./keytool importkeypair“命令的其余部分”

您好,如果找到您的解决方案,请与我们分享。