Skip to content

Commit fcae8c6

Browse files
committed
Fix background incorrect in CustomThemeV2
1 parent 9f992ac commit fcae8c6

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

app/src/main/java/com/wmods/wppenhacer/utils/IColors.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static void initColors() {
6464

6565
primaryColors.put("#ff144d37", "#ff144d37");
6666
primaryColors.put("#ff1b8755", "#ff1b8755");
67-
primaryColors.put("#ff15603e", "#A015603e");
67+
primaryColors.put("#ff15603e", "#ff15603e");
6868
primaryColors.put("#ff103529", "#ff103529");
6969

7070
// secundary colors

app/src/main/java/com/wmods/wppenhacer/xposed/core/devkit/Unobfuscator.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,4 +1894,14 @@ public static Field loadChangeTitleLogoField(ClassLoader classLoader) throws Exc
18941894
});
18951895
}
18961896

1897+
public static Class<?> loadFilterItemClass(ClassLoader classLoader) throws Exception {
1898+
return UnobfuscatorCache.getInstance().getClass(classLoader, () -> {
1899+
var methodList = dexkit.findMethod(FindMethod.create().matcher(
1900+
MethodMatcher.create().addUsingNumber(Utils.getID("invisible_height_placeholder","id"))
1901+
.addUsingNumber(Utils.getID("container_view","id"))
1902+
));
1903+
if (methodList.isEmpty())throw new RuntimeException("FilterItemClass Not Found");
1904+
return methodList.get(0).getClassInstance(classLoader);
1905+
});
1906+
}
18971907
}

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import android.content.pm.PackageManager;
1212
import android.content.res.AssetManager;
1313
import android.content.res.ColorStateList;
14+
import android.graphics.Color;
1415
import android.graphics.Paint;
1516
import android.graphics.drawable.Drawable;
1617
import android.os.Bundle;
@@ -209,6 +210,17 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
209210
});
210211
var intBgHook = new IntBgColorHook();
211212
findAndHookMethod(Paint.class, "setColor", int.class, intBgHook);
213+
214+
Class<?> filterItemClass = Unobfuscator.loadFilterItemClass(classLoader);
215+
216+
XposedBridge.hookAllConstructors(filterItemClass, new XC_MethodHook() {
217+
@Override
218+
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
219+
var view = (View) param.args[0];
220+
var textView = (TextView) view.findViewById(Utils.getID("text_view", "id"));
221+
textView.setTextColor(DesignUtils.getPrimaryTextColor());
222+
}
223+
});
212224
}
213225

214226
public void loadAndApplyColors() {

0 commit comments

Comments
 (0)