Skip to content

Commit

Permalink
Merge pull request #207 from frknkrc44/feat-var-fixes2
Browse files Browse the repository at this point in the history
feat: Add various fixes (again)
  • Loading branch information
Dev4Mod authored Dec 20, 2024
2 parents 461c12f + e5942ba commit 952434e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1218,10 +1218,11 @@ public synchronized static Constructor loadSeeMoreConstructor(ClassLoader loader
var clazzData = classList.get(0);
XposedBridge.log(clazzData.toString());
for (var method : clazzData.getMethods()) {
if (method.getParamCount() == 2 && method.isConstructor() && method.getParamTypes().get(0).getName().equals(int.class.getName()) && method.getParamTypes().get(1).getName().equals(int.class.getName())) {
if (Arrays.asList(2, 3).contains(method.getParamCount()) && method.isConstructor() && method.getParamTypes().stream().allMatch(c -> c.getName().equals(int.class.getName()))) {
return method.getConstructorInstance(loader);
}
}

throw new RuntimeException("SeeMore constructor 2 not found");
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,21 @@ public void doHook() throws Throwable {
@SuppressLint("ResourceType")
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
var fMessage = XposedHelpers.callMethod(param.thisObject, "getFMessage");
var targetObj = param.thisObject != null
? param.thisObject
: param.args[1];

var fMessage = XposedHelpers.callMethod(targetObj, "getFMessage");
var userJidClass = XposedHelpers.findClass("com.whatsapp.jid.UserJid", classLoader);
var methodResult = ReflectionUtils.findMethodUsingFilter(fMessage.getClass(), method -> method.getReturnType() == userJidClass && method.getParameterCount() == 0);
var userJid = ReflectionUtils.callMethod(methodResult, fMessage);
var chatCurrentJid = WppCore.getCurrentRawJID();
if (!WppCore.isGroup(chatCurrentJid)) return;
var field = ReflectionUtils.getFieldByType(param.thisObject.getClass(), grpcheckAdmin.getDeclaringClass());
var grpParticipants = field.get(param.thisObject);
var field = ReflectionUtils.getFieldByType(targetObj.getClass(), grpcheckAdmin.getDeclaringClass());
var grpParticipants = field.get(targetObj);
var jidGrp = jidFactory.invoke(null, chatCurrentJid);
var result = ReflectionUtils.callMethod(grpcheckAdmin, grpParticipants, jidGrp, userJid);
var view = (View) param.thisObject;
var view = (View) targetObj;
var context = view.getContext();
ImageView iconAdmin;
if ((iconAdmin = view.findViewById(0x7fff0010)) == null) {
Expand Down

0 comments on commit 952434e

Please sign in to comment.