{"id":1488,"date":"2019-03-12T23:28:59","date_gmt":"2019-03-12T15:28:59","guid":{"rendered":"https:\/\/pjq.me\/?p=1488"},"modified":"2019-04-02T11:15:41","modified_gmt":"2019-04-02T03:15:41","slug":"android-p9-0-api-level-28-%e5%8d%87%e7%ba%a7%e4%b8%8d%e5%ae%8c%e5%85%a8%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/pjq.me\/?p=1488","title":{"rendered":"Android P(9.0\/API Level 28) \u5347\u7ea7\u4e0d\u5b8c\u5168\u6559\u7a0b"},"content":{"rendered":"\n<p>\u81ea\u4ece\u53bb\u5e74Google\u5f3a\u5236\u5347\u7ea7target API\u523026\u4e4b\u540e\uff0cGoogle\u5c31\u5f00\u59cb\u8ba1\u5212\u7740\u4e0b\u4e00\u6ce2\u7684\u5347\u7ea7\uff0c\u800c\u8fd9\u6b21\u662f\u8981\u5347\u7ea7\u52309, \u4e5f\u5c31\u662ftarget API level 28\uff0c\u800c\u4e14\u65e5\u671f\u4e5f\u5df2\u7ecf\u5b9a\u4e86 &#8220;November 1, 2019&#8243;\u3002<\/p>\n\n\n\n<p>\u4ee5\u524d\u6bcf\u6b21API\u5347\u7ea7\u90fd\u662f\u5c0f\u6253\u5c0f\u95f9\uff0c\u5e76\u4e0d\u4f1a\u6709\u90a3\u79cd\u5927\u89c4\u6a21\u7684\u6539\u52a8\uff0c\u800c\u8fd9\u6b21\u6539\u52a8\u5c31\u6709\u70b9\u5927\u4e86\u3002\u5f53\u7136\u8fd9\u6b21\u5f3a\u5236target API\u5347\u7ea7\u5bf9\u56fd\u5185\u5f00\u53d1\u8005\u7684\u5f71\u54cd\u4f1a\u5c0f\u4e00\u4e9b\uff0c\u56e0\u4e3a\u6bd5\u7adf\u4e0d\u7528\u53d1\u5e03\u5230Google Play\uff0c\u800c\u56fd\u5185\u5e94\u7528\u5e02\u573a\u8fd9\u4e48\u591a\uff0c\u5404\u4e2a\u8981\u6c42\u4e5f\u90fd\u53c2\u5dee\u4e0d\u9f50\uff0c\u6240\u4ee5\u77ed\u671f\u8fd8\u662f\u5b89\u5168\u7684\u3002<\/p>\n\n\n\n<p>\u8fd9\u6b21\u6539\u52a8\u5176\u5b9e\u52a8\u7684\u6700\u5927\u7684\u5c31\u662f\u975e\u5b98\u65b9API\u7684\u8c03\u7528\uff0c\u4e5f\u5305\u542b&#8221;Java Reflection&#8221;\uff0c\u57fa\u672c\u4e0a\u53ef\u4ee5\u8bf4\u56fd\u5185\u8981\u7528\u5230\u7684\u90a3\u4e9b\u52a8\u6001APP\u5347\u7ea7\u65b9\u6848\u90fd\u57fa\u672c\u88ab\u4f24\u4e86\uff0c\u7f51\u4e0a\u641c\u4e86\u4e00\u4e0b\uff0c\u4e5f\u627e\u5230\u4e00\u4e9b\u5385\u6deb\u6280\u5de7\uff0c\u53ef\u4ee5\u7ed5\u8fc7\u53bb\u5b98\u65b9\u7684\u8fd9\u4e2a\u9650\u5236\uff0c\u6b63\u6240\u8c13\u9053\u9ad8\u4e00\u5c3a\uff0c\u9b54\u9ad8\u4e00\u4e08\uff0c\u4f46\u603b\u7684\u6765\u8bf4\u8fd9\u6837\u505a\u662f\u4e0d\u63a8\u8350\u7684\uff0c\u56e0\u4e3a\u4e0d\u77e5\u9053\u7cfb\u7edf\u53c8\u505a\u4e2a\u5347\u7ea7\uff0c\u5c31\u628a\u8fd9\u4e9b\u65b9\u6848\u7ed9\u5e72\u6389\u3002\u5b98\u6587\u7ed9\u4e86\u9ed1\u540d\u5355\u5217\u8868\u548c\u7070\u540d\u5355\u5217\u8868\uff0c\u9ed1\u540d\u5355\u662f\u4e00\u5b9a\u8981\u4fee\u590d\u7684\uff0c\u7070\u540d\u5355\u53ea\u662f\u4e00\u4e2a\u8fc7\u6e21\u9636\u6bb5\uff0c\u540e\u9762\u770bGoogle\u7684\u5fc3\u60c5\u4ec0\u4e48\u65f6\u5019\u5728\u7cfb\u7edf\u5c42\u9762\u5f3a\u5236\u6267\u884c\uff0c\u90a3\u5c31\u5fc5\u987b\u90fd\u4fee\u590d\u30022019\u5e74\u7684Google IO\u5927\u4f1a\u5728\u5373\uff0c\u5c31\u770b\u8fd9\u6b21Google\u6709\u4ec0\u4e48\u8868\u793a\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/pjq.me\/?p=1488\/#%E5%85%B7%E4%BD%93%E6%88%91%E4%BB%AC%E9%9C%80%E8%A6%81%E5%81%9A%E4%BB%80%E4%B9%88take_away\" >\u5177\u4f53\u6211\u4eec\u9700\u8981\u505a\u4ec0\u4e48\/take away<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/pjq.me\/?p=1488\/#Java_Reflection_%E9%9D%9E%E5%AE%98%E6%96%B9%E6%89%AB%E6%8F%8F%E5%91%BD%E4%BB%A4\" >Java Reflection \u975e\u5b98\u65b9\u626b\u63cf\u547d\u4ee4<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/pjq.me\/?p=1488\/#Tools_to_scan_the_blackgrey_list\" >Tools to scan the black\/grey list<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/pjq.me\/?p=1488\/#androidxJetPack_migration\" >androidx\/JetPack migration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/pjq.me\/?p=1488\/#%E5%85%B3%E4%BA%8E%E7%AC%AC%E4%B8%89%E6%96%B9library\" >\u5173\u4e8e\u7b2c\u4e09\u65b9library<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/pjq.me\/?p=1488\/#%E5%85%B3%E4%BA%8E%E6%8E%A8%E8%BF%9Ftarget_API_28%E7%9A%84%E6%83%B3%E6%B3%95\" >\u5173\u4e8e\u63a8\u8fdftarget API 28\u7684\u60f3\u6cd5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/pjq.me\/?p=1488\/#Reference\" >Reference<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%85%B7%E4%BD%93%E6%88%91%E4%BB%AC%E9%9C%80%E8%A6%81%E5%81%9A%E4%BB%80%E4%B9%88take_away\"><\/span>\u5177\u4f53\u6211\u4eec\u9700\u8981\u505a\u4ec0\u4e48\/take away<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>\u628a\u5b98\u65b9\u76f8\u5173\u7684\u6587\u6863\u90fd\u770b\u8fc7\u4e86\uff0c\u4e0b\u9762\u8fd9\u4e9b\u662f\u6211\u8ba4\u4e3a\u6bd4\u8f83\u91cd\u8981\u7684\u5730\u65b9<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Migration to androidx\/JetPack<\/li><li>Network TLS enabled by default, so need double check https is enable by default.<\/li><li>Non SDK APIs call scanning, and fix all the black APIs usage.<\/li><li>All the &#8220;Java Reflection&#8221; usage in the code should be migration<\/li><li>JNI Native code usage, JNI via env-&gt;GetFieldID(), JNI via env-&gt;GetMethodID()<\/li><li>Apache HTTP client deprecation<\/li><li>FLAG_ACTIVITY_NEW_TASK requirement is now enforced, if the context is not Activity.<\/li><li>Foreground service permission\uff0cApps wanting to use foreground services must now request the FOREGROUND_SERVICE permission first.<\/li><li>3rd party libraries comply with the Non SDK Restrictions, need check\/upgrade one by one.<\/li><\/ul>\n\n\n\n<p>\u5176\u4e2d&#8221;Migration to androidx\/JetPack&#8221;\u5e76\u4e0d\u662f\u5fc5\u987b\u7684\uff0c\u53ea\u662f\u5b98\u65b9\u5176\u5b9e\u4e00\u76f4\u63a8\u8350\u5927\u5bb6\u90fd\u5347\u7ea7\uff0c\u5b98\u65b9\u5ba3\u79f0\u4ee5\u540e\u4e0d\u4f1a\u7ed9android.suppor\u63d0\u4f9b\u6280\u672f\u652f\u6301\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Java_Reflection_%E9%9D%9E%E5%AE%98%E6%96%B9%E6%89%AB%E6%8F%8F%E5%91%BD%E4%BB%A4\"><\/span>Java Reflection \u975e\u5b98\u65b9\u626b\u63cf\u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u975e\u5b98\u65b9API\u8c03\u7528\u4f1a\u662f\u4e00\u4e2a\u6bd4\u8f83\u5927\u7684\u9ebb\u70e6\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u4e0d\u5355\u5355\u9700\u8981\u4fee\u590d\u5e94\u7528\u5185\u7684\u6709\u5173\u8c03\u7528\uff0c\u8fd9\u4e2a\u8fd8\u6d89\u53ca\u5230\u5176\u5b83\u7b2c\u4e09\u65b9library\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u8fd9\u4e2a\u547d\u4ee4\u53ef\u4ee5\u8fc7\u6ee4\u5230\u6240\u6709\u76f8\u5173&#8221;Java Reflection&#8221;\u7684\u8c03\u7528\uff0c\u4e4b\u540e\u5c31\u662fcase by case\u53bb\u4fee\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> grep -n -R -i -E  \"\\.getMethod|\\.getDeclared|\\.getField\\(|\\.getFields\\(|Class.forName\" *\/src<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e9b\u76f8\u5bf9\u6765\u8bf4\u8fd8\u6bd4\u8f83\u76f4\u63a5\uff0c\u4f46\u5982\u679c\u6709\u7528\u5230\u50cfJNI Native so\u7684\u8fd9\u5c31\u9700\u8981\u53bb\u67e5\u8be2\u76f8\u5173C\/C++\u6e90\u7801\uff0c\u770b\u662f\u5426\u6709\u76f8\u5173\u7684\u8c03\u7528\u4e86\u3002\u800c\u5982\u679c\u6ca1\u6709\u6e90\u4ee3\u7801\uff0c\u90a3\u53ef\u80fd\u5c31\u4f1a\u6bd4\u8f83\u9ebb\u70e6\uff0c\u9700\u8981\u53bb\u50cf\u63d0\u4f9b\u6e90\u5934\u786e\u8ba4\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Tools_to_scan_the_blackgrey_list\"><\/span>Tools to scan the black\/grey list<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Google\u8fd8\u63d0\u4f9b\u4e86\u76f8\u5173\u5de5\u5177\u7528\u6765\u9759\u6001\u626b\u63cfAPK\u4e2d\u7684\u975e\u6cd5\u8c03\u7528<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/appcompat.sh --dex-file=app-debug.apk<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/android.googlesource.com\/platform\/prebuilts\/runtime\/+\/master\/appcompat\/\">https:\/\/android.googlesource.com\/platform\/prebuilts\/runtime\/+\/master\/appcompat\/<\/a><br><\/li><\/ul>\n\n\n\n<p>\u53ef\u4ee5\u5728\u4e0a\u9762\u4e0b\u8f7d\u8fd9\u4e2a\u5de5\u5177\uff0c\u9700\u8981\u5728Linux\u4e0b\u8fd0\u884c\uff0c\u4f1a\u4ea7\u751f\u4e0b\u9762\u7684\u8fd9\u4e2a\u5217\u8868\uff0c\u6700\u540e\u7ed9\u51fa\u4e86\u6709\u591a\u5c11\u9ed1\u540d\u5355\uff0c\u591a\u5c11\u7070\u540d\u5355\u3002\u5176\u5b9e\u8fc7\u5b8c\u8fd9\u4e2a\u5217\u8868\u4e4b\u540e\uff0c\u53d1\u73b0\u7136\u5e76\u5375\uff0c\u5e76\u6ca1\u6709\u7ed9\u51fa\u5177\u4f53\u6d89\u53ca\u7684\u5e94\u7528\u5185\u7684\u8c03\u7528\u8def\u5f84\uff0c\u8fd9\u53eb\u4eba\u60c5\u4f55\u4ee5\u582a\uff0c\u8fd8\u6709\u8fd9\u4e2a\u5de5\u5177\u4e5f\u76f4\u63a5\u8868\u660e\u4e86\u5bf9&#8221;Reflection&#8221;\u4f1a\u6709\u9057\u6f0f\uff0c\u800c\u4e14\u5b83\u4e5f\u4e0d\u80fd\u5bf9\u8fd0\u884c\u65f6\u7684API\u4f7f\u7528\uff0c\u7ed9\u51fa\u7ed3\u679c\uff0c\u6240\u4ee5\u770b\u5230\u8fd9\u4e2a\u626b\u63cf\u7ed3\u679c\uff0c\u771f\u7684\u89c9\u5f97\u6709\u70b9\u9e21\u808b\uff0c\u6240\u4ee5\u76ee\u524d\u6211\u8fd8\u662f\u901a\u8fc7\u4e0a\u9762grep\u547d\u4ee4\uff0c\u67e5\u5230\u76f4\u63a5\u7684\u8c03\u7528\u7ed3\u679c\u66f4\u9760\u8c31\u4e00\u4e9b\uff0c\u5f53\u524d\u8fd9\u4e2a\u5217\u8868\u53ea\u662f\u4f5c\u4e3a\u53c2\u8003\u7528\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NOTE: appcompat.sh is still under development. It can report\nAPI uses that do not execute at runtime, and reflection uses\nthat do not exist. It can also miss on reflection uses.\n#1: Linking greylist Lsun\/misc\/Unsafe;->arrayBaseOffset(Ljava\/lang\/Class;)I use(s):\n       Lcom\/google\/common\/primitives\/UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator;->&lt;clinit>()V\n\n#2: Linking greylist Lsun\/misc\/Unsafe;->arrayIndexScale(Ljava\/lang\/Class;)I use(s):\n...\n#8: Reflection blacklist Landroid\/graphics\/drawable\/Drawable;->getOpticalInsets use(s):\n       Landroidx\/appcompat\/widget\/DrawableUtils;->getOpticalBounds(Landroid\/graphics\/drawable\/Drawable;)Landroid\/graphics\/Rect;\n...\n#48: Reflection greylist Llibcore\/icu\/ICU;->addLikelySubtags use(s):\n       Landroidx\/core\/text\/ICUCompat;->&lt;clinit>()V\n\n#49: Reflection greylist Lsun\/misc\/Unsafe;->allocateInstance use(s):\n       Lcom\/google\/android\/gms\/internal\/zzaqa;->bo()Lcom\/google\/android\/gms\/internal\/zzaqa;\n       Lcom\/google\/gson\/internal\/UnsafeAllocator;->create()Lcom\/google\/gson\/internal\/UnsafeAllocator;\n\n#50: Reflection greylist Lsun\/misc\/Unsafe;->theUnsafe use(s):\n       Lcom\/google\/android\/gms\/internal\/zzaqa;->bo()Lcom\/google\/android\/gms\/internal\/zzaqa;\n       Lcom\/google\/common\/primitives\/UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1;->run()Ljava\/lang\/Object;\n       Lcom\/google\/gson\/internal\/UnsafeAllocator;->create()Lcom\/google\/gson\/internal\/UnsafeAllocator;\n\n50 hidden API(s) used: 3 linked against, 47 through reflection\n       48 in greylist\n       2 in blacklist\n       0 in greylist-max-o\n       0 in greylist-max-p\nTo run an analysis that can give more reflection accesses,\nbut could include false positives, pass the --imprecise flag.<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Limitations of the veridex tool include the following:\nIt can't detect invocations through JNI.\nIt can detect only a subset of invocations through reflection.\nIts analysis for inactive code paths is limited to API level checks.<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"androidxJetPack_migration\"><\/span>androidx\/JetPack migration<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>\u81ea\u4ece\u53bb\u5e74Google\u53d1\u5e03\u4e86JetPack\uff0c\u5b98\u65b9\u5c31\u4e00\u76f4\u63a8\u8350\u5927\u5bb6\u5347\u7ea7\u5230androidx, \u4e4b\u524d\u4e00\u76f4\u88ab\u5927\u5bb6\u5410\u69fd\u7684android support v4\/v7\/vXXX\u8fd9\u6b21\u7ec8\u4e8e\u6709\u4e86\u4e00\u4e2a\u6700\u7ec8\u7684\u89e3\u51b3\u65b9\u6848\u3002\u4ee5\u540e\u518d\u4e5f\u4e0d\u7528\u4e3a\u8fd9\u4e9b\u4e2a\u7834\u70c2\u7248\u672c\u53f7\u70e6\u5fc3\u4e86\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\u8fd9\u4e2a\u5347\u7ea7\u5176\u5b9e\u4f1a\u5f71\u54cd\u5230\u6240\u6709\u6709\u5173android support \u548cmaterial design\u76f8\u5173\u7684API\u3002<\/p>\n\n\n\n<p>\u5f53\u7136Google\u5b98\u65b9\u8fd8\u662f\u5f88\u8d34\u5fc3\u7684\uff0c\u63d0\u4f9b\u4e86\u4e00\u952e\u5347\u7ea7\u5230androidx\u7684\u89e3\u51b3\u65b9\u6848<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Refactor-&gt; Migrate to AndroidX<\/p><p><\/p><\/blockquote>\n\n\n\n<p>\u53ea\u662f\u8fd9\u4e2a\u65b9\u6848\u770b\u4f3c\u8d34\u5fc3\uff0c\u4f46\u5176\u5b9e\u4e5f\u662f\u4e00\u5806\u5751\u7b49\u7740\u4f60\u53bb\u586b\uff0c\u56e0\u4e3a\u73b0\u5728\u7684\u9879\u76ee\u7ed3\u6784\u4f1a\u6bd4\u8f83\u590d\u6742\uff0c\u6240\u4ee5\u4e00\u952e\u5347\u7ea7\u5b8c\u4e4b\u540e\uff0c\u9700\u8981\u6709\u4e00\u5806\u7684\u7f16\u8bd1\u9519\u8bef\u7b49\u7740\u4f60\u53bb\u4fee\u3002\u5173\u952e\u662f\u4fee\u5b8c\u8fd9\u4e9b\u7f16\u8bd1\u9519\u8bef\uff0c\u8fd8\u662f\u65e0\u6cd5\u4fdd\u8bc1\u6240\u6709\u7684\u5347\u7ea7\u90fd\u5b8c\u6210\u4e86\u3002<\/p>\n\n\n\n<p>\u4e8b\u5b9e\u53d1\u73b0\u6709\u4e9b\u9519\u8bef\u53ea\u662f\u4f1a\u5728\u8fd0\u884c\u65f6\u51fa\u73b0\uff0c\u6240\u4ee5\u7f16\u8bd1\u6ca1\u6709\u9519\u8bef\uff0c\u4e0d\u4ee3\u8868\u8fd0\u884c\u4e0d\u4f1a\u6709\u9519\u8bef\u3002\u8fd9\u4e2a\u5751\u5c31\u6709\u70b9\u53ef\u6015\u4e86\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\u770b\u6765\u8fd8\u662f\u9700\u8981\u624b\u5de5\u53bb\u505a\u4e00\u4e9b\u9a8c\u8bc1\uff0c\u56e0\u4e3a\u4e3b\u8981\u6539\u52a8\u662fandroid.support -&gt;androidx\u7684\u6539\u52a8 \u8fd8\u6709material design\u76f8\u5173API\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\u7b2c\u4e00\u6b65\uff0c\u751f\u6210\u76f8\u5173\u7684patch\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git diff develop > upgrade_28.patch<\/code><\/pre>\n\n\n\n<p>\u4e4b\u540e\u518d\u901a\u8fc7grep\u547d\u4ee4\u6765\u67e5\u627e\u6240\u6709xml\u76f8\u5173\u7684\u6539\u52a8\uff0c\u56e0\u4e3a\u6bd5\u7adfwidget\/view\u7684\u79cd\u7c7b\u6709\u9650\uff0c\u6240\u4ee5\u53ef\u4ee5\u67e5\u5230\u6240\u4ee5\u7684\u7c7b\u578b\uff0c\u7136\u540e\u624b\u5de5\u518d\u4e00\u4e2a\u4e00\u4e2a\u786e\u8ba4\u4e00\u4e0b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> grep -i -E \"&lt;androidx|com\\.google\"  upgrade28.patch|grep -v -E \"import|api|androidTestImplementation\"|sort|uniq |sed 's\/^+\/\/g'|gsed 's\/ \/\/g'|sort|uniq<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\t&lt;com.google.android.material.textfield.TextInputEditText\n\t\t\t&lt;\/com.google.android.material.textfield.TextInputLayout>\n\t\t\t&lt;com.google.android.material.textfield.TextInputLayout\n\t\t&lt;androidx.recyclerview.widget.RecyclerView\n-dontnotecom.google.android.material.**\n-dontwarncom.google.android.material.**\n-keepclasscom.google.android.material.**{*;}\n&lt;\/com.google.android.material.appbar.AppBarLayout>\n&lt;\/com.google.android.material.appbar.CollapsingToolbarLayout>\n&lt;\/com.google.android.material.textfield.TextInputLayout>\n&lt;androidx.appcompat.widget.AlertDialogLayoutxmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n&lt;androidx.appcompat.widget.AppCompatButton\n&lt;androidx.appcompat.widget.AppCompatCheckBox\n&lt;androidx.appcompat.widget.AppCompatEditText\n&lt;androidx.appcompat.widget.AppCompatImageView\n&lt;androidx.appcompat.widget.AppCompatSpinner\n&lt;androidx.appcompat.widget.ButtonBarLayout\n&lt;androidx.appcompat.widget.DialogTitle\n&lt;androidx.appcompat.widget.Toolbar\n&lt;androidx.cardview.widget.CardView\n&lt;androidx.cardview.widget.CardViewxmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n&lt;androidx.constraintlayout.Barrier\n&lt;androidx.constraintlayout.ConstraintLayout\n&lt;androidx.constraintlayout.Guideline\n&lt;androidx.constraintlayout.widget.ConstraintLayout\n&lt;androidx.constraintlayout.widget.ConstraintLayoutxmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n&lt;androidx.constraintlayout.widget.Group\n&lt;androidx.coordinatorlayout.widget.CoordinatorLayout\n&lt;androidx.coordinatorlayout.widget.CoordinatorLayoutxmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n&lt;androidx.core.widget.NestedScrollView\n&lt;androidx.core.widget.NestedScrollViewxmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n&lt;androidx.core.widget.Space\n&lt;androidx.drawerlayout.widget.DrawerLayoutxmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n&lt;androidx.legacy.widget.Space\n&lt;androidx.preference.Preference\n&lt;androidx.preference.PreferenceScreenxmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\">\n&lt;androidx.preference.SwitchPreferenceCompat\n&lt;androidx.recyclerview.widget.RecyclerView\n&lt;androidx.recyclerview.widget.RecyclerViewxmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n&lt;androidx.recyclerview.widget.SwitchCompat\n&lt;androidx.swiperefreshlayout.widget.SwipeRefreshLayout\n&lt;androidx.viewpager.widget.PagerTabStrip\n&lt;androidx.viewpager.widget.ViewPager\n&lt;com.google.android.material.appbar.AppBarLayout\n&lt;com.google.android.material.appbar.AppBarLayoutxmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n&lt;com.google.android.material.appbar.CollapsingToolbarLayout\n&lt;com.google.android.material.floatingactionbutton.FloatingActionButton\n&lt;com.google.android.material.tabs.TabLayout\n&lt;com.google.android.material.tabs.TabLayoutxmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n&lt;com.google.android.material.textfield.TextInputEditText\n&lt;com.google.android.material.textfield.TextInputLayout<\/code><\/pre>\n\n\n\n<p>\u786e\u8ba4\u597d\u4e0a\u9762\u8fd9\u4e9b\u90fd\u6ca1\u95ee\u9898\u4e4b\u540e\uff0c\u8fd8\u6709\u4e00\u4e2a\u6f0f\u6d1e\u9700\u8981\u8865\u4e0a\uff0c\u9700\u8981\u786e\u8ba4\u6240\u6709\u7684android.support\u4e0d\u518d\u6709\u4efb\u4f55\u5f15\u7528\uff0c\u4f7f\u7528\u4e0b\u9762\u8fd9\u4e2a\u547d\u4ee4\u5c31\u53ef\u4ee5\u67e5\u5230\u6f0f\u7f51\u4e4b\u9c7c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep -R \"android\\.support\" *\/src<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%85%B3%E4%BA%8E%E7%AC%AC%E4%B8%89%E6%96%B9library\"><\/span>\u5173\u4e8e\u7b2c\u4e09\u65b9library<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>\u76ee\u524d\u5e76\u6ca1\u6709\u4ec0\u4e48\u597d\u7684\u529e\u6cd5\uff0c\u53ea\u80fd\u4e00\u4e2a\u4e00\u4e2a\u53bb\u67e5\u8bc1\uff0c\u770b\u662f\u5426\u517c\u5bb9API 28\u7684\u8981\u6c42\u3002\u5f53\u7136\u8fd9\u4e2a\u9700\u8981\u53bb\u518d\u505a\u66f4\u591a\u7684\u8c03\u67e5\uff0c\u770b\u662f\u5426\u6709\u4ec0\u4e48\u66f4\u597d\u7684\u89e3\u51b3\u65b9\u6848\u3002\u5047\u8bbe\u771f\u7684\u9700\u8981\u4e00\u4e2a\u4e00\u4e2a\u53bb\u9a8c\u8bc1\uff0c\u90a3\u5c31\u771f\u7684\u662f\u6bd4\u8f83\u9ebb\u70e6\u4e86\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%85%B3%E4%BA%8E%E6%8E%A8%E8%BF%9Ftarget_API_28%E7%9A%84%E6%83%B3%E6%B3%95\"><\/span>\u5173\u4e8e\u63a8\u8fdftarget API 28\u7684\u60f3\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>\u56e0\u4e3a\u76ee\u524dGoogle\u7ed9\u7684\u65e5\u671f\u662f\u8981\u523011\u67081\u53f7\uff0c\u6240\u4ee5\u8fd8\u67098\u4e2a\u6708\u5de6\u53f3\u7684\u65f6\u95f4\u53bb\u505a\u5347\u7ea7\u3002\u6240\u4ee5\u5176\u5b9e\u4e5f\u4e0d\u7528\u8fd9\u4e48\u7740\u6025\uff0c\u4f46\u8ba1\u5212\u4e00\u5b9a\u8981\u5148\u505a\u8d77\u6765\u3002\u5f53\u524d\u6211\u4eec\u9879\u76ee\u4e2d\u9700\u8981\u5347\u7ea7\u5230androidx\u53bb\u652f\u6301\u6700\u65b0\u7684Espreso Automation\uff0c\u6240\u4ee5compile SDK version\u4e00\u5b9a\u8981\u5148\u5347\u7ea7\u523028\uff0c\u4f46\u81f3\u4e8etarget SDK\uff0c\u5c31\u4e0d\u662f\u5fc5\u987b\u7684\u3002\u53ef\u4ee5\u6682\u65f6\u5148\u505c\u7559\u572827\u3002\u5f53\u7136\u8fd9\u4e2a\u9700\u8981\u8fdb\u4e00\u6b65\u9a8c\u8bc1\uff0c\u5982\u679c\u8fd9\u6837\u53ef\u884c\u7684\u8bdd\uff0c\u8fd9\u4e0d\u5931\u4e3a\u4e00\u4e2a\u6298\u4e2d\u65b9\u6848\uff0c\u56e0\u4e3a\u8981\u5b8c\u5168\u786e\u5b9a\u6240\u6709Non SDK usage\u9700\u8981\u6bd4\u8f83\u6f2b\u957f\u7684\u65f6\u95f4\uff0c\u800c\u4e14\u4e5f\u53ef\u80fd\u5728\u4e2a\u8fc7\u7a0b\u4e2d\u9700\u8981\u6d89\u53ca\u73b0\u5728\u7b2c\u4e09\u65b9library\u7684\u5347\u7ea7\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Reference\"><\/span>Reference<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>\u53c2\u8003\u4e86\u597d\u591a\u7bc7\u5b98\u65b9\u7684\u6587\u6863\uff0c\u6240\u4ee5\u5efa\u8bae\u5927\u5bb6\u90fd\u53bb\u770b\u770b\u5b98\u65b9\u5347\u7ea7\u6587\u6863\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/developer.android.com\/about\/versions\/pie\/restrictions-non-sdk-interfaces\">https:\/\/developer.android.com\/about\/versions\/pie\/restrictions-non-sdk-interfaces<\/a><\/li><li><a href=\"https:\/\/developer.android.com\/distribute\/best-practices\/develop\/target-sdk\">https:\/\/developer.android.com\/distribute\/best-practices\/develop\/target-sdk<\/a><\/li><li><a href=\"https:\/\/support.google.com\/googleplay\/android-developer\/answer\/113469#targetsdk\">https:\/\/support.google.com\/googleplay\/android-developer\/answer\/113469#targetsdk<\/a><\/li><li><a href=\"https:\/\/developer.android.com\/about\/versions\/pie\/android-9.0-changes-28\">https:\/\/developer.android.com\/about\/versions\/pie\/android-9.0-changes-28<\/a><\/li><li><a href=\"https:\/\/developer.android.com\/about\/versions\/pie\/android-9.0-migration\">https:\/\/developer.android.com\/about\/versions\/pie\/android-9.0-migration<\/a><\/li><li><a href=\"https:\/\/developer.android.com\/guide\/topics\/manifest\/uses-sdk-element.html?utm_campaign=adp_series_sdkversion_010616&amp;utm_source=medium&amp;utm_medium=blog#ApiLevels\">https:\/\/developer.android.com\/guide\/topics\/manifest\/uses-sdk-element.html?utm_campaign=adp_series_sdkversion_010616&amp;utm_source=medium&amp;utm_medium=blog#ApiLevels<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u81ea\u4ece\u53bb\u5e74Google\u5f3a\u5236\u5347\u7ea7target API\u523026\u4e4b\u540e\uff0cGoogle\u5c31\u5f00\u59cb\u8ba1\u5212\u7740\u4e0b\u4e00\u6ce2\u7684\u5347\u7ea7\uff0c\u800c\u8fd9\u6b21\u662f\u8981\u5347\u7ea7\u52309, \u4e5f\u5c31\u662ftarget API level 28\uff0c\u800c\u4e14\u65e5\u671f\u4e5f\u5df2\u7ecf\u5b9a\u4e86 &#8220;November 1, 2019&#8243;\u3002 \u4ee5\u524d\u6bcf\u6b21API\u5347\u7ea7\u90fd\u662f\u5c0f\u6253\u5c0f\u95f9\uff0c\u5e76\u4e0d\u4f1a\u6709\u90a3\u79cd\u5927\u89c4\u6a21\u7684\u6539\u52a8\uff0c\u800c\u8fd9\u6b21\u6539\u52a8\u5c31\u6709\u70b9\u5927\u4e86\u3002\u5f53\u7136\u8fd9\u6b21\u5f3a\u5236target API\u5347\u7ea7\u5bf9\u56fd\u5185\u5f00\u53d1\u8005\u7684\u5f71\u54cd\u4f1a\u5c0f\u4e00\u4e9b\uff0c\u56e0\u4e3a\u6bd5\u7adf\u4e0d\u7528\u53d1\u5e03\u5230Google Play\uff0c\u800c\u56fd\u5185\u5e94\u7528\u5e02\u573a\u8fd9\u4e48\u591a\uff0c\u5404\u4e2a\u8981\u6c42\u4e5f\u90fd\u53c2\u5dee\u4e0d\u9f50\uff0c\u6240\u4ee5\u77ed\u671f\u8fd8\u662f\u5b89\u5168\u7684\u3002 \u8fd9\u6b21\u6539\u52a8\u5176\u5b9e\u52a8\u7684\u6700\u5927\u7684\u5c31\u662f\u975e\u5b98\u65b9API\u7684\u8c03\u7528\uff0c\u4e5f\u5305\u542b&#8221;Java Reflection&#8221;\uff0c\u57fa\u672c\u4e0a\u53ef\u4ee5\u8bf4\u56fd\u5185\u8981\u7528\u5230\u7684\u90a3\u4e9b\u52a8\u6001APP\u5347\u7ea7\u65b9\u6848\u90fd\u57fa\u672c\u88ab\u4f24\u4e86\uff0c\u7f51\u4e0a\u641c\u4e86\u4e00\u4e0b\uff0c\u4e5f\u627e\u5230\u4e00\u4e9b\u5385\u6deb\u6280\u5de7\uff0c\u53ef\u4ee5\u7ed5\u8fc7\u53bb\u5b98\u65b9\u7684\u8fd9\u4e2a\u9650\u5236\uff0c\u6b63\u6240\u8c13\u9053\u9ad8\u4e00\u5c3a\uff0c\u9b54\u9ad8\u4e00\u4e08\uff0c\u4f46\u603b\u7684\u6765\u8bf4\u8fd9\u6837\u505a\u662f\u4e0d\u63a8\u8350\u7684\uff0c\u56e0\u4e3a\u4e0d\u77e5\u9053\u7cfb\u7edf\u53c8\u505a\u4e2a\u5347\u7ea7\uff0c\u5c31\u628a\u8fd9\u4e9b\u65b9\u6848\u7ed9\u5e72\u6389\u3002\u5b98\u6587\u7ed9\u4e86\u9ed1\u540d\u5355\u5217\u8868\u548c\u7070\u540d\u5355\u5217\u8868\uff0c\u9ed1\u540d\u5355\u662f\u4e00\u5b9a\u8981\u4fee\u590d\u7684\uff0c\u7070\u540d\u5355\u53ea\u662f\u4e00\u4e2a\u8fc7\u6e21\u9636\u6bb5\uff0c\u540e\u9762\u770bGoogle\u7684\u5fc3\u60c5\u4ec0\u4e48\u65f6\u5019\u5728\u7cfb\u7edf\u5c42\u9762\u5f3a\u5236\u6267\u884c\uff0c\u90a3\u5c31\u5fc5\u987b\u90fd\u4fee\u590d\u30022019\u5e74\u7684Google IO\u5927\u4f1a\u5728\u5373\uff0c\u5c31\u770b\u8fd9\u6b21Google\u6709\u4ec0\u4e48\u8868\u793a\u3002 \u5177\u4f53\u6211\u4eec\u9700\u8981\u505a\u4ec0\u4e48\/take away \u628a\u5b98\u65b9\u76f8\u5173\u7684\u6587\u6863\u90fd\u770b\u8fc7\u4e86\uff0c\u4e0b\u9762\u8fd9\u4e9b\u662f\u6211\u8ba4\u4e3a\u6bd4\u8f83\u91cd\u8981\u7684\u5730\u65b9 Migration to androidx\/JetPack Network TLS enabled by default, so need double check https is enable by default. Non SDK APIs call scanning,<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,169],"tags":[50,180,179,177,72,176,178],"class_list":["post-1488","post","type-post","status-publish","format-standard","hentry","category-android","category-tech","tag-android","tag-android-support","tag-androidx","tag-api","tag-google","tag-google-play","tag-jetpack"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android P(9.0\/API Level 28) \u5347\u7ea7\u4e0d\u5b8c\u5168\u6559\u7a0b - 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=1488\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android P(9.0\/API Level 28) \u5347\u7ea7\u4e0d\u5b8c\u5168\u6559\u7a0b - Jianqing&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"\u81ea\u4ece\u53bb\u5e74Google\u5f3a\u5236\u5347\u7ea7target API\u523026\u4e4b\u540e\uff0cGoogle\u5c31\u5f00\u59cb\u8ba1\u5212\u7740\u4e0b\u4e00\u6ce2\u7684\u5347\u7ea7\uff0c\u800c\u8fd9\u6b21\u662f\u8981\u5347\u7ea7\u52309, \u4e5f\u5c31\u662ftarget API level 28\uff0c\u800c\u4e14\u65e5\u671f\u4e5f\u5df2\u7ecf\u5b9a\u4e86 &#8220;November 1, 2019&#8243;\u3002 \u4ee5\u524d\u6bcf\u6b21API\u5347\u7ea7\u90fd\u662f\u5c0f\u6253\u5c0f\u95f9\uff0c\u5e76\u4e0d\u4f1a\u6709\u90a3\u79cd\u5927\u89c4\u6a21\u7684\u6539\u52a8\uff0c\u800c\u8fd9\u6b21\u6539\u52a8\u5c31\u6709\u70b9\u5927\u4e86\u3002\u5f53\u7136\u8fd9\u6b21\u5f3a\u5236target API\u5347\u7ea7\u5bf9\u56fd\u5185\u5f00\u53d1\u8005\u7684\u5f71\u54cd\u4f1a\u5c0f\u4e00\u4e9b\uff0c\u56e0\u4e3a\u6bd5\u7adf\u4e0d\u7528\u53d1\u5e03\u5230Google Play\uff0c\u800c\u56fd\u5185\u5e94\u7528\u5e02\u573a\u8fd9\u4e48\u591a\uff0c\u5404\u4e2a\u8981\u6c42\u4e5f\u90fd\u53c2\u5dee\u4e0d\u9f50\uff0c\u6240\u4ee5\u77ed\u671f\u8fd8\u662f\u5b89\u5168\u7684\u3002 \u8fd9\u6b21\u6539\u52a8\u5176\u5b9e\u52a8\u7684\u6700\u5927\u7684\u5c31\u662f\u975e\u5b98\u65b9API\u7684\u8c03\u7528\uff0c\u4e5f\u5305\u542b&#8221;Java Reflection&#8221;\uff0c\u57fa\u672c\u4e0a\u53ef\u4ee5\u8bf4\u56fd\u5185\u8981\u7528\u5230\u7684\u90a3\u4e9b\u52a8\u6001APP\u5347\u7ea7\u65b9\u6848\u90fd\u57fa\u672c\u88ab\u4f24\u4e86\uff0c\u7f51\u4e0a\u641c\u4e86\u4e00\u4e0b\uff0c\u4e5f\u627e\u5230\u4e00\u4e9b\u5385\u6deb\u6280\u5de7\uff0c\u53ef\u4ee5\u7ed5\u8fc7\u53bb\u5b98\u65b9\u7684\u8fd9\u4e2a\u9650\u5236\uff0c\u6b63\u6240\u8c13\u9053\u9ad8\u4e00\u5c3a\uff0c\u9b54\u9ad8\u4e00\u4e08\uff0c\u4f46\u603b\u7684\u6765\u8bf4\u8fd9\u6837\u505a\u662f\u4e0d\u63a8\u8350\u7684\uff0c\u56e0\u4e3a\u4e0d\u77e5\u9053\u7cfb\u7edf\u53c8\u505a\u4e2a\u5347\u7ea7\uff0c\u5c31\u628a\u8fd9\u4e9b\u65b9\u6848\u7ed9\u5e72\u6389\u3002\u5b98\u6587\u7ed9\u4e86\u9ed1\u540d\u5355\u5217\u8868\u548c\u7070\u540d\u5355\u5217\u8868\uff0c\u9ed1\u540d\u5355\u662f\u4e00\u5b9a\u8981\u4fee\u590d\u7684\uff0c\u7070\u540d\u5355\u53ea\u662f\u4e00\u4e2a\u8fc7\u6e21\u9636\u6bb5\uff0c\u540e\u9762\u770bGoogle\u7684\u5fc3\u60c5\u4ec0\u4e48\u65f6\u5019\u5728\u7cfb\u7edf\u5c42\u9762\u5f3a\u5236\u6267\u884c\uff0c\u90a3\u5c31\u5fc5\u987b\u90fd\u4fee\u590d\u30022019\u5e74\u7684Google IO\u5927\u4f1a\u5728\u5373\uff0c\u5c31\u770b\u8fd9\u6b21Google\u6709\u4ec0\u4e48\u8868\u793a\u3002 \u5177\u4f53\u6211\u4eec\u9700\u8981\u505a\u4ec0\u4e48\/take away \u628a\u5b98\u65b9\u76f8\u5173\u7684\u6587\u6863\u90fd\u770b\u8fc7\u4e86\uff0c\u4e0b\u9762\u8fd9\u4e9b\u662f\u6211\u8ba4\u4e3a\u6bd4\u8f83\u91cd\u8981\u7684\u5730\u65b9 Migration to androidx\/JetPack Network TLS enabled by default, so need double check https is enable by default. Non SDK APIs call scanning,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pjq.me\/?p=1488\" \/>\n<meta property=\"og:site_name\" content=\"Jianqing&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-12T15:28:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-02T03:15:41+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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/pjq.me\/?p=1488#article\",\"isPartOf\":{\"@id\":\"https:\/\/pjq.me\/?p=1488\"},\"author\":{\"name\":\"pengjianqing\",\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"headline\":\"Android P(9.0\/API Level 28) \u5347\u7ea7\u4e0d\u5b8c\u5168\u6559\u7a0b\",\"datePublished\":\"2019-03-12T15:28:59+00:00\",\"dateModified\":\"2019-04-02T03:15:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/pjq.me\/?p=1488\"},\"wordCount\":295,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"keywords\":[\"Android\",\"Android Support\",\"AndroidX\",\"API\",\"Google\",\"Google Play\",\"JetPack\"],\"articleSection\":[\"Android\",\"Tech\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/pjq.me\/?p=1488#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/pjq.me\/?p=1488\",\"url\":\"https:\/\/pjq.me\/?p=1488\",\"name\":\"Android P(9.0\/API Level 28) \u5347\u7ea7\u4e0d\u5b8c\u5168\u6559\u7a0b - Jianqing&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/pjq.me\/#website\"},\"datePublished\":\"2019-03-12T15:28:59+00:00\",\"dateModified\":\"2019-04-02T03:15:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/pjq.me\/?p=1488#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/pjq.me\/?p=1488\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/pjq.me\/?p=1488#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/pjq.me\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android P(9.0\/API Level 28) \u5347\u7ea7\u4e0d\u5b8c\u5168\u6559\u7a0b\"}]},{\"@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 P(9.0\/API Level 28) \u5347\u7ea7\u4e0d\u5b8c\u5168\u6559\u7a0b - 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=1488","og_locale":"en_US","og_type":"article","og_title":"Android P(9.0\/API Level 28) \u5347\u7ea7\u4e0d\u5b8c\u5168\u6559\u7a0b - Jianqing&#039;s Blog","og_description":"\u81ea\u4ece\u53bb\u5e74Google\u5f3a\u5236\u5347\u7ea7target API\u523026\u4e4b\u540e\uff0cGoogle\u5c31\u5f00\u59cb\u8ba1\u5212\u7740\u4e0b\u4e00\u6ce2\u7684\u5347\u7ea7\uff0c\u800c\u8fd9\u6b21\u662f\u8981\u5347\u7ea7\u52309, \u4e5f\u5c31\u662ftarget API level 28\uff0c\u800c\u4e14\u65e5\u671f\u4e5f\u5df2\u7ecf\u5b9a\u4e86 &#8220;November 1, 2019&#8243;\u3002 \u4ee5\u524d\u6bcf\u6b21API\u5347\u7ea7\u90fd\u662f\u5c0f\u6253\u5c0f\u95f9\uff0c\u5e76\u4e0d\u4f1a\u6709\u90a3\u79cd\u5927\u89c4\u6a21\u7684\u6539\u52a8\uff0c\u800c\u8fd9\u6b21\u6539\u52a8\u5c31\u6709\u70b9\u5927\u4e86\u3002\u5f53\u7136\u8fd9\u6b21\u5f3a\u5236target API\u5347\u7ea7\u5bf9\u56fd\u5185\u5f00\u53d1\u8005\u7684\u5f71\u54cd\u4f1a\u5c0f\u4e00\u4e9b\uff0c\u56e0\u4e3a\u6bd5\u7adf\u4e0d\u7528\u53d1\u5e03\u5230Google Play\uff0c\u800c\u56fd\u5185\u5e94\u7528\u5e02\u573a\u8fd9\u4e48\u591a\uff0c\u5404\u4e2a\u8981\u6c42\u4e5f\u90fd\u53c2\u5dee\u4e0d\u9f50\uff0c\u6240\u4ee5\u77ed\u671f\u8fd8\u662f\u5b89\u5168\u7684\u3002 \u8fd9\u6b21\u6539\u52a8\u5176\u5b9e\u52a8\u7684\u6700\u5927\u7684\u5c31\u662f\u975e\u5b98\u65b9API\u7684\u8c03\u7528\uff0c\u4e5f\u5305\u542b&#8221;Java Reflection&#8221;\uff0c\u57fa\u672c\u4e0a\u53ef\u4ee5\u8bf4\u56fd\u5185\u8981\u7528\u5230\u7684\u90a3\u4e9b\u52a8\u6001APP\u5347\u7ea7\u65b9\u6848\u90fd\u57fa\u672c\u88ab\u4f24\u4e86\uff0c\u7f51\u4e0a\u641c\u4e86\u4e00\u4e0b\uff0c\u4e5f\u627e\u5230\u4e00\u4e9b\u5385\u6deb\u6280\u5de7\uff0c\u53ef\u4ee5\u7ed5\u8fc7\u53bb\u5b98\u65b9\u7684\u8fd9\u4e2a\u9650\u5236\uff0c\u6b63\u6240\u8c13\u9053\u9ad8\u4e00\u5c3a\uff0c\u9b54\u9ad8\u4e00\u4e08\uff0c\u4f46\u603b\u7684\u6765\u8bf4\u8fd9\u6837\u505a\u662f\u4e0d\u63a8\u8350\u7684\uff0c\u56e0\u4e3a\u4e0d\u77e5\u9053\u7cfb\u7edf\u53c8\u505a\u4e2a\u5347\u7ea7\uff0c\u5c31\u628a\u8fd9\u4e9b\u65b9\u6848\u7ed9\u5e72\u6389\u3002\u5b98\u6587\u7ed9\u4e86\u9ed1\u540d\u5355\u5217\u8868\u548c\u7070\u540d\u5355\u5217\u8868\uff0c\u9ed1\u540d\u5355\u662f\u4e00\u5b9a\u8981\u4fee\u590d\u7684\uff0c\u7070\u540d\u5355\u53ea\u662f\u4e00\u4e2a\u8fc7\u6e21\u9636\u6bb5\uff0c\u540e\u9762\u770bGoogle\u7684\u5fc3\u60c5\u4ec0\u4e48\u65f6\u5019\u5728\u7cfb\u7edf\u5c42\u9762\u5f3a\u5236\u6267\u884c\uff0c\u90a3\u5c31\u5fc5\u987b\u90fd\u4fee\u590d\u30022019\u5e74\u7684Google IO\u5927\u4f1a\u5728\u5373\uff0c\u5c31\u770b\u8fd9\u6b21Google\u6709\u4ec0\u4e48\u8868\u793a\u3002 \u5177\u4f53\u6211\u4eec\u9700\u8981\u505a\u4ec0\u4e48\/take away \u628a\u5b98\u65b9\u76f8\u5173\u7684\u6587\u6863\u90fd\u770b\u8fc7\u4e86\uff0c\u4e0b\u9762\u8fd9\u4e9b\u662f\u6211\u8ba4\u4e3a\u6bd4\u8f83\u91cd\u8981\u7684\u5730\u65b9 Migration to androidx\/JetPack Network TLS enabled by default, so need double check https is enable by default. Non SDK APIs call scanning,","og_url":"https:\/\/pjq.me\/?p=1488","og_site_name":"Jianqing&#039;s Blog","article_published_time":"2019-03-12T15:28:59+00:00","article_modified_time":"2019-04-02T03:15:41+00:00","author":"pengjianqing","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pengjianqing","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pjq.me\/?p=1488#article","isPartOf":{"@id":"https:\/\/pjq.me\/?p=1488"},"author":{"name":"pengjianqing","@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"headline":"Android P(9.0\/API Level 28) \u5347\u7ea7\u4e0d\u5b8c\u5168\u6559\u7a0b","datePublished":"2019-03-12T15:28:59+00:00","dateModified":"2019-04-02T03:15:41+00:00","mainEntityOfPage":{"@id":"https:\/\/pjq.me\/?p=1488"},"wordCount":295,"commentCount":0,"publisher":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"keywords":["Android","Android Support","AndroidX","API","Google","Google Play","JetPack"],"articleSection":["Android","Tech"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pjq.me\/?p=1488#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pjq.me\/?p=1488","url":"https:\/\/pjq.me\/?p=1488","name":"Android P(9.0\/API Level 28) \u5347\u7ea7\u4e0d\u5b8c\u5168\u6559\u7a0b - Jianqing&#039;s Blog","isPartOf":{"@id":"https:\/\/pjq.me\/#website"},"datePublished":"2019-03-12T15:28:59+00:00","dateModified":"2019-04-02T03:15:41+00:00","breadcrumb":{"@id":"https:\/\/pjq.me\/?p=1488#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pjq.me\/?p=1488"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/pjq.me\/?p=1488#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pjq.me\/"},{"@type":"ListItem","position":2,"name":"Android P(9.0\/API Level 28) \u5347\u7ea7\u4e0d\u5b8c\u5168\u6559\u7a0b"}]},{"@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":2793,"_links":{"self":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/1488","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=1488"}],"version-history":[{"count":5,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/1488\/revisions"}],"predecessor-version":[{"id":1493,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/1488\/revisions\/1493"}],"wp:attachment":[{"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}