{"id":440,"date":"2009-06-07T00:14:45","date_gmt":"2009-06-06T16:14:45","guid":{"rendered":"http:\/\/percy.blog.ubuntu.org.cn\/?p=440"},"modified":"2009-06-07T00:14:45","modified_gmt":"2009-06-06T16:14:45","slug":"android%e8%87%aa%e5%8a%a8%e7%94%9f%e6%88%90keystore%e5%92%8c%e8%87%aa%e5%8a%a8%e7%ad%be%e5%90%8d%e5%8f%8a%e8%87%aa%e5%8a%a8%e9%87%8d%e8%a3%85apk%e7%9a%84%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/pjq.me\/?p=440","title":{"rendered":"Android:\u81ea\u52a8\u751f\u6210keystore\u548c\u81ea\u52a8\u7b7e\u540d\u53ca\u81ea\u52a8\u91cd\u88c5APK\u7684\u811a\u672c"},"content":{"rendered":"<p>\u6bcf\u6b21\u8981\u751f\u6210keystore\u90fd\u8981\u8f93\u5165\u4e00\u5806\u547d\u4ee4\uff0c\u800c\u4e14\u96be\u8bb0\uff0c\u987a\u4fbf\u5c31\u5199\u4e86\u51e0\u4e2a\u5c0f\u811a\u672c\uff1a<br \/>\n\u53ef\u4ee5\u5728\u8fd9\u91cc\u4e0b\u8f7d<br \/>\nhttp:\/\/github.com\/pjq\/AndroidShell\/tree\/master<\/p>\n<p>\u7528\u6765\u751f\u6210keystore\u7684\uff0c\u5e76\u4e14\u81ea\u52a8\u5bf9\u5f53\u524d\u5de5\u7a0bAPK\u6587\u4ef6\u8fdb\u884c\u7b7e\u540d\uff0c\u9700\u8981\u5728\u5de5\u7a0b\u6839\u76ee\u5f55\u4e0b\u6267\u884c<br \/>\n\u6bd4\u5982\u8981\u4ea7\u751f myapp.keystore<br \/>\n\u53ea\u8981\u6267\u884c\uff1a.\/genkey myapp<\/p>\n<pre lang=\"sh\">\n\ncat \/usr\/local\/bin\/genkey\n#!\/bin\/sh\n#Author:pengjianqing@sina.com\n#Date:20090607\n#description:used to gen the keystore\n#Filename:genkey.sh\n#USAGE:\n#Example:\n#.\/genkey.sh appname\n#\n#\n\necho \"========================================\"\nAPKFILE=`ls bin\/ -l|grep apk|cut -d \" \" -f8`\necho \"APKFILE=${APKFILE}\"\necho \"========================================\"\n\n\necho \"Generage the keystore:\"\necho \"keytool -genkey -v -keystore ${1}.keystore -alias ${1} -keyalg RSA -validity 10000\"\nkeytool -genkey -v -keystore ${1}.keystore -alias ${1} -keyalg RSA -validity 10000\n\necho \"show the MD5 of the keystore:\"\necho \"keytool -list  -keystore ${1}.keystore\"\nkeytool -list  -keystore ${1}.keystore\n\necho \"Sign the apk:\"\necho \"jarsigner -verbose -keystore ${1}.keystore bin\/${APKFILE} ${1}\"\njarsigner -verbose -keystore ${1}.keystore bin\/${APKFILE} ${1}\n\n#echo\"Uninstall the apk\"\n#adb uninstall com.pjq.googlemapsample\n\n#echo \"Install the apk\"\n#adb install bin\/GooglemapSample.apk\n\n<\/pre>\n<p>\u81ea\u52a8\u7b7e\u540d\uff0c\u5e76\u81ea\u52a8\u91cd\u65b0\u5b89\u88c5APK\u6587\u4ef6,\u9700\u8981\u5728\u5de5\u7a0b\u6839\u76ee\u5f55\u4e0b\u6267\u884c<br \/>\n.\/sa.sh<br \/>\n\uff1a<\/p>\n<pre lang=\"sh\">\n cat sa.sh\n#########################################################################\n# Author: pengjianqing@sina.com\n# Created Time: Sat 06 Jun 2009 11:31:57 PM CST\n# File Name: SignAndroid.sh:sa.sh\n# Description:Used to auto sign the apk file,then reinstall it.\n#Example:\n#.\/sa.sh\n#########################################################################\n#!\/bin\/bash\necho \"========================================\"\nKEYSTORE=`ls -l|grep keystore|cut -d \" \" -f8`\necho \"KEYSTORE=${KEYSTORE}\"\nPRENAME=`echo ${KEYSTORE}|cut -d \".\" -f1`\necho \"PRENAME=${PRENAME}\"\nPACKAGE=`grep package AndroidManifest.xml|cut -d \"\\\"\" -f2`\necho \"PACKAGE=${PACKAGE}\"\nAPKFILE=`ls bin\/ -l|grep apk|cut -d \" \" -f8`\necho \"APKFILE=${APKFILE}\"\necho \"========================================\"\n\necho \"****************************************\"\necho \"Sign the apk:\"\necho \"jarsigner -verbose -keystore ${KEYSTORE} bin\/${APKFILE} ${PRENAME}\"\njarsigner -verbose -keystore ${KEYSTORE} bin\/${APKFILE}  ${PRENAME}\necho \"****************************************\"\n\necho \"Uninstall the apk:\"\necho \"adb uninstall ${PACKAGE} \"\nadb uninstall ${PACKAGE}\necho \"****************************************\"\n\necho \"Install apk:\"\necho \"adb install bin\/${APKFILE}\"\nadb install bin\/${APKFILE}\necho \"****************************************\"\necho \"Finished!!\"\necho \"****************************************\"\n\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6bcf\u6b21\u8981\u751f\u6210keystore\u90fd\u8981\u8f93\u5165\u4e00\u5806\u547d\u4ee4\uff0c\u800c\u4e14\u96be\u8bb0\uff0c\u987a\u4fbf\u5c31\u5199\u4e86\u51e0\u4e2a\u5c0f\u811a\u672c\uff1a \u53ef\u4ee5\u5728\u8fd9\u91cc\u4e0b\u8f7d http:\/\/github.com\/pjq\/AndroidShell\/tree\/master \u7528\u6765\u751f\u6210keystore\u7684\uff0c\u5e76\u4e14\u81ea\u52a8\u5bf9\u5f53\u524d\u5de5\u7a0bAPK\u6587\u4ef6\u8fdb\u884c\u7b7e\u540d\uff0c\u9700\u8981\u5728\u5de5\u7a0b\u6839\u76ee\u5f55\u4e0b\u6267\u884c \u6bd4\u5982\u8981\u4ea7\u751f myapp.keystore \u53ea\u8981\u6267\u884c\uff1a.\/genkey myapp cat \/usr\/local\/bin\/genkey #!\/bin\/sh #Author:pengjianqing@sina.com #Date:20090607 #description:used to gen the keystore #Filename:genkey.sh #USAGE: #Example: #.\/genkey.sh appname # # echo &#8220;========================================&#8221; APKFILE=`ls bin\/ -l|grep apk|cut -d &#8221; &#8221; -f8` echo &#8220;APKFILE=${APKFILE}&#8221; echo &#8220;========================================&#8221; echo<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[50,85,103],"class_list":["post-440","post","type-post","status-publish","format-standard","hentry","category-android","tag-android","tag-keystore","tag-shell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android:\u81ea\u52a8\u751f\u6210keystore\u548c\u81ea\u52a8\u7b7e\u540d\u53ca\u81ea\u52a8\u91cd\u88c5APK\u7684\u811a\u672c - Jianqing&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/pjq.me\/?p=440\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android:\u81ea\u52a8\u751f\u6210keystore\u548c\u81ea\u52a8\u7b7e\u540d\u53ca\u81ea\u52a8\u91cd\u88c5APK\u7684\u811a\u672c - Jianqing&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"\u6bcf\u6b21\u8981\u751f\u6210keystore\u90fd\u8981\u8f93\u5165\u4e00\u5806\u547d\u4ee4\uff0c\u800c\u4e14\u96be\u8bb0\uff0c\u987a\u4fbf\u5c31\u5199\u4e86\u51e0\u4e2a\u5c0f\u811a\u672c\uff1a \u53ef\u4ee5\u5728\u8fd9\u91cc\u4e0b\u8f7d http:\/\/github.com\/pjq\/AndroidShell\/tree\/master \u7528\u6765\u751f\u6210keystore\u7684\uff0c\u5e76\u4e14\u81ea\u52a8\u5bf9\u5f53\u524d\u5de5\u7a0bAPK\u6587\u4ef6\u8fdb\u884c\u7b7e\u540d\uff0c\u9700\u8981\u5728\u5de5\u7a0b\u6839\u76ee\u5f55\u4e0b\u6267\u884c \u6bd4\u5982\u8981\u4ea7\u751f myapp.keystore \u53ea\u8981\u6267\u884c\uff1a.\/genkey myapp cat \/usr\/local\/bin\/genkey #!\/bin\/sh #Author:pengjianqing@sina.com #Date:20090607 #description:used to gen the keystore #Filename:genkey.sh #USAGE: #Example: #.\/genkey.sh appname # # echo &quot;========================================&quot; APKFILE=`ls bin\/ -l|grep apk|cut -d &quot; &quot; -f8` echo &quot;APKFILE=${APKFILE}&quot; echo &quot;========================================&quot; echo\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pjq.me\/?p=440\" \/>\n<meta property=\"og:site_name\" content=\"Jianqing&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2009-06-06T16:14:45+00:00\" \/>\n<meta name=\"author\" content=\"pengjianqing\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pengjianqing\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/pjq.me\/?p=440#article\",\"isPartOf\":{\"@id\":\"https:\/\/pjq.me\/?p=440\"},\"author\":{\"name\":\"pengjianqing\",\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"headline\":\"Android:\u81ea\u52a8\u751f\u6210keystore\u548c\u81ea\u52a8\u7b7e\u540d\u53ca\u81ea\u52a8\u91cd\u88c5APK\u7684\u811a\u672c\",\"datePublished\":\"2009-06-06T16:14:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/pjq.me\/?p=440\"},\"wordCount\":20,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"keywords\":[\"Android\",\"keystore\",\"SHELL\"],\"articleSection\":[\"Android\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/pjq.me\/?p=440#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/pjq.me\/?p=440\",\"url\":\"https:\/\/pjq.me\/?p=440\",\"name\":\"Android:\u81ea\u52a8\u751f\u6210keystore\u548c\u81ea\u52a8\u7b7e\u540d\u53ca\u81ea\u52a8\u91cd\u88c5APK\u7684\u811a\u672c - Jianqing&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/pjq.me\/#website\"},\"datePublished\":\"2009-06-06T16:14:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/pjq.me\/?p=440#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/pjq.me\/?p=440\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/pjq.me\/?p=440#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/pjq.me\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android:\u81ea\u52a8\u751f\u6210keystore\u548c\u81ea\u52a8\u7b7e\u540d\u53ca\u81ea\u52a8\u91cd\u88c5APK\u7684\u811a\u672c\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/pjq.me\/#website\",\"url\":\"https:\/\/pjq.me\/\",\"name\":\"Jianqing&#039;s Blog\",\"description\":\"Thoughts and Future\",\"publisher\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/pjq.me\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\",\"name\":\"pengjianqing\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png\",\"contentUrl\":\"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png\",\"width\":460,\"height\":752,\"caption\":\"pengjianqing\"},\"logo\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/pjq.me\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android:\u81ea\u52a8\u751f\u6210keystore\u548c\u81ea\u52a8\u7b7e\u540d\u53ca\u81ea\u52a8\u91cd\u88c5APK\u7684\u811a\u672c - Jianqing&#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/pjq.me\/?p=440","og_locale":"en_US","og_type":"article","og_title":"Android:\u81ea\u52a8\u751f\u6210keystore\u548c\u81ea\u52a8\u7b7e\u540d\u53ca\u81ea\u52a8\u91cd\u88c5APK\u7684\u811a\u672c - Jianqing&#039;s Blog","og_description":"\u6bcf\u6b21\u8981\u751f\u6210keystore\u90fd\u8981\u8f93\u5165\u4e00\u5806\u547d\u4ee4\uff0c\u800c\u4e14\u96be\u8bb0\uff0c\u987a\u4fbf\u5c31\u5199\u4e86\u51e0\u4e2a\u5c0f\u811a\u672c\uff1a \u53ef\u4ee5\u5728\u8fd9\u91cc\u4e0b\u8f7d http:\/\/github.com\/pjq\/AndroidShell\/tree\/master \u7528\u6765\u751f\u6210keystore\u7684\uff0c\u5e76\u4e14\u81ea\u52a8\u5bf9\u5f53\u524d\u5de5\u7a0bAPK\u6587\u4ef6\u8fdb\u884c\u7b7e\u540d\uff0c\u9700\u8981\u5728\u5de5\u7a0b\u6839\u76ee\u5f55\u4e0b\u6267\u884c \u6bd4\u5982\u8981\u4ea7\u751f myapp.keystore \u53ea\u8981\u6267\u884c\uff1a.\/genkey myapp cat \/usr\/local\/bin\/genkey #!\/bin\/sh #Author:pengjianqing@sina.com #Date:20090607 #description:used to gen the keystore #Filename:genkey.sh #USAGE: #Example: #.\/genkey.sh appname # # echo \"========================================\" APKFILE=`ls bin\/ -l|grep apk|cut -d \" \" -f8` echo \"APKFILE=${APKFILE}\" echo \"========================================\" echo","og_url":"https:\/\/pjq.me\/?p=440","og_site_name":"Jianqing&#039;s Blog","article_published_time":"2009-06-06T16:14:45+00:00","author":"pengjianqing","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pengjianqing","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pjq.me\/?p=440#article","isPartOf":{"@id":"https:\/\/pjq.me\/?p=440"},"author":{"name":"pengjianqing","@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"headline":"Android:\u81ea\u52a8\u751f\u6210keystore\u548c\u81ea\u52a8\u7b7e\u540d\u53ca\u81ea\u52a8\u91cd\u88c5APK\u7684\u811a\u672c","datePublished":"2009-06-06T16:14:45+00:00","mainEntityOfPage":{"@id":"https:\/\/pjq.me\/?p=440"},"wordCount":20,"commentCount":1,"publisher":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"keywords":["Android","keystore","SHELL"],"articleSection":["Android"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pjq.me\/?p=440#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pjq.me\/?p=440","url":"https:\/\/pjq.me\/?p=440","name":"Android:\u81ea\u52a8\u751f\u6210keystore\u548c\u81ea\u52a8\u7b7e\u540d\u53ca\u81ea\u52a8\u91cd\u88c5APK\u7684\u811a\u672c - Jianqing&#039;s Blog","isPartOf":{"@id":"https:\/\/pjq.me\/#website"},"datePublished":"2009-06-06T16:14:45+00:00","breadcrumb":{"@id":"https:\/\/pjq.me\/?p=440#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pjq.me\/?p=440"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/pjq.me\/?p=440#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pjq.me\/"},{"@type":"ListItem","position":2,"name":"Android:\u81ea\u52a8\u751f\u6210keystore\u548c\u81ea\u52a8\u7b7e\u540d\u53ca\u81ea\u52a8\u91cd\u88c5APK\u7684\u811a\u672c"}]},{"@type":"WebSite","@id":"https:\/\/pjq.me\/#website","url":"https:\/\/pjq.me\/","name":"Jianqing&#039;s Blog","description":"Thoughts and Future","publisher":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pjq.me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60","name":"pengjianqing","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pjq.me\/#\/schema\/person\/image\/","url":"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png","contentUrl":"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png","width":460,"height":752,"caption":"pengjianqing"},"logo":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/image\/"},"url":"https:\/\/pjq.me\/?author=1"}]}},"views":33586,"_links":{"self":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=440"}],"version-history":[{"count":0,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/440\/revisions"}],"wp:attachment":[{"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}