← 回總覽

用 Lua 写 Android 应用? AutoLua 做到了

📅 2026-06-19 09:13 haikejishu 软件编程 2 分鐘 2282 字 評分: 78
Android Lua 自动化 开发者工具 开源项目
📌 一句话摘要 AutoLua 通过 LuaJava 桥接将完整 Lua 5.3 运行时与 Android API 打通,让脚本能直接调用原生能力并构建 UI,在自由度上显著超越同类自动化工具。 📝 详细摘要 本文介绍了一款名为 AutoLua 的 Android 自动化工具。其核心思路是借助 LuaJava 技术,将完整的 Lua 5.3 运行时(包含协程、位运算等特性)与 Android 原生 API 桥接,使得 Lua 脚本可以直接 `import` 并调用 `android.widget.*`、`android.content.Intent` 等 Java 类,无需等待中间件封装。

Title: 用 Lua 写 Android 应用? AutoLua 做到了 | BestBlogs.dev

URL Source: https://www.bestblogs.dev/article/1a4aa8d7?amp%3Butm_medium=feed&%3Butm_campaign=resources&%3Bentry=rss_article_item

Published Time: 2026-06-19 09:13:04

Markdown Content: 78

AutoLua bridges the complete Lua 5.3 runtime with Android APIs via LuaJava, allowing scripts to directly call native capabilities and build UIs, offering significantly more freedom than similar automation tools. ![Image 1: V2EXV2EX](https://www.bestblogs.dev/articles?sourceid=17e31348 "View More From This Source")

Today 421 words (about 2 min) View Source →

Sign in to highlight text and take notes as you read. Sign in now

做了个小工具,技术栈 LuaJava + Lua 5.3 。核心思路是把完整 Lua 运行时和 Android API 桥接,让脚本能直接调原生能力。

技术层面几个点

* Lua 5.3 完整运行时,不是阉割版、不是类 Basic 语法。Goto 、协程、位运算全有 * import "android.graphics.Bitmap" 原生调用,零中间层。想调什么调什么,不等封装、不等更新 * .alp 压缩工程格式,透明不加密,脚本归属权是用户自己的。随时导出、分享、备份 * 内置 AES/RSA/MD5/Base64 加解密,网络请求、多线程全支持

一段代码说清楚

-- import 直接用,零封装
import "android.widget.*"
import "android.content.Intent"
import "android.net.Uri"

-- 布局表构建 UI ,不是拖控件 layout = { LinearLayout, orientation = "vertical", { Button, text = "点我", id = "btn" }, } activity.setContentView(LoadLayout(layout))

-- 事件绑定 — getter/setter 简写 btn.onClick = function(v) print("clicked") -- 直接调系统 API local intent = Intent(Intent.ACTION_VIEW) intent.setData(Uri.parse("https://www.autolua.top")) activity.startActivity(intent) end

对比同类工具

| | AutoLua | 按键精灵 | Tasker | Auto.js | | --- | --- | --- | --- | --- | | 语言 | Lua 5.3 完整 | 类 Basic | 可视化 | JavaScript | | 调 Java API | import 直接用 | 不支持 | 有限 | 有限 | | UI 构建 | 代码自由画 | 录制/模板 | 模板 | 模板 | 自由度不在一个维度。 Lua 不只是脚本语言,加 LuaJava 桥接后它成了 Android 的一等公民。

文档

欢迎搞机玩家和技术同好来玩。

* 官网:https://www.autolua.top/(下载 APK / 在线文档 / 功能演示) * 文档 & 网站源码( Gitee ):https://gitee.com/autoluapro/autolua_doc * 文档 & 网站源码( GitHub ):https://github.com/autolua/autolua_doc

查看原文 → 發佈: 2026-06-19 09:13:04 收錄: 2026-06-19 14:00:53

🤖 問 AI

針對這篇文章提問,AI 會根據文章內容回答。按 Ctrl+Enter 送出。