ITeye博客

Android apk重新签名

kakukemeit · 2013-02-22 17:47 · android · 移动开发 · Markdown

Android apk重新签名

http://06peng.blog.51cto.com/4007179/963245

 

今天在使用Robotium进行Android自动化测试的时候遇到一个问题:Test run failed: Permission Denial: starting instrumentation ComponentInfo{com.local.test/android.test.InstrumentationTestRunner} from pid=356, uid=356 not allowed because package com.local.test does not have a signature matching the target com.***

 

提示是说签名不匹配,由于没有源码,无法生成签名。于是要对apk进行重新签名。

首先用解压缩工具把apk里面的META-INF目录删掉,然后运行在命令行运行一下命令:

D:\>java -jar signapk.jar platform.x509.pem platform.pk8 **.apk **_sined.apk

关于platform.x509.pem platform.pk8这两个文件可以在Android源码目录下

build\target\product\security找到。

 

下载文件 (已下载 3 次)

这个文件只能在登入之后下载。请先注册 或 登入

用以上方法果然还是不行,搞了好久,用另外一种签名方式搞定:

 

D:\Java\jdk1.6.0_30\bin>jarsigner -keystore "C:\Documents and Settings\mzba\.android\debug.keystore" -storepass android -keypass android **.apk androiddebugkey

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。