Skip to content

Commit d780ec5

Browse files
committed
Add option to disable WhatsApp expiration and update supported versions
Signed-off-by: Dev4Mod <[email protected]>
1 parent 55114d5 commit d780ec5

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
199199
});
200200
}
201201

202-
private static void disableExpirationVersion(ClassLoader classLoader) {
202+
public static void disableExpirationVersion(ClassLoader classLoader) {
203203
var expirationClass = Unobfuscator.loadExpirationClass(classLoader);
204204
var method = ReflectionUtils.findMethodUsingFilter(expirationClass, m -> m.getReturnType().equals(Date.class));
205205
XposedBridge.hookMethod(method, new XC_MethodHook() {

app/src/main/java/com/wmods/wppenhacer/xposed/features/general/Others.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.wmods.wppenhacer.xposed.features.general;
22

3+
import static com.wmods.wppenhacer.xposed.core.FeatureLoader.disableExpirationVersion;
4+
35
import android.annotation.SuppressLint;
46
import android.os.BaseBundle;
57
import android.os.Message;
@@ -75,6 +77,7 @@ public void doHook() throws Exception {
7577
var igstatus = prefs.getBoolean("igstatus", false);
7678
var animationEmojis = prefs.getBoolean("animation_emojis", false);
7779
var disableProfileStatus = prefs.getBoolean("disable_profile_status", false);
80+
var disableExpiration = prefs.getBoolean("disable_expiration", false);
7881

7982
propsInteger.put(3877, oldStatus ? igstatus ? 2 : 0 : 2);
8083
propsBoolean.put(5171, filterSeen);
@@ -231,6 +234,10 @@ public void doHook() throws Exception {
231234
disablePhotoProfileStatus();
232235
}
233236

237+
if (disableExpiration) {
238+
disableExpirationVersion(classLoader);
239+
}
240+
234241
}
235242

236243
private void disablePhotoProfileStatus() throws Exception {

app/src/main/res/values/arrays.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
<item>2.25.22.xx</item>
127127
<item>2.25.23.xx</item>
128128
<item>2.25.24.xx</item>
129+
<item>2.25.25.xx</item>
129130
</string-array>
130131
<string-array name="supported_versions_business">
131132
<item>2.25.18.xx</item>
@@ -135,6 +136,7 @@
135136
<item>2.25.22.xx</item>
136137
<item>2.25.23.xx</item>
137138
<item>2.25.24.xx</item>
139+
<item>2.25.25.xx</item>
138140
</string-array>
139141
<string-array name="image_picker">
140142
<item>image/*</item>

app/src/main/res/xml/preference_general_home.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
app:summary="@string/update_check_sum"
1919
app:title="@string/update_check" />
2020

21+
<rikka.material.preference.MaterialSwitchPreference
22+
app:defaultValue="true"
23+
app:key="disable_expiration"
24+
app:summary="Deactivates the expired version of WhatsApp, (Note: Manual Disable to update WhatsApp on the Play Store or mark the Play Store on LSposed)"
25+
app:title="Disable WhatsApp Expiration" />
26+
2127
<rikka.material.preference.MaterialSwitchPreference
2228
app:key="lite_mode"
2329
app:summary="@string/lite_mode_sum"

0 commit comments

Comments
 (0)