Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit d093477

Browse files
committed
fix #51
1 parent f5c5b3a commit d093477

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
<uses-permission android:name="android.permission.WAKE_LOCK" />
1111
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
1212
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
13+
<uses-permission
14+
android:name="android.permission.QUERY_ALL_PACKAGES"
15+
tools:ignore="QueryAllPackagesPermission" />
16+
17+
<queries>
18+
<intent>
19+
<action android:name="android.intent.action.SEND" />
20+
</intent>
21+
</queries>
1322

1423
<application
1524
android:name=".BotApplication"

app/src/main/java/io/github/mzdluo123/mirai/android/service/BotService.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ class BotService : LifecycleService() {
6565
// Debug.waitForDebugger()
6666
// }
6767

68-
init {
69-
if (AppSettings.waitingDebugger) {
70-
MiraiAndroidLogger.info("等待调试器链接..... PID:${android.os.Process.myPid()}")
71-
Debug.waitForDebugger()
72-
}
73-
74-
}
7568

7669
companion object {
7770
const val START_SERVICE = 0
@@ -116,6 +109,12 @@ class BotService : LifecycleService() {
116109
override fun onCreate() {
117110
super.onCreate()
118111
consoleFrontEnd = AndroidMiraiConsole(baseContext, getExternalFilesDir("")!!.toPath())
112+
113+
if (AppSettings.waitingDebugger) {
114+
MiraiAndroidLogger.info("等待调试器链接..... PID:${android.os.Process.myPid()}")
115+
Debug.waitForDebugger()
116+
}
117+
119118
//powerManager = getSystemService(Context.POWER_SERVICE) as PowerManager
120119
// wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "BotWakeLock")
121120
}
@@ -175,7 +174,7 @@ class BotService : LifecycleService() {
175174
// consoleVersion = BuildConfig.COREVERSION,
176175
// path = getExternalFilesDir(null).toString()
177176
// )
178-
177+
179178
LuaMiraiPlugin.load()
180179
LuaMiraiPlugin.enable()
181180

app/src/main/jniLibs/x86/liblame.so

-364 KB
Binary file not shown.

app/src/main/jniLibs/x86/libsilk.so

-248 KB
Binary file not shown.
406 KB
Binary file not shown.
272 KB
Binary file not shown.

app/src/main/res/layout/fragment_script.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
android:id="@+id/textView16"
1111
android:layout_width="wrap_content"
1212
android:layout_height="wrap_content"
13-
android:text="敬请期待"
13+
android:text="MiraiAndroid已内置lua插件,请在控制台内操作"
14+
android:textSize="18sp"
1415
app:layout_constraintBottom_toBottomOf="parent"
1516
app:layout_constraintEnd_toEndOf="parent"
1617
app:layout_constraintStart_toStartOf="parent"

0 commit comments

Comments
 (0)