Skip to content

Commit 5261828

Browse files
committed
Support LIDs in Separate Chats/Groups
This commit also refactors the FeatureLoader.ErrorItem class by adding Lombok annotations and simplifying the exception message construction. Signed-off-by: Dev4Mod <[email protected]>
1 parent 0a98253 commit 5261828

File tree

2 files changed

+10
-47
lines changed

2 files changed

+10
-47
lines changed

app/src/main/java/com/wmods/wppenhacer/xposed/core/FeatureLoader.java

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@
9797
import de.robv.android.xposed.XSharedPreferences;
9898
import de.robv.android.xposed.XposedBridge;
9999
import de.robv.android.xposed.XposedHelpers;
100+
import lombok.Getter;
101+
import lombok.Setter;
100102

101103
public class FeatureLoader {
102104
public static Application mApp;
@@ -142,12 +144,11 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
142144
if (!isSupported) {
143145
disableExpirationVersion(mApp.getClassLoader());
144146
if (!pref.getBoolean("bypass_version_check", false)) {
145-
StringBuilder sb = new StringBuilder()
146-
.append("Unsupported version: ")
147-
.append(packageInfo.versionName)
148-
.append("\n")
149-
.append("Only the function of ignoring the expiration of the WhatsApp version has been applied!");
150-
throw new Exception(sb.toString());
147+
String sb = "Unsupported version: " +
148+
packageInfo.versionName +
149+
"\n" +
150+
"Only the function of ignoring the expiration of the WhatsApp version has been applied!";
151+
throw new Exception(sb);
151152
}
152153
}
153154
SharedPreferencesWrapper.hookInit(mApp.getClassLoader());
@@ -307,7 +308,6 @@ private static void plugins(@NonNull ClassLoader loader, @NonNull XSharedPrefere
307308
BubbleColors.class,
308309
CallPrivacy.class,
309310
ActivityController.class,
310-
// CustomTheme.class,
311311
CustomThemeV2.class,
312312
ChatLimit.class,
313313
SeparateGroup.class,
@@ -385,6 +385,8 @@ private static void plugins(@NonNull ClassLoader loader, @NonNull XSharedPrefere
385385
}
386386
}
387387

388+
@Getter
389+
@Setter
388390
private static class ErrorItem {
389391
private String pluginName;
390392
private String whatsAppVersion;
@@ -402,44 +404,5 @@ public String toString() {
402404
"\nerror='" + getError() + '\'';
403405
}
404406

405-
public String getWhatsAppVersion() {
406-
return whatsAppVersion;
407-
}
408-
409-
public void setWhatsAppVersion(String whatsAppVersion) {
410-
this.whatsAppVersion = whatsAppVersion;
411-
}
412-
413-
public String getError() {
414-
return error;
415-
}
416-
417-
public void setError(String error) {
418-
this.error = error;
419-
}
420-
421-
public String getPluginName() {
422-
return pluginName;
423-
}
424-
425-
public void setPluginName(String pluginName) {
426-
this.pluginName = pluginName;
427-
}
428-
429-
public String getModuleVersion() {
430-
return moduleVersion;
431-
}
432-
433-
public void setModuleVersion(String moduleVersion) {
434-
this.moduleVersion = moduleVersion;
435-
}
436-
437-
public String getMessage() {
438-
return message;
439-
}
440-
441-
public void setMessage(String message) {
442-
this.message = message;
443-
}
444407
}
445408
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ private boolean checkGroup(Object chat) {
358358
var server = (String) callMethod(jid, "getServer");
359359
if (isGroup)
360360
return server.equals("broadcast") || server.equals("g.us");
361-
return server.equals("s.whatsapp.net");
361+
return server.equals("s.whatsapp.net") || server.equals("lid");
362362
}
363363
return true;
364364
}

0 commit comments

Comments
 (0)