{"id":370,"date":"2024-06-06T23:47:12","date_gmt":"2024-06-06T15:47:12","guid":{"rendered":"http:\/\/www.s1mh0.cn\/blog\/?p=370"},"modified":"2024-06-21T17:52:35","modified_gmt":"2024-06-21T09:52:35","slug":"jar_patch","status":"publish","type":"post","link":"https:\/\/www.s1mh0.cn\/blog\/index.php\/2024\/06\/06\/jar_patch\/","title":{"rendered":"\u79bb\u7ebf\u5355\u6587\u4ef6\u66ff\u6362\u6253\u5305Jar"},"content":{"rendered":"<p>\u5728\u6253AWD\u6216AWDP\u65f6\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230Jar\u5305\u8d77\u7684Web\u670d\u52a1\uff0c\u521d\u5b66patch\u65f6\u603b\u4f1a\u9047\u5230\u672c\u5730\u4f9d\u8d56\u7f3a\u5931\u6216\u8005\u62a5\u9519\u7b49\u95ee\u9898\uff0c\u5728\u516c\u4f17\u53f7\u770b\u5230<a href=\"https:\/\/mp.weixin.qq.com\/s\/WbF7T4_WfkdeP27RG-pNEQ\">AWD\u79bb\u7ebf-Jar\u6587\u4ef6\u51b7\u8865\u4e01<\/a>\u8fd9\u7bc7\u6587\u7ae0\uff0c\u7b97\u662f\u53c8\u5b66\u4f1a\u4e86\u4e00\u79cd\u7b80\u5355\u65b9\u4fbf\u7684Jar\u5305\u79bb\u7ebfpatch\u65b9\u6cd5\uff0c\u5173\u952e\u70b9\u5c31\u662f\u751f\u6210\u4fee\u590d\u540e\u7684.class\u6587\u4ef6\uff0c\u603b\u4f53\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n<h3>\u4e00\u3001\u53cd\u7f16\u8bd1Jar\u5305\u5f97\u5230\u6e90\u7801\u53ca\u76f8\u5173\u4f9d\u8d56\u6587\u4ef6<\/h3>\n<p>\u4ee5\u6570\u5b57\u4e2d\u56fd\u51b3\u8d5bAWDP\u7684\u4e00\u9053java\u9898\u4e3a\u4f8b\uff0c\u9996\u5148\u901a\u8fc7jadx\u76f4\u63a5\u5bfc\u51fa\u6e90\u7801\uff0c\u5176\u4e2d.java\u6e90\u7801\u6587\u4ef6\u5728<code>sources<\/code>\u76ee\u5f55\u4e0b\uff0c\u4f9d\u8d56\u6587\u4ef6\u5728<code>resources\\BOOT-INF\\lib<\/code>\u76ee\u5f55\u4e0b<\/p>\n<h3>\u4e8c\u3001\u4fee\u6539\u6e90\u7801\u6587\u4ef6\u5e76\u540c\u4f9d\u8d56\u4e00\u8d77\u6253\u5305\u7f16\u8bd1<\/h3>\n<p>\u56e0\u4e3a\u9700\u8981\u8bbe\u7f6e\u4e34\u65f6\u73af\u5883\u53d8\u91cf\uff0c\u6240\u4ee5\u7f16\u8bd1\u64cd\u4f5c\u662f\u5728Linux\u73af\u5883\u4e0b<\/p>\n<p>\u5c06\u4f9d\u8d56\u6587\u4ef6\u4e0e\u5df2\u7ecf\u6539\u597d\u7684\u6e90\u7801\u653e\u5728\u540c\u4e00\u76ee\u5f55\u4e0b\uff0c\u65b9\u4fbf\u540e\u7eed\u7f16\u8bd1\u64cd\u4f5c\uff0c\u5982\u679c\u6e90\u7801\u4e2d\u5bfc\u5165\u4e86\u81ea\u5b9a\u4e49\u7684\u7c7b\uff0c\u4e5f\u9700\u8981\u5c06\u8fd9\u4e9b\u7c7b\u7684\u6e90\u7801\u653e\u5728\u4e00\u8d77\uff08PS\uff1a\u5982\u679c\u6ca1\u6709javac\u73af\u5883\u7684\u8bdd\uff0c\u53ef\u4ee5\u76f4\u63a5\u4e0b\u4e00\u4e2ajdk\uff09<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/06\/jar_patch1.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/06\/jar_patch2.png\" alt=\"\" \/><\/p>\n<p>\u63a5\u7740\u5bf9\u4fee\u6539\u540e\u7684\u6e90\u7801\u8fdb\u884c\u7f16\u8bd1<\/p>\n<pre><code class=\"language-bash\"># \u8bbe\u7f6e\u4e00\u4e2a\u4e34\u65f6\u4f9d\u8d56\u6240\u5728\u7684\u73af\u5883\u53d8\u91cf\nCLASS_LIB=$(find .\/BOOT-INF\/lib\/ -name &quot;*.jar&quot; | tr &#039;\\n&#039; &#039;:&#039;); \n\n~\/Desktop\/jdk1.8.0_202\/bin\/javac -cp &quot;.:${CLASS_LIB%:}&quot; .\/UserServiceImpl.java .\/com\/example\/demo\/model\/User.java  .\/com\/example\/demo\/service\/UserService.java .\/com\/example\/demo\/utils.java<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/06\/jar_patch3.png\" alt=\"\" \/><\/p>\n<p>\u7f16\u8bd1\u6210\u529f\uff0c\u5982\u679c\u62a5\u9519\u5c31\u6839\u636e\u62a5\u9519\u4fe1\u606f\u6dfb\u52a0\u5bf9\u5e94\u7c7b\u7684.java\u6587\u4ef6<\/p>\n<h3>\u4e09\u3001\u76f4\u63a5\u5728Jar\u5305\u66ff\u6362.class\u6587\u4ef6<\/h3>\n<p>\u5c06Jar\u5305\u4ee5\u538b\u7f29\u5305\u5f62\u5f0f\u6253\u5f00\uff0c\u76f4\u63a5\u5c06\u7f16\u8bd1\u540e\u7684.class\u6587\u4ef6\u62d6\u5165\u66ff\u6362<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/06\/jar_patch4.png\" alt=\"\" \/><\/p>\n<p>\u6d4b\u8bd5Web\u670d\u52a1\u542f\u52a8\u6210\u529f\uff0c\u4e14\u6f0f\u6d1e\u5b58\u5728\u70b9\u5df2\u88ab\u4fee\u590d<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/06\/jar_patch5.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.s1mh0.cn\/blog\/wp-content\/uploads\/2024\/06\/jar_patch6.png\" alt=\"\" \/><\/p>\n<div class=\"clearfix\"><\/div>","protected":false},"excerpt":{"rendered":"<p>\u5728\u6253AWD\u6216AWDP\u65f6\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230Jar\u5305\u8d77\u7684Web\u670d\u52a1\uff0c\u521d\u5b66patch\u65f6\u603b\u4f1a\u9047\u5230\u672c\u5730\u4f9d\u8d56\u7f3a\u5931\u6216\u8005\u62a5\u9519\u7b49\u95ee\u9898\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-370","post","type-post","status-publish","format-standard","hentry","category-web"],"views":849,"_links":{"self":[{"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=370"}],"version-history":[{"count":3,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/370\/revisions"}],"predecessor-version":[{"id":380,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/370\/revisions\/380"}],"wp:attachment":[{"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.s1mh0.cn\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}