Skip to content

Commit 624b327

Browse files
authored
Merge branch 'main' into main
2 parents a3775d0 + ad705b1 commit 624b327

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
3. 下载本项目(安卓套壳)
1414

1515
## 编译
16-
1.`Go-Mirai-Client` 目录下执行 `gomobile bind -target=android ./pkg/gmc`,得到 `gmc.aar``gmc-sources.jar`
17-
2. 复制 `gmc.aar``gmc-sources.jar` 到本项目 `app/libs` 目录下
16+
1.`Go-Mirai-Client` 目录下执行 `gomobile bind -target=android ./service/gmc_android`,得到 `gmc_android.aar``gmc_android-sources.jar`
17+
2. 复制 `gmc_android.aar``gmc_android-sources.jar` 到本项目 `app/libs` 目录下
1818
3. 编译安卓
1919

Binary file not shown.
46.5 MB
Binary file not shown.

app/src/main/java/cn/lliiooll/gmc/BotService.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,28 @@
99
import android.widget.Toast;
1010
import androidx.annotation.Nullable;
1111
import cn.lliiooll.gmc.util.NotificationUtil;
12-
import gmc.Gmc;
12+
import gmc_android.Gmc_android;
13+
1314
import net.lz1998.gomiraiclient.MainActivity;
1415
import org.jetbrains.annotations.NotNull;
1516

1617
/**
1718
* 用来运行gmc的服务
1819
*/
20+
import java.io.File;
21+
1922
public class BotService extends Service {
2023
private static boolean active = false;
2124

2225
@Override
2326
public void onCreate() {
24-
new Thread(Gmc::start).start();// 新建线程启动gmc
2527
Toast.makeText(this, "GMC启动中...", Toast.LENGTH_LONG).show();// 发个通知别让用户以为程序卡了
28+
Gmc_android.setPluginPath(new File(getFilesDir(),"plugins").getAbsolutePath());
29+
Gmc_android.setLogger(s -> {
30+
// TODO print log on screen
31+
});
32+
new Thread(Gmc_android::start).start();// 新建线程启动gmc
33+
Toast.makeText(this, "Start Service", Toast.LENGTH_SHORT).show();
2634
active = true;
2735
startForeground(1, NotificationUtil.create(this));// 启动前台服务
2836
super.onCreate();

0 commit comments

Comments
 (0)