2013年10月3日 星期四

[Android] 檢查apk sign的key

與sign key一樣使用java的指令 -- jarsigner

$ jarsigner -verify -verbose -certs [apk_name]

會列出來像是以下的資訊
sm      3512 Mon Apr 15 00:13:32 CST 2013 AndroidManifest.xml

      X.509, CN=Android Debug, O=Android, C=US
      [certificate is valid from 2013/4/14 下午 3:10 to 2043/4/7 下午 3:10]

sm      5937 Sun Apr 14 15:09:46 CST 2013 res/drawable-xhdpi/ic_launcher.png

      X.509, CN=Android Debug, O=Android, C=US
      [certificate is valid from 2013/4/14 下午 3:10 to 2043/4/7 下午 3:10]

如果用Android test key sign過的apk結果會長這樣
sm      3875 Wed Apr 16 07:40:50 CST 2008 res/drawable-hdpi/rbt_icon.png

      X.509, EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
      [certificate is valid from 2008/4/16 上午 6:40 to 2035/9/2 上午 6:40]

sm      1765 Wed Apr 16 07:40:50 CST 2008 res/drawable-ldpi/rbt_icon.png

      X.509, EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
      [certificate is valid from 2008/4/16 上午 6:40 to 2035/9/2 上午 6:40]

可以藉此得知apk是用哪一把key sign的

refs:http://www.cnblogs.com/not-code/archive/2011/05/15/2047057.html

沒有留言:

張貼留言