forked from Dev4Mod/WaEnhancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge branch 'Dev4Mod:master' into theme
Showing
44 changed files
with
975 additions
and
651 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
app/src/main/java/com/wmods/wppenhacer/xposed/features/customization/CustomThemeV2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
package com.wmods.wppenhacer.xposed.features.customization; | ||
|
||
import android.content.res.AssetManager; | ||
import android.graphics.drawable.Drawable; | ||
import android.util.TypedValue; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.wmods.wppenhacer.utils.DrawableColors; | ||
import com.wmods.wppenhacer.utils.IColors; | ||
import com.wmods.wppenhacer.xposed.core.Feature; | ||
import com.wmods.wppenhacer.xposed.utils.DesignUtils; | ||
import com.wmods.wppenhacer.xposed.utils.Utils; | ||
|
||
import java.util.Objects; | ||
import java.util.Properties; | ||
|
||
import de.robv.android.xposed.XC_MethodHook; | ||
import de.robv.android.xposed.XSharedPreferences; | ||
import de.robv.android.xposed.XposedBridge; | ||
import de.robv.android.xposed.XposedHelpers; | ||
|
||
public class CustomThemeV2 extends Feature { | ||
|
||
public CustomThemeV2(@NonNull ClassLoader classLoader, @NonNull XSharedPreferences preferences) { | ||
super(classLoader, preferences); | ||
} | ||
|
||
@Override | ||
public void doHook() throws Throwable { | ||
|
||
Properties properties = Utils.extractProperties(prefs.getString("custom_css", "")); | ||
|
||
var primaryColorInt = prefs.getInt("primary_color", 0); | ||
var secondaryColorInt = prefs.getInt("secondary_color", 0); | ||
var backgroundColorInt = prefs.getInt("background_color", 0); | ||
|
||
var primaryColor = DesignUtils.checkSystemColor(properties.getProperty("primary_color", "0")); | ||
var secondaryColor = DesignUtils.checkSystemColor(properties.getProperty("secondary_color", "0")); | ||
var backgroundColor = DesignUtils.checkSystemColor(properties.getProperty("background_color", "0")); | ||
|
||
if (prefs.getBoolean("changecolor", false)) { | ||
primaryColor = primaryColorInt == 0 ? "0" : IColors.toString(primaryColorInt); | ||
secondaryColor = secondaryColorInt == 0 ? "0" : IColors.toString(secondaryColorInt); | ||
backgroundColor = backgroundColorInt == 0 ? "0" : IColors.toString(backgroundColorInt); | ||
} | ||
|
||
if (prefs.getBoolean("changecolor", false) || Objects.equals(properties.getProperty("change_colors"), "true")) { | ||
for (var c : IColors.colors.keySet()) { | ||
if (!primaryColor.equals("0") && DesignUtils.isValidColor(primaryColor)) { | ||
primaryColor = primaryColor.length() == 9 ? primaryColor : "#ff" + primaryColor.substring(1); | ||
switch (c) { | ||
case "00a884", "1da457", "21c063", "d9fdd3" -> | ||
IColors.colors.put(c, primaryColor.substring(3)); | ||
case "#ff00a884", "#ff1da457", "#ff21c063", "#ff1daa61", "#ff25d366", | ||
"#ffd9fdd3" -> IColors.colors.put(c, primaryColor); | ||
case "#ff103529" -> | ||
IColors.colors.put(c, "#66" + primaryColor.substring(3)); | ||
} | ||
} | ||
|
||
if (!backgroundColor.equals("0") && DesignUtils.isValidColor(backgroundColor)) { | ||
backgroundColor = backgroundColor.length() == 9 ? backgroundColor : "#ff" + backgroundColor.substring(1); | ||
switch (c) { | ||
case "0b141a", "0a1014" -> | ||
IColors.colors.put(c, backgroundColor.substring(3)); | ||
case "#ff0b141a", "#ff111b21", "#ff000000", "#ff0a1014", "#ff10161a", | ||
"#ff12181c", "#ff20272b" -> IColors.colors.put(c, backgroundColor); | ||
} | ||
} | ||
|
||
if (!secondaryColor.equals("0") && DesignUtils.isValidColor(secondaryColor)) { | ||
secondaryColor = secondaryColor.length() == 9 ? secondaryColor : "#ff" + secondaryColor.substring(1); | ||
if (c.equals("#ff202c33") || c.equals("#ff2a2f33")) { | ||
IColors.colors.put(c, secondaryColor); | ||
} | ||
} | ||
} | ||
} | ||
|
||
XposedBridge.hookAllMethods(AssetManager.class, "getResourceValue", new XC_MethodHook() { | ||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
var id = (int) param.args[0]; | ||
var typedValue = (TypedValue) param.args[2]; | ||
if (id >= 0x7f060000 && id <= 0x7f06ffff) { | ||
if (typedValue.type >= TypedValue.TYPE_FIRST_INT | ||
&& typedValue.type <= TypedValue.TYPE_LAST_INT) { | ||
if (typedValue.data == 0) return; | ||
typedValue.data = IColors.getFromIntColor(typedValue.data, IColors.colors); | ||
} | ||
} | ||
} | ||
}); | ||
|
||
var resourceImpl = XposedHelpers.findClass("android.content.res.ResourcesImpl", classLoader); | ||
XposedBridge.hookAllMethods(resourceImpl, "loadDrawable", new XC_MethodHook() { | ||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
var drawable = (Drawable) param.getResult(); | ||
DrawableColors.replaceColor(drawable, IColors.colors); | ||
} | ||
}); | ||
|
||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getPluginName() { | ||
return "Custom Theme V2"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
[IMPROVEMENTS] | ||
* Improvement in multi click functions (Archived Chats and doubled Click to reaction) | ||
[FIXES] | ||
* Fixed the bug in the wallpaper function that made other screens tremble. | ||
* Fixed bug in AssemblyAI that didn't work (Test it and let me know if it's working for you). | ||
|
||
|
||
[WHATSAPP] | ||
* Added pre-support for version 2.24.22.xx (Obrigado novamente ao frknkrc44) | ||
* Add Initial support for beta 2.24.25.XX | ||
|
||
[FEATURES] | ||
* Added the ability to send videos in real resolution. | ||
|
||
[IMPROVEMENTS] | ||
* Improvements to the HD video and image function (Now the Whatsapp quality selector works for videos and images with resolutions higher than HD) | ||
|
||
[WAE] | ||
* Updated translations | ||
* Added support for Chinese language (Maybe some Chinese outside the country will use it) | ||
* Updated translations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters