{"id":19448,"date":"2024-03-22T15:08:20","date_gmt":"2024-03-22T07:08:20","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=19448"},"modified":"2024-03-22T15:08:20","modified_gmt":"2024-03-22T07:08:20","slug":"androlua%e7%94%9f%e6%88%90apk%e6%93%8d%e4%bd%9c%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/19448\/","title":{"rendered":"androlua\u751f\u6210apk\u64cd\u4f5c\u6307\u5357"},"content":{"rendered":"

Androlua\u662f\u4e00\u79cd\u57fa\u4e8eLua\u8bed\u8a00\u7684Android\u5e94\u7528\u5f00\u53d1\u6846\u67b6\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u4f7f\u7528\u7b80\u5355\u7684Lua\u811a\u672c\u6765\u5f00\u53d1Android\u5e94\u7528\u3002\u4f7f\u7528Androlua\uff0c\u60a8\u53ef\u4ee5\u5feb\u901f\u5f00\u53d1\u51fa\u529f\u80fd\u5f3a\u5927\u7684Android\u5e94\u7528\u7a0b\u5e8f\uff0c\u800c\u65e0\u9700\u638c\u63e1\u590d\u6742\u7684Java\u5f00\u53d1\u77e5\u8bc6\u3002\u672c\u6587\u5c06\u4ecb\u7ecdAndrolua\u7684\u751f\u6210APK\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n

Androlua\u7684\u539f\u7406\uff1a<\/p>\n

Androlua\u57fa\u4e8eApktool\u548cDex2jar\u8fd9\u4e24\u4e2a\u5de5\u5177\uff0c\u901a\u8fc7Apktool\u5c06apk\u6587\u4ef6\u53cd\u7f16\u8bd1\u6210smali\u4ee3\u7801\uff0c\u7136\u540e\u4f7f\u7528Dex2jar\u5c06smali\u4ee3\u7801\u8f6c\u6362\u4e3ajar\u6587\u4ef6apk\u6253\u5305h5<\/a>\u3002\u63a5\u4e0b\u6765\uff0cAndrolua\u4f1a\u5c06\u7528\u6237\u7f16\u5199\u7684Lua\u811a\u672c\u5408\u5e76\u5230\u751f\u6210\u7684jar\u6587\u4ef6\u4e2d\uff0c\u5e76\u751f\u6210\u4e00\u4e2a\u65b0\u7684apk\u6587\u4ef6\u3002<\/p>\n

\u751f\u6210APK\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n

1. \u5b89\u88c5Androlua\uff1a\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88c5Androlua\u7684\u5f00\u53d1\u73af\u5883\u3002\u60a8\u53ef\u4ee5\u5728Androlua\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0a\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684Androlua\uff0c\u5e76\u6309\u7167\u5b98\u65b9\u6587\u6863\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n

2. \u51c6\u5907\u5de5\u4f5c\uff1a\u5728\u8fdb\u884cAPK\u751f\u6210\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u51c6\u5907\u597d\u4ee5\u4e0b\u51e0\u4e2a\u6587\u4ef6\uff1a<\/p>\n

– \u5f85\u751f\u6210APK\u7684Lua\u811a\u672c\u6587\u4ef6\uff1a\u60a8\u53ef\u4ee5\u4f7f\u7528\u4efb\u4f55\u6587\u672c\u7f16\u8f91\u5668\u7f16\u5199Lua\u811a\u672c\uff0c\u4fdd\u5b58\u4e3a.lua\u6587\u4ef6\u3002<\/p>\n

– AndroidManifest.xml\u6587\u4ef6\uff1a\u8fd9\u662fAndroid\u5e94\u7528\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u60a8\u53ef\u4ee5\u5728Androlua\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u4e00\u4e2a\u793a\u4f8b\u6587\u4ef6\uff0c\u5e76\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u8fdb\u884c\u4fee\u6539\u3002<\/p>\n

– res\u6587\u4ef6\u5939\uff1a\u8fd9\u4e2a\u6587\u4ef6\u5939\u5305\u542b\u4e86\u5e94\u7528\u7684\u8d44\u6e90\u6587\u4ef6\uff0c\u4f8b\u5982\u56fe\u7247\u3001\u5e03\u5c40\u6587\u4ef6\u7b49\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u521b\u5efa\u76f8\u5e94\u7684\u6587\u4ef6\u5939\u548c\u6587\u4ef6\u3002<\/p>\n

3. \u7f16\u5199Lua\u811a\u672c\uff1a\u4f7f\u7528\u60a8\u559c\u6b22\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u7f16\u5199\u60a8\u7684Lua\u811a\u672c\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528Androlua\u63d0\u4f9b\u7684API\u6765\u8bbf\u95eeAndroid\u7684\u529f\u80fd\uff0c\u4f8b\u5982\u6253\u5f00\u6444\u50cf\u5934\u3001\u53d1\u9001\u77ed\u4fe1\u7b49\u3002<\/p>\n

4. \u6784\u5efaAPK\uff1a\u901a\u8fc7\u5728Androlua\u7684\u547d\u4ee4\u884c\u754c\u9762\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u6784\u5efaAPK\uff1a<\/p>\n

“`<\/p>\n

[\u8def\u5f84]\/androlua-build [\u8d44\u6e90\u6587\u4ef6\u5939\u8def\u5f84] [Lua\u811a\u672c\u8def\u5f84] [\u8f93\u51faAPK\u8def\u5f84]<\/p>\n

“`<\/p>\n

– [\u8def\u5f84]\uff1aAndrolua\u7684\u5b89\u88c5\u8def\u5f84\u3002<\/p>\n

– [\u8d44\u6e90\u6587\u4ef6\u5939\u8def\u5f84]\uff1a\u5305\u542b\u8d44\u6e90\u6587\u4ef6\u7684\u6587\u4ef6\u5939\u8def\u5f84\u3002<\/p>\n

– [Lua\u811a\u672c\u8def\u5f84]\uff1a\u60a8\u7f16\u5199\u7684Lua\u811a\u672c\u7684\u8def\u5f84\u3002<\/p>\n

– [\u8f93\u51faAPK\u8def\u5f84]\uff1a\u751f\u6210\u7684APK\u6587\u4ef6\u7684\u4fdd\u5b58\u8def\u5f84\u3002<\/p>\n

\u4f8b\u5982\uff1a<\/p>\n

“`<\/p>\n

C:\/Androlua\/androlua-build C:\/MyApp\/res C:\/MyApp\/main.lua C:\/MyApp\/MyApp.apk<\/p>\n

“`<\/p>\n

5. \u538b\u7f29APK\uff1a\u4f7f\u7528\u5de5\u5177\u59827-Zip\u7b49\uff0c\u5982\u4f55\u6253\u5305\u8fd0\u884clua\u7248\u672c\u7684apk<\/a>\u5c06\u751f\u6210\u7684APK\u6587\u4ef6\u8fdb\u884c\u538b\u7f29\uff0c\u4ee5\u51cf\u5c0f\u6587\u4ef6\u5927\u5c0f\u3002\u4fee\u6539\u6587\u4ef6\u540e\u7f00\u540d\u4e3a.zip\uff0c\u5e76\u5c06\u5176\u4e2d\u7684classes.dex\u6587\u4ef6\u76f4\u63a5\u5220\u9664\u3002<\/p>\n

6. \u91cd\u65b0\u7b7e\u540dAPK\uff1a\u4f7f\u7528\u5de5\u5177\u5982ApkSigner\u7b49\u91cd\u65b0\u7b7e\u540dAPK\u6587\u4ef6\uff0c\u4ee5\u786e\u4fddAPK\u5728\u5b89\u88c5\u65f6\u4e0d\u4f1a\u51fa\u73b0\u5b89\u5168\u8b66\u544a\u3002<\/p>\n

\u81f3\u6b64\uff0c\u60a8\u5df2\u7ecf\u6210\u529f\u751f\u6210\u4e86\u4e00\u4e2aAndrolua\u5e94\u7528\u7684APK\u6587\u4ef6\u3002\u60a8\u53ef\u4ee5\u5c06\u5176\u5b89\u88c5\u5230Android\u8bbe\u5907\u4e0a\u8fdb\u884c\u6d4b\u8bd5\uff0c\u6216\u8005\u901a\u8fc7\u5e94\u7528\u5546\u5e97\u7b49\u6e20\u9053\u5206\u53d1\u60a8\u7684\u5e94\u7528\u3002<\/p>\n

\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cAndrolua\u662f\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee\uff0c\u4f7f\u7528\u5b83\u751f\u6210\u7684APK\u6587\u4ef6\u53ef\u80fd\u4f1a\u53d7\u5230\u4e00\u4e9b\u9650\u5236\u3002\u5728\u53d1\u5e03\u60a8\u7684\u5e94\u7528\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u5df2\u7ecf\u4e86\u89e3\u5e76\u9075\u5b88\u76f8\u5173\u6cd5\u5f8b\u6cd5\u89c4\u3001\u5e94\u7528\u5546\u5e97\u7684\u653f\u7b56\u8981\u6c42\u7b49\u3002\u540c\u65f6\uff0cAndrolua\u4e5f\u6709\u4e00\u4e9b\u5c40\u9650\u6027\uff0c\u4f8b\u5982\u8fd0\u884c\u6548\u7387\u76f8\u5bf9\u8f83\u4f4e\uff0c\u4e0d\u9002\u5408\u5f00\u53d1\u5927\u578b\u590d\u6742\u7684\u5e94\u7528\u3002<\/p>\n

\u603b\u7ed3\uff1a<\/p>\n

\u672c\u6587\u4ecb\u7ecd\u4e86Androlua\u751f\u6210APK\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002\u901a\u8fc7\u4f7f\u7528Androlua\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u7b80<\/p>\n

<\/figure>\n<\/p>\n

\u5355\u7684Lua\u811a\u672c\u6765\u5f00\u53d1Android\u5e94\u7528\uff0c\u800c\u65e0\u9700\u6df1\u5165\u7814\u7a76Java\u5f00\u53d1\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff0c\u795d\u60a8\u5728\u4f7f\u7528Androlua\u5f00\u53d1\u5e94\u7528\u65f6\u53d6\u5f97\u6210\u529f\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"

Androlua\u662f\u4e00\u79cd\u57fa\u4e8eLua\u8bed\u8a00\u7684Android\u5e94\u7528\u5f00\u53d1\u6846\u67b6\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u4f7f\u7528\u7b80\u5355\u7684Lua\u811a\u672c\u6765\u5f00\u53d1Android\u5e94\u7528\u3002\u4f7f\u7528Androlua\uff0c\u60a8\u53ef\u4ee5\u5feb\u901f\u5f00\u53d1\u51fa\u529f\u80fd\u5f3a\u5927\u7684Android\u5e94\u7528\u7a0b\u5e8f\uff0c\u800c<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[21914,21913,904,16,1075],"topic":[],"class_list":["post-19448","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-andrionstudioapk","tag-apk-","tag-904","tag-16","tag-1075"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/19448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=19448"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/19448\/revisions"}],"predecessor-version":[{"id":19568,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/19448\/revisions\/19568"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=19448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=19448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=19448"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=19448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}