diff --git a/.gitignore b/.gitignore index 208a418..f6e286a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ .cxx app/release/ app/debug/ +.idea/misc.xml diff --git a/app/src/main/java/tn/amin/mpro2/constants/ModuleInfo.java b/app/src/main/java/tn/amin/mpro2/constants/ModuleInfo.java index d2b4df4..863c3fe 100644 --- a/app/src/main/java/tn/amin/mpro2/constants/ModuleInfo.java +++ b/app/src/main/java/tn/amin/mpro2/constants/ModuleInfo.java @@ -6,9 +6,9 @@ public class ModuleInfo { public static final String LINK_TELEGRAM_SUPPORT = "https://t.me/MProSupport/"; public static final String LINK_GITHUB_WIKI_USAGE_GUIDE = "https://github.com/Mino260806/MessengerPro/wiki/Usage-Guide/"; - public static final int MIN_ORCA_VERSION = 317807898; - public static final int MAX_ORCA_VERSION = 317807978; - public static final String RECOMMENDED_ORCA_VERSION_STRING = "439.0.0.29.119"; + public static final int MIN_ORCA_VERSION = 319809433; + public static final int MAX_ORCA_VERSION = 319809514; + public static final String RECOMMENDED_ORCA_VERSION_STRING = "449.0.0.47.111"; public static final String PACKAGE_AI_PLUGIN = "tn.amin.mproai"; } diff --git a/app/src/main/java/tn/amin/mpro2/hook/all/MessageSentHook.java b/app/src/main/java/tn/amin/mpro2/hook/all/MessageSentHook.java index 80122c6..1802b4e 100644 --- a/app/src/main/java/tn/amin/mpro2/hook/all/MessageSentHook.java +++ b/app/src/main/java/tn/amin/mpro2/hook/all/MessageSentHook.java @@ -16,7 +16,7 @@ import tn.amin.mpro2.orca.datatype.TextMessage; public class MessageSentHook extends BaseHook { - public static final String DISPATCH_METHOD = "dispatchVIJOOOOOOOOOOOOOOOOOOOOOOOO"; + public static final String DISPATCH_METHOD = "dispatchVIJOOOOOOOOOOOOOOOOOOOOOOOOO"; public MessageSentHook() { super(); @@ -35,15 +35,15 @@ protected Set injectInternal(OrcaGateway gateway) { @Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable { - if (param.args[5] instanceof String message) { + if (param.args[6] instanceof String message) { Long threadKey = (Long) param.args[2]; - String rangeStartsString = (String) param.args[7]; - String rangeEndsString = (String) param.args[8]; - String threadKeysString = (String) param.args[9]; - String typesString = (String) param.args[10]; - String replyMessageId = (String) param.args[11]; + String rangeStartsString = (String) param.args[8]; + String rangeEndsString = (String) param.args[9]; + String threadKeysString = (String) param.args[10]; + String typesString = (String) param.args[11]; + String replyMessageId = (String) param.args[12]; TextMessage originalMessage = new TextMessage.Builder(message) .setMentions(Mention.fromDispatchArgs(message, rangeStartsString, rangeEndsString, threadKeysString, typesString)) .setReplyMessageId(replyMessageId) @@ -60,12 +60,12 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { if (refinedMessage == null) return; // Logger.logObjectRecursive(refinedMessage); - param.args[5] = refinedMessage.content; - param.args[7] = Mention.joinRangeStarts(refinedMessage.mentions); - param.args[8] = Mention.joinRangeEnds(refinedMessage.mentions); - param.args[9] = Mention.joinThreadKeys(refinedMessage.mentions); - param.args[10] = Mention.joinTypes(refinedMessage.mentions); - param.args[11] = refinedMessage.replyMessageId; + param.args[6] = refinedMessage.content; + param.args[8] = Mention.joinRangeStarts(refinedMessage.mentions); + param.args[9] = Mention.joinRangeEnds(refinedMessage.mentions); + param.args[10] = Mention.joinThreadKeys(refinedMessage.mentions); + param.args[11] = Mention.joinTypes(refinedMessage.mentions); + param.args[12] = refinedMessage.replyMessageId; } } })); diff --git a/app/src/main/java/tn/amin/mpro2/orca/connector/MailboxConnector.java b/app/src/main/java/tn/amin/mpro2/orca/connector/MailboxConnector.java index a15a671..0c81f13 100644 --- a/app/src/main/java/tn/amin/mpro2/orca/connector/MailboxConnector.java +++ b/app/src/main/java/tn/amin/mpro2/orca/connector/MailboxConnector.java @@ -54,14 +54,14 @@ public void sendText(final TextMessage textMessage, final long threadKey, final preDispatch(notificationScope -> { long time = System.currentTimeMillis() * 1000; Object[] disptachParams = new Object[] { - 9, 65540, threadKey, mailbox.get(), "", textMessage.content, null, null, null, null, null, null, textMessage.replyMessageId != null? 1: 0, 0, null, null, null, time, null, null, null, null, null, null, false, null, notificationScope + 9, 65540, threadKey, mailbox.get(), "", 1, textMessage.content, null, null, null, null, null, null, textMessage.replyMessageId != null? 1: 0, 0, null, null, null, time, null, null, null, null, null, null, false, null, notificationScope }; - disptachParams[7] = Mention.joinRangeStarts(textMessage.mentions); - disptachParams[8] = Mention.joinRangeEnds(textMessage.mentions); - disptachParams[9] = Mention.joinThreadKeys(textMessage.mentions); - disptachParams[10] = Mention.joinTypes(textMessage.mentions); - disptachParams[11] = textMessage.replyMessageId; + disptachParams[8] = Mention.joinRangeStarts(textMessage.mentions); + disptachParams[9] = Mention.joinRangeEnds(textMessage.mentions); + disptachParams[10] = Mention.joinThreadKeys(textMessage.mentions); + disptachParams[11] = Mention.joinTypes(textMessage.mentions); + disptachParams[12] = textMessage.replyMessageId; try { XposedBridge.invokeOriginalMethod(disptach, null, disptachParams); } catch (Throwable t) {