bugfix.修复一个无法加载maaCore的bug

This commit is contained in:
guigui
2022-12-29 21:54:11 +08:00
parent 64147478d3
commit 45814b5cee
3 changed files with 5 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ public class MaaJavaSample {
*/
public static void main(String[] args) {
//设定JNA寻找maa的dll的地址同时也要把这个路径添加到环境变量中的Path中
String maaPath = "C:/Users/iguigui/Desktop/MaaCoreArknights3";
String maaPath = "C:\\Users\\gui\\Desktop\\MeoAssistantArknights";
System.setProperty("jna.library.path", maaPath);
//adb地址自己看着办
String adbPath = maaPath + "/platform-tools/adb.exe";

View File

@@ -18,7 +18,7 @@ object MaaService {
private val wsConnection = Collections.synchronizedSet<Connection?>(LinkedHashSet())
val MaaCore: MaaCore by lazy {
val maaCore: MaaCore by lazy {
var maaPath = File(File("").absolutePath).parent
logger.info("maaPath $maaPath")
// maaPath = "C:\\Users\\atmzx\\Desktop\\MaaCoreArknights3"
@@ -33,8 +33,8 @@ object MaaService {
// if (instancePool.containsKey(id)) {
// return ConnectResponse(id, true)
// }
val maaInstance = MaaInstance(MaaCore, id, adbPath, host, detailJson, ::callBackLog)
maaInstance.pointer = MaaCore.AsstCreateEx(maaInstance, maaInstance.id)
val maaInstance = MaaInstance(maaCore, id, adbPath, host, detailJson, ::callBackLog)
maaInstance.pointer = maaCore.AsstCreateEx(maaInstance, maaInstance.id)
val connect = maaInstance.connect()
if (!connect) {
return ConnectResponse("", false)
@@ -54,7 +54,7 @@ object MaaService {
fun stop(id: String) = instancePool[id]?.stop() ?: false
fun getVersion(): String = MaaCore.AsstGetVersion()
fun getVersion(): String = maaCore.AsstGetVersion()
private fun sha1(password: String): String {
val messageDigest = MessageDigest.getInstance("SHA")