{"id":262,"date":"2017-04-17T18:31:51","date_gmt":"2017-04-17T18:31:51","guid":{"rendered":"https:\/\/boochlin.com\/?p=262"},"modified":"2017-04-17T18:31:51","modified_gmt":"2017-04-17T18:31:51","slug":"android-appintro-proguard-issue","status":"publish","type":"post","link":"https:\/\/boochlin.com\/?p=262","title":{"rendered":"Android AppIntro Proguard issue."},"content":{"rendered":"<p><a href=\"https:\/\/boochlin.com\/wp-content\/uploads\/2017\/02\/Screenshot_20170308-012917.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-282\" src=\"https:\/\/boochlin.com\/wp-content\/uploads\/2017\/02\/Screenshot_20170308-012917.png\" alt=\"Screenshot_20170308-012917\" width=\"283\" height=\"503\" \/><\/a><\/p>\n<p><a href=\"https:\/\/github.com\/apl-devs\/AppIntro\">https:\/\/github.com\/apl-devs\/AppIntro<\/a><\/p>\n<p>\u7b97\u662f\u4f7f\u7528\u7db2\u8def\u73fe\u6210\u7684 introduction lib \u6240\u767c\u751f\u7684\u554f\u984c\u3002\u5728\u6b64\u7c21\u55ae\u7b46\u8a18\u4e00\u4e0b\u3002\u6b64 lib \u4e3b\u8981\u529f\u80fd\u5c31\u662f\u53ef\u4ee5\u5feb\u901f\u505a\u51fa\u5f80\u53f3\u7ffb\u9801\u7684 activity \uff0c\u5167\u5bb9\u914d\u7f6e\u901a\u5e38\u5c31\u662f\u4e00\u5716\u4e00\u6587\u5b57\uff0c\u5982\u4e0a\u5716\u8868\u793a\uff0c\u4f46\u662f\u9019\u6b21\u554f\u984c\u4e26\u975e\u529f\u80fd\u4e0a\uff0c\u800c\u662f \u300e<span class=\"js-issue-title\" style=\"color: #ff0000;\">Proguard-project.txt included in lib is hinders obfuscation of final apk<\/span>\u300f<\/p>\n<p><!--more--><\/p>\n<p>\u901a\u5e38\u6211\u5011 build release app \u6642\uff0c\u6703\u555f\u7528 Proguard \u4f86\u6df7\u6dc6\u7a0b\u5f0f\u78bc\uff0c\u4ee5\u53ca\u964d\u4f4e apk size\uff0c\u4f46\u662f\u9019\u6b21 import app intro lib 4.2 \u6642\uff0c\u537b\u767c\u73fe\u6574\u500b app \u6c92\u6709\u88ab\u6df7\u6dc6\u3002<\/p>\n<pre>compile 'com.github.paolorotolo:appintro:4.1.0'\r\n<\/pre>\n<p><a href=\"https:\/\/boochlin.com\/wp-content\/uploads\/2017\/04\/\u87a2\u5e55\u5feb\u7167-2017-04-18-\u4e0a\u53481.31.19.png\"><img decoding=\"async\" class=\"alignnone wp-image-283\" src=\"https:\/\/boochlin.com\/wp-content\/uploads\/2017\/04\/\u87a2\u5e55\u5feb\u7167-2017-04-18-\u4e0a\u53481.31.19.png\" alt=\"\u87a2\u5e55\u5feb\u7167 2017-04-18 \u4e0a\u53481.31.19\" width=\"238\" height=\"501\" \/><\/a><\/p>\n<p>\u7528 <a href=\"https:\/\/github.com\/mihaip\/dex-method-counts\">dex-method-counts<\/a> \u8dd1\u51fa\u4f86\u662f\u9019\u6a23\u5b50\uff0c\u7b2c\u4e00\u500b\u662f function name \u6c92\u6709\u88ab\u6df7\u6dc6\uff0c\u53ef\u4ee5\u770b\u51fa\u539f\u672c\u7684 function method name\uff0c\u7b2c\u4e8c\u662f function \u6578\u91cf\u4e5f\u592a\u591a\u4e86\uff0c\u5b8c\u5168\u8981\u7a81\u7834 65k method limit\uff0c\u9019\u6a23\u5b8c\u5168\u6c92\u6709 Proguard \u7684\u6548\u679c\u3002\u800c\u6b63\u5e38\u60c5\u6cc1\u61c9\u8a72\u662f<\/p>\n<p><a href=\"https:\/\/boochlin.com\/wp-content\/uploads\/2017\/04\/\u87a2\u5e55\u5feb\u7167-2017-04-18-\u4e0a\u53481.38.03.png\"><img decoding=\"async\" class=\"alignnone wp-image-284\" src=\"https:\/\/boochlin.com\/wp-content\/uploads\/2017\/04\/\u87a2\u5e55\u5feb\u7167-2017-04-18-\u4e0a\u53481.38.03.png\" alt=\"\u87a2\u5e55\u5feb\u7167 2017-04-18 \u4e0a\u53481.38.03\" width=\"239\" height=\"695\" \/><\/a><\/p>\n<p>function name \u6703\u7528 a,b,c,d \u9019\u7a2e\u4e0d\u77e5\u6240\u4e91\u7684 method name \u53d6\u4ee3\uff0cfunction \u6578\u91cf\u4e5f\u6703\u964d\u4e0b\u4f86\u3002<\/p>\n<p>\u8001\u5be6\u8aaa\u5728\u627e\u9019\u500b\u554f\u984c\u6642\u975e\u5e38\u56f0\u64fe\uff0c\u56e0\u70ba\u5b8c\u5168\u4e0d\u77e5\u9053\u90a3\u88e1\u51fa\u932f\uff0c\u760b\u72c2\u7684\u67e5\u627e build.gradle \u7684 build flag \uff0c\u6700\u5f8c\u662f\u9760\u8005 git \u7684\u4e0d\u6bb5\u7248\u672c\u56de\u6714\u624d\u63a8\u4f30\u51fa\u9019\u554f\u984c\uff0c\u63a5\u8005\u56de\u53bb\u627e\u4f5c\u8005\u7684 github \u624d\u767c\u73fe\u4e5f\u6709\u4eba\u63d0\u51fa\u9019\u554f\u984c\uff0c\u4e5f\u5df2\u7d93\u63d0\u51fa<a href=\"https:\/\/github.com\/apl-devs\/AppIntro\/commit\/bf1fb7d4e83d6743e4e74e9c9b30a78de248aa60\">PR<\/a>\u89e3\u6c7a\u6b64\u554f\u984c\u3002\u4f46\u662f\u4f5c\u8005\u4e26\u9084\u6c92\u6709\u6839\u64da\u6b64PR\u91cb\u51fa\u65b0\u7248\u672c\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/apl-devs\/AppIntro\/issues\/336\">https:\/\/github.com\/apl-devs\/AppIntro\/issues\/336<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/apl-devs\/AppIntro\/issues\/337\">https:\/\/github.com\/apl-devs\/AppIntro\/issues\/337<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/apl-devs\/AppIntro\/commit\/bf1fb7d4e83d6743e4e74e9c9b30a78de248aa60\">https:\/\/github.com\/apl-devs\/AppIntro\/commit\/bf1fb7d4e83d6743e4e74e9c9b30a78de248aa60<\/a><\/p>\n<p>\u770b\u8d77\u4f86\u662f\u00a0proguard-project.txt \u7684\u8a2d\u5b9a\u503c\u554f\u984c\uff0c\u4ed6\u4e0d\u5c0f\u5fc3\u628a\u4f7f\u7528\u8005project \u7684\u6240\u6709 method \u90fd\u5305\u9032 proguard \u7684\u4fdd\u8b77\u898f\u5247\u4e2d\uff0c\u9020\u6210\u6df7\u6dc6\u5931\u6557\u3002\u9019\u88e1\u57fa\u672c\u4e0a\u5efa\u8b70\u6240\u6709 lib \u7684\u958b\u767c\u8005\u6700\u597d\u4f7f\u7528 \u300econsumerProguardFiles\u300f\u4f86\u8a2d\u5b9a lib \u7684\u6df7\u6dc6\u898f\u5247\uff0c\u5c07\u5f71\u97ff\u7bc4\u570d\u90fd\u9650\u5236\u5728 lib\u3002<\/p>\n<p>\u597d\u5566\uff0c\u6700\u5f8c\u6211\u662f\u9760\u8005\u9000\u56de\u524d\u4e00\u7248\u7684 AppIntro 4.0.0 \u5148\u907f\u958b\u9019\u554f\u984c\uff0c\u7136\u5f8c\u6aa2\u67e5\u4f7f\u7528\u4e0a\u8ddf\u6700\u65b0\u7248\u7684\u5dee\u7570\u662f\u5426\u6709\u5f71\u97ff\u3002<\/p>\n<pre>compile 'com.github.paolorotolo:appintro:4.0.0'\r\n<\/pre>\n<p>\u5982\u679c\u6709\u4e2d\u6587\u5708\u7684\u958b\u767c\u8005\u9047\u5230\u9019\u554f\u984c\uff0c\u5e0c\u671b\u6709\u5e6b\u52a9\u5230\u4f60\u3002\u81f3\u65bc\u6b63\u5f0f\u89e3\u53ea\u80fd\u671f\u5f85\u4f5c\u8005\u767c\u5e03 4.2.0 \u7248\u672c\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/github.com\/apl-devs\/AppIntro \u7b97\u662f\u4f7f\u7528\u7db2\u8def\u73fe\u6210\u7684 introduction lib \u6240\u767c\u751f\u7684\u554f\u984c\u3002\u5728\u6b64\u7c21\u55ae\u7b46\u8a18\u4e00\u4e0b\u3002\u6b64 lib \u4e3b\u8981\u529f\u80fd\u5c31\u662f\u53ef\u4ee5\u5feb\u901f\u505a\u51fa\u5f80\u53f3&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50,5,52],"tags":[73,72],"_links":{"self":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts\/262"}],"collection":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=262"}],"version-history":[{"count":0,"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts\/262\/revisions"}],"wp:attachment":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}