This repository was archived by the owner on Oct 20, 2023. It is now read-only.
File tree 6 files changed +32
-27
lines changed
java/io/github/mzdluo123/mirai/android
6 files changed +32
-27
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ android {
21
21
applicationId " io.github.mzdluo123.mirai.android"
22
22
minSdkVersion 26
23
23
targetSdkVersion 30
24
- versionCode 52
25
- versionName " 3.2.1 "
24
+ versionCode 53
25
+ versionName " 3.2.2 "
26
26
testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
27
27
buildConfigField(" String" , " COREVERSION" , " \" $CORE_VERSION \" " )
28
28
buildConfigField(" String" , " CONSOLEVERSION" , " \" $CONSOLE_VERSION \" " )
@@ -188,8 +188,8 @@ dependencies {
188
188
// }
189
189
190
190
// mirai-lua
191
- // implementation "com.ooooonly:luaMirai:${LUAMIRAI_VERSION}"
192
- // implementation 'org.json:json:20160212'
191
+ implementation " com.ooooonly:luaMirai:${ LUAMIRAI_VERSION} "
192
+ implementation ' org.json:json:20160212'
193
193
implementation ' com.ooooonly:giteeman:0.1.1'
194
194
195
195
// splitties
Original file line number Diff line number Diff line change 50
50
android : name =" .activity.UnsafeLoginActivity"
51
51
android : excludeFromRecents =" true"
52
52
android : label =" 请完成登录验证"
53
- android : launchMode =" singleTask" />
53
+ android : launchMode =" singleTask"
54
+ android : parentActivityName =" .activity.MainActivity" />
54
55
<activity android : name =" .activity.PluginImportActivity" >
55
56
<intent-filter tools : ignore =" AppLinkUrlError" >
56
57
<action android : name =" android.intent.action.VIEW" />
Original file line number Diff line number Diff line change @@ -19,9 +19,7 @@ import org.acra.ACRA
19
19
import org.acra.config.CoreConfigurationBuilder
20
20
import org.acra.config.DialogConfigurationBuilder
21
21
import org.acra.data.StringFormat
22
- import org.bouncycastle.jce.provider.BouncyCastleProvider
23
22
import splitties.init.injectAsAppCtx
24
- import java.security.Security
25
23
26
24
class BotApplication : Application () {
27
25
companion object {
@@ -38,6 +36,7 @@ class BotApplication : Application() {
38
36
super .onCreate()
39
37
injectAsAppCtx()
40
38
context = this
39
+ byPassECDHCHeck()
41
40
val processName = if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .P )
42
41
getProcessName()
43
42
else
@@ -47,10 +46,16 @@ class BotApplication : Application() {
47
46
if (processName?.isEmpty() == false && processName == packageName) {
48
47
initNotification()
49
48
}
50
- if (Security .getProperty(BouncyCastleProvider .PROVIDER_NAME ) != null ) {
51
- Security .removeProvider(BouncyCastleProvider .PROVIDER_NAME )
52
- }
53
- Security .addProvider(BouncyCastleProvider ())
49
+ }
50
+
51
+ /* *
52
+ * 在新版系统上无法使用ECDH算法,使用下面的代码绕过
53
+ * */
54
+ private fun byPassECDHCHeck () {
55
+ val cls = Class .forName(" sun.security.jca.Providers" )
56
+ val field = cls.getDeclaredField(" maximumAllowableApiLevelForBcDeprecation" )
57
+ field.isAccessible = true
58
+ field.setInt(null , 999 )
54
59
}
55
60
56
61
Original file line number Diff line number Diff line change 1
1
package io.github.mzdluo123.mirai.android.miraiconsole
2
2
3
+ import android.text.TextUtils
3
4
import android.util.Log
4
5
import io.github.mzdluo123.mirai.android.AppSettings
5
6
import io.github.mzdluo123.mirai.android.BuildConfig
@@ -32,6 +33,7 @@ fun logException(err: Throwable?) {
32
33
MiraiAndroidLogger .error(stringWriter.toString())
33
34
}
34
35
36
+
35
37
private val lock = Object ()
36
38
37
39
internal fun pushLog (log : String ) {
@@ -47,7 +49,6 @@ internal fun pushLog(log: String) {
47
49
}
48
50
}
49
51
BotService .consoleUi.finishBroadcast()
50
-
51
52
}
52
53
}
53
54
@@ -58,17 +59,12 @@ object MiraiAndroidLogger :
58
59
logException(e)
59
60
synchronized(this ) {
60
61
message?.split(" \n " )?.forEach {
61
- val log = " [${priority.name} ] ${it} "
62
+ val log = " [${priority.name} ] $it "
62
63
val colorLog =
63
- " <font color=\" ${LogColor .valueOf(priority.name).color} \" >[${priority.name} ]</font><![CDATA[${
64
- it.replace(
65
- " \n " ,
66
- " \r "
67
- )
68
- } ]]>"
64
+ " <font color=\" ${LogColor .valueOf(priority.name).color} \" >[${priority.name} ]</font>${
65
+ TextUtils .htmlEncode(it)
66
+ } "
69
67
pushLog(colorLog)
70
-
71
-
72
68
if (BuildConfig .DEBUG || printToSysLog) {
73
69
Log .i(" MA" , log)
74
70
}
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import android.os.RemoteCallbackList
17
17
import android.util.Log
18
18
import androidx.lifecycle.LifecycleService
19
19
import androidx.lifecycle.lifecycleScope
20
+ import com.ooooonly.luaMirai.miraiconsole.LuaMiraiPlugin
20
21
import io.github.mzdluo123.mirai.android.AppSettings
21
22
import io.github.mzdluo123.mirai.android.IConsole
22
23
import io.github.mzdluo123.mirai.android.IbotAidlInterface
@@ -39,6 +40,8 @@ import net.mamoe.mirai.console.MiraiConsoleImplementation.Companion.start
39
40
import net.mamoe.mirai.console.command.CommandManager.INSTANCE.register
40
41
import net.mamoe.mirai.console.command.ConsoleCommandSender
41
42
import net.mamoe.mirai.console.command.executeCommand
43
+ import net.mamoe.mirai.console.plugin.PluginManager.INSTANCE.enable
44
+ import net.mamoe.mirai.console.plugin.PluginManager.INSTANCE.load
42
45
import net.mamoe.mirai.console.rootDir
43
46
import net.mamoe.mirai.event.GlobalEventChannel
44
47
import net.mamoe.mirai.event.events.BotOnlineEvent
@@ -182,8 +185,8 @@ class BotService : LifecycleService() {
182
185
// path = getExternalFilesDir(null).toString()
183
186
// )
184
187
//
185
- // LuaMiraiPlugin.load()
186
- // LuaMiraiPlugin.enable()
188
+ LuaMiraiPlugin .load()
189
+ LuaMiraiPlugin .enable()
187
190
188
191
registerReceiver()
189
192
isStart = true
Original file line number Diff line number Diff line change 1
- 3.2.1
1
+ 3.2.2
2
2
https://maupdate.rainchan.win/app-normal-release.apk
3
- 修复了部分系统无法编译插件的问题
4
- 修复了网络异常导致的启动崩溃问题
5
- 更新mirai-core到2.7-M1
3
+ 更新mirai-core到2.7-RC
4
+ 修复了部分情况下无法登录的问题
5
+ 修复了部分情况下控制台指令无回显的问题
You can’t perform that action at this time.
0 commit comments