Skip to content

Commit 844c068

Browse files
committed
Refactor TagMessage and ShowOnline
- Refactor `TagMessage` to correctly identify the view for broadcast icons. - Remove unnecessary logging in `ShowOnline`. Signed-off-by: Dev4Mod <[email protected]>
1 parent 97e32f5 commit 844c068

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

app/src/main/java/com/wmods/wppenhacer/xposed/features/customization/ShowOnline.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,11 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
176176
if (WppCore.isGroup(jid)) return;
177177

178178
var tokenDBInstance = fieldTokenDBInstance.get(mInstancePresence);
179-
log(tokenDBInstance.getClass().toString());
180179
var tokenData = ReflectionUtils.callMethod(tcTokenMethod, tokenDBInstance, jidObject);
181180
var tokenObj = tokenClass.getConstructors()[0].newInstance(tokenData == null ? null : XposedHelpers.getObjectField(tokenData, "A01"));
182181
sendPresenceMethod.invoke(null, jidObject, null, tokenObj, mInstancePresence);
183-
logDebug("sendPresenceMethod", sendPresenceMethod);
184182

185183
var status = (String) ReflectionUtils.callMethod(getStatusUser, mStatusUser, object, false);
186-
log(status);
187184
var currentPosition = (int) ReflectionUtils.callMethod(getAdapterPositionMethod, viewHolder);
188185
if (currentPosition != position) return;
189186
if (!TextUtils.isEmpty(status) && status.trim().equals(UnobfuscatorCache.getInstance().getString("online"))) {

app/src/main/java/com/wmods/wppenhacer/xposed/features/privacy/TagMessage.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.wmods.wppenhacer.xposed.features.privacy;
22

3+
import android.view.View;
34
import android.view.ViewGroup;
45
import android.widget.ImageView;
56

@@ -64,9 +65,9 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
6465
var fmessage = new FMessageWpp(fmessageObj);
6566
var key = fmessage.getKey();
6667
if (!key.isFromMe && fmessage.isBroadcast()) {
67-
var id = ReflectionUtils.getArg(param.args, Integer.class, 0);
6868
var view = (ViewGroup) (param.thisObject instanceof ViewGroup ? param.thisObject : param.args[0]);
69-
var res = view.findViewById(id);
69+
int id = Utils.getID("broadcast_icon", "id");
70+
View res = view.findViewById(id);
7071
if (res == null) {
7172
var dateWrapper = (ViewGroup) view.findViewById(Utils.getID("date_wrapper", "id"));
7273
var broadcast = new ImageView(view.getContext());

0 commit comments

Comments
 (0)