Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
Updated to version Messenger v449.0.0.47.111
Browse files Browse the repository at this point in the history
  • Loading branch information
Loukious committed Mar 14, 2024
1 parent 4676d92 commit ad0d7a6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
.cxx
app/release/
app/debug/
.idea/misc.xml
6 changes: 3 additions & 3 deletions app/src/main/java/tn/amin/mpro2/constants/ModuleInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
26 changes: 13 additions & 13 deletions app/src/main/java/tn/amin/mpro2/hook/all/MessageSentHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -35,15 +35,15 @@ protected Set<XC_MethodHook.Unhook> 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)
Expand All @@ -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;
}
}
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ad0d7a6

Please sign in to comment.