編輯:Android資訊
不止一次有用到Android簽名相關的知識,每次都幾乎從零開始在Google上搜索找,不想在繼續這樣了,找了個時間好好整理了一下自己用到的一些碎片知識,於是乎放到這裡,一是備忘,二是幫助別人。
keytool -list -printcert -jarfile your_apk_file
16:29 $ keytool -list -printcert -jarfile akoi_1.2.apk Signer #1: Signature: Owner: CN=Andrew Wallace, OU=droidyue.com, O=droidyue.com, L=Beijing, ST=Beijing, C=86 Issuer: CN=Andrew Wallace, OU=droidyue.com, O=droidyue.com, L=Beijing, ST=Beijing, C=86 Serial number: 11a8a4a3 Valid from: Tue Feb 10 18:07:43 CST 2015 until: Sun Jun 13 18:07:43 CST 3013 Certificate fingerprints: MD5: 46:C5:BE:EF:B5:C9:00:E1:FA:42:50:50:57:54:CA:15 SHA1: C1:14:5D:0A:C2:BF:F6:06:43:20:AE:2C:07:12:97:58:C2:1B:39:D1 SHA256: 0E:88:7D:C2:4C:D6:84:A7:58:D4:24:1E:9D:38:F9:05:98:1E:B2:A2:D7:CB:0F:81:74:60:5B:38:89:FF:21:1C Signature algorithm name: SHA256withRSA Version: 3
keytool -list -v -keystore your_kestore_file
注意,上述命令執行後,會提示輸入密碼,其實輸入錯誤也沒有關系,不影響結果。
Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry Alias name: droidyue.com Creation date: Feb 10, 2015 Entry type: PrivateKeyEntry Certificate chain length: 1 Certificate[1]: Owner: CN=Andrew Wallace, OU=droidyue.com, O=droidyue.com, L=Beijing, ST=Beijing, C=86 Issuer: CN=Andrew Wallace, OU=droidyue.com, O=droidyue.com, L=Beijing, ST=Beijing, C=86 Serial number: 11a8a4a3 Valid from: Tue Feb 10 18:07:43 CST 2015 until: Sun Jun 13 18:07:43 CST 3013 Certificate fingerprints: MD5: 46:C5:BE:EF:B5:C9:00:E1:FA:42:50:50:57:54:CA:15 SHA1: C1:14:5D:0A:C2:BF:F6:06:43:20:AE:2C:07:12:97:58:C2:1B:39:D1 SHA256: 0E:88:7D:C2:4C:D6:84:A7:58:D4:24:1E:9D:38:F9:05:98:1E:B2:A2:D7:CB:0F:81:74:60:5B:38:89:FF:21:1C Signature algorithm name: SHA256withRSA Version: 3
在沒有源碼情況下,我們就能對apk進行更換簽名。
bash signapk.sh your_apk_file your_keystore_file keystore_pass keystore_alias
16:57 $ bash signapk.sh weixin6313android740.apk ~/Documents/baidu_disk/百度雲同步盤/droidapp/mykiki 123456 droidyue.com param1 weixin6313android740.apk param2 /Users/androidyue/Documents/droidapp/mykiki param3 123456 param4 droidyue.com deleting: META-INF/MANIFEST.MF deleting: META-INF/DROIDYUE.SF deleting: META-INF/DROIDYUE.RSA adding: META-INF/MANIFEST.MF adding: META-INF/DROIDYUE.SF adding: META-INF/DROIDYUE.RSA ...... Verification succesful
生成的文件會放在當前目錄,其文件名相對輸入文件,增加了signed_
前綴,比如對weixin6313android740.apk
進行上述操作得到的輸出文件是signed_weixin6313android740.apk
想要在執行gradle build時生成指定簽名的apk,需要在build.gradle中如下修改
android { signingConfigs { release { storeFile file("myrelease.keystore") storePassword "********" keyAlias "******" keyPassword "******" } } buildTypes { release { signingConfig signingConfigs.release } } }
前言: 昨晚新版本終於發布了,但是還是記得有測試反饋app啟動好長時間也沒進入app主頁,所以今天准備加個班總結一下App啟動那些事! app的啟動方式: 1.)
引言 夜間模式其實屬於多主題切換的一種,不過是最麻煩的一種。因為在夜間模式下不僅要切換主色調,次要色調等等,還要覆蓋一些特殊的顏色,因為在夜間模式下總不能什麼都是
在Android開發中,程序Crash分三種情況:未捕獲的異常、ANR(Application Not Responding)和閃退(NDK引發錯誤)。其中未捕獲
在Android的輸入框中加入清除按鈕,是很常見的設計,本文介紹如何創建一個控件,在輸入框中加入清除按鈕。 我們來看看實現這個控件都需要做什麼: 清除按鈕在輸