<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-05-08 16:45:00
* @LastEditors: sueRimn
* @LastEditTime: 2020-05-09 12:22:15
-->
<div align="center">
<img width="160" src="https://cdn.jsdelivr.net/gh/mzdluo123/blog_imgs/img/20200531205703.png" alt="logo"></br>
<img width="95" src="https://cdn.jsdelivr.net/gh/mzdluo123/blog_imgs/img/20200531205726.png" alt="title">
</div>
# MiraiAndroid
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/workflow/status/mzdluo123/MiraiAndroid/Android Build?style=flat-square">
<img alt="GitHub issues" src="https://img.shields.io/github/issues/mzdluo123/MiraiAndroid?style=flat-square">
<img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/mzdluo123/MiraiAndroid?style=flat-square">
mirai-console的Android前端程序,可作为qq机器人使用,支持多种脚本接口
关于mirai项目以及mirai-console的一切请点击[这里](https://github.com/mamoe/mirai)
相比使用`Termux`或者是`Linux Deploy`等应用运行mirai的方案,该项目提供的方案具有更好的性能以及更少的资源占用,但可能存在兼容性问题
最新的构建版本你可以到release或QQ群内找到
MiraiAndroid交流群:`1131127734`但是请注意,如果您违反了群内相关规定或是有其他不当行为你可能会被无理由移出本群
图标以及形象由画师<a href = "https://github.com/DazeCake">DazeCake</a>绘制
## 声明
### 一切开发旨在学习,请勿用于非法用途
- MiraiAndroid 是完全免费且开放源代码的软件,仅供学习和娱乐用途使用
- MiraiAndroid 不会通过任何方式强制收取费用,或对使用者提出物质条件
- MiraiAndroid 由整个开源社区维护,并不是属于某个个体的作品,所有贡献者都享有其作品的著作权。
### 许可证
Copyright (C) 2019-2020 Mamoe Technologies and contributors.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
`MiraiAndroid` 采用 `AGPLv3` 协议开源。为了整个社区的良性发展,我们**强烈建议**您做到以下几点:
- **间接接触(包括但不限于使用 `httpapi` 或 跨进程技术)到 `mirai` 的软件使用 `AGPLv3` 开源**
- **不鼓励,不支持一切商业使用**
# 已实现的功能
* 兼容mirai-console插件(实验性)
* 带验证码的登录处理
* 内置Google d8 dex编译器,可直接编译JVM的console插件在Android运行(实验性)
* lua脚本接口(测试版)
* 网络掉线提醒
# 安装脚本
目前MiraiAndroid已支持lua和JavaScript脚本,感谢[lua-mirai](https://github.com/only52607/lua-mirai)和[mirai-js](https://github.com/iTXTech/mirai-js)项目
## lua脚本
以下是一个简单的示例
```lua
Event.onLoad = function (bot)
bot:subscribeGroupMsg(
function(bot, msg, group, sender)
group:sendMsg( msg )
end
)
end
```
这个脚本实现了最简单的"复读机"功能,更多API请看[lua-mirai android api](https://github.com/only52607/lua-mirai/blob/master/docs/miraiandroid.md)
## JavaScript脚本
以下是一个~~简单~~复杂的示例
```JavaScript
// 插件信息
pluginInfo = {
name: "JsPluginExample",
version: "1.0.0",
author: "PeratX",
website: "https://github.com/iTXTech/mirai-js/blob/master/examples/reply.js"
};
let verbose = true;
// onLoad 事件
plugin.ev.onLoad = () => {
logger.info("插件已加载:" + plugin.dataDir);
// 插件数据读写
let file = plugin.getDataFile("test.txt")
// 第三个编码参数默认为 UTF-8,可空,同readText第二个参数
stor.writeText(file, "真的很强。", Charset.forName("GBK"));
logger.info("读取文件:" + file + " 内容:" + stor.readText(file, Charset.forName("GBK")));
let config = new JsonConfig(plugin.getDataFile("test.json"));
config.put("wow", "Hello World!");
config.save();
let v = 0;
// 启动协程
core.launch(() => {
v++;
logger.info("正在等待:" + v);
if (verbose) {
// 100ms执行一次
return 100;
}
// 停止协程,返回 -1
return -1;
});
// 延时1000ms执行一次
core.launch(() => {
verbose = false
return -1;
}, 1000);
// 命令名称,描述,帮助,别名,回调
core.registerCommand("test", "测试命令", "test", null, (sender, args) => {
logger.info("发送者:" + sender)
logger.info("参数:" + args)
return true
});
};
plugin.ev.onEnable = () => {
logger.info("插件已启用。" + (plugin.enabled ? "是真的" : "是假的"));
try {
// Http 基于 OkHttp,可使用 OkHttp 的 API 自行构造
let result = http.get("https://github.com/mamoe/mirai");
if (result.isSuccessful()) {
logger.info("Mirai GitHub主页长度:" + result.body().string().length());
} else {
logger.error("无法访问Mirai GitHub主页");
}
// 手动调用 OkHttp
let client = http.newClient()
.connectTimeout(5000, TimeUnit.MILLISECONDS)
.readTimeout(5000, TimeUnit.MILLISECONDS)
.build()
let response = client.newCall(
http.newRequest()
.url("https://im.qq.com")
.header("User-Agent", "NMSL Browser 1.0")
.build()
).execute();
if (response.isSuccessful()) {
logger.info("QQ主页长度:" + response.body().string().length());
} else {
logger.error("无法访问QQ主页");
}
} catch (e) {
logger.error("无法获取网页", e)
}
regEv();
};
plugin.ev.onDisable = () => {
logger.info("插件已禁用。");
};
plugin.ev.onUnload = () => {
logger.info("插件已卸载。");
};
function regEv() {
core.subscribeAlways(BotOnlineEvent, ev => {
logger.info(ev);
});
core.subscribeAlways(GroupMessageEvent, ev => {
logger.info(ev);
ev.group.sendMessage(new PlainText("MiraiJs 收到消息:").plus(ev.message));
})
}
```
你可以在[这里](https://github.com/iTXTech/mirai-js/blob/master/examples/reply.js)找到它,更多内容请查看项目介绍
在脚本管理界面点击右上角`+`可直接添加脚本到MiraiAndroid
目前该功能仍在开发中
# 安装插件
你有两个办法安装插件
## 使用app直接打开jar文件安装
这是最简单的方式。app切换到插件管理点击右上角选择即可,你也可以使用系统文件选择器直接打开jar文件
**如果你无法选择文件**,请使用第三方文件选择器选择(例如Mix)
## 使用pc转换后导入
请按照以下方法操作
* 找到`d8`编译器的运行脚本
d8工具已在新版`Android sdk`中自带,它就在`build-tools`中对应版本的文件夹下。在Windows平台他是一个bat文件
如果没有可到上面的交流群内下载
* 编译
打开终端,使用以下命令编译
```
d8.bat --output 输出文件.jar 源文件
```
输出文件扩展名必须是jar或者是zip
* 复制资源
使用压缩软件打开源jar文件,将里面的`plugin.yml`,`META-INF`和其他资源文件(除存放class文件夹的其他文件)复制到新的jar文件内
* 安装插件
�
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
高效率 QQ 机器人支持库__Kotlin_java_下载 (1466个子文件)
IbotAidlInterface.aidl 752B
jvm.api 465KB
android.api 464KB
jvm.api 192KB
jvm.api 0B
android.api 0B
Plugin main class Java.java.ft.back 505B
gradlew.bat 3KB
gradlew.bat 3KB
gradlew.bat 2KB
jpeg-header-issue-1610.bin 153KB
install-20210412.cmd 810B
.editorconfig 38KB
.gitignore.ft 2KB
RunTerminal.run.xml.ft 1KB
Plugin main class Java.java.ft 1KB
Plugin main class Kotlin.kt.ft 790B
Plugin build.gradle.ft 378B
Plugin build.gradle.kts.ft 374B
Plugin settings.gradle.kts.ft 33B
Plugin main service.txt.ft 29B
Gradle gradle.properties.ft 26B
account.properties.ft 22B
.gitattributes 101B
.gitignore 568B
.gitignore 475B
.gitignore 219B
.gitignore 88B
.gitignore 44B
.gitignore 35B
.gitignore 35B
.gitignore 24B
.gitignore 17B
.gitignore 7B
.gitignore 7B
.gitignore 4B
.gitmodules 117B
build.gradle 5KB
publish.gradle 5KB
build.gradle 944B
api-validation.gradle 735B
android.gradle 552B
settings.gradle 48B
gradlew 6KB
gradlew 5KB
gradlew 5KB
AbstractTest.groovy 3KB
TestPluginApply.groovy 780B
UsingStringPlusMessage.html 688B
description.html 584B
description.html 584B
ResourceNotClosed.html 579B
PluginMainServiceNotConfigured.html 569B
Plugin settings.gradle.kts.html 525B
RunTerminal.run.xml.html 525B
Plugin main class Java.java.html 523B
account.properties.html 523B
Gradle gradle.properties.html 523B
Plugin main class Kotlin.kt.html 523B
Plugin main service.txt.html 523B
Plugin build.gradle.kts.html 522B
Plugin build.gradle.html 518B
.gitignore.html 502B
net.mamoe.mirai.IMirai 394B
net.mamoe.mirai.event.InternalGlobalEventChannelProvider 421B
net.mamoe.mirai.message.data.InternalImageProtocol 424B
d8.jar 3.75MB
mirai-js-1.0.0.jar 1.31MB
ide-common.jar 431KB
mirai-console-0.5.2.jar 363KB
gradle-wrapper.jar 57KB
gradle-wrapper.jar 57KB
gradle-wrapper.jar 53KB
giteeman-0.2.3.jar 22KB
JavaApiTests.java 5KB
LoopQueue.java 5KB
DeviceStatus.java 4KB
DexCompiler.java 3KB
TestJavaPlugin.java 1KB
ResourceNotClosedInspectionTestJava.java 1KB
EventChannelJavaTest.java 980B
JSimpleTest.java 941B
BufferedImage.java 71B
nav.js 2KB
nav.js 2KB
ext.js 1KB
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 430B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 408B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 404B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 399B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 394B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 389B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 388B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 387B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 369B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 369B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 81B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 69B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 58B
net.mamoe.mirai.console.plugin.jvm.JvmPlugin 43B
共 1466 条
- 1
- 2
- 3
- 4
- 5
- 6
- 15
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- python五一数学建模 (2).zip
- 利用python实现随机森林类代码
- 蚁群算法路径规划matlab
- 2024五一数学建模(利用python进行数学建模).zip
- 计算机毕业设计-JAVA+SQL离散数学题库管理系统(源代码+论文+外文翻译)
- 计算机毕业设计-Java+access综合测评系统毕业设计(源代码+论文+开题报告+任务书)
- 计算机毕业设计-JavaSmart系统-系统框架设计与开发(源代码+论文)
- 297418564246850加工中心宏计算.apk
- 基于Python实现对书旗小说网进行逆向,实现整本书的采集源代码 并使用tkinter做了GUI界面
- 基于Python实现对塔读小说的免费内容进行整本书的采集源代码,利用JS逆向对每章节中的文字广告进行去除
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功