Skip to content

Commit 0667f7c

Browse files
committed
fix logo is missing
Signed-off-by: Dev4Mod <[email protected]>
1 parent c623ecc commit 0667f7c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ public void doHook() throws Exception {
5050
Others.propsBoolean.put(5353, true);
5151
Others.propsBoolean.put(8735, false);
5252
expirationAboutInfo();
53-
disableNewLogo();
54-
53+
if (showName || showBio) {
54+
disableNewLogo();
55+
}
5556
}
5657

5758
private void disableNewLogo() throws Exception {
@@ -138,6 +139,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
138139
var logo = toolbar.findViewById(Utils.getID("toolbar_logo", "id"));
139140
var name = WppCore.getMyName();
140141
var bio = WppCore.getMyBio();
142+
var nameWa = homeActivity.getPackageManager().getApplicationLabel(homeActivity.getApplicationInfo()).toString();
141143

142144

143145
if (typeArchive.equals("1")) {
@@ -164,9 +166,7 @@ public void onMultiClick(View v) {
164166

165167
var methods = Arrays.stream(actionbar.getClass().getDeclaredMethods()).filter(m -> m.getParameterCount() == 1 && m.getParameterTypes()[0] == CharSequence.class).toArray(Method[]::new);
166168

167-
if (showName) {
168-
methods[1].invoke(actionbar, name);
169-
}
169+
methods[1].invoke(actionbar, showName ? name : nameWa);
170170

171171
if (showBio) {
172172
methods[0].invoke(actionbar, bio);
@@ -177,13 +177,13 @@ public void onMultiClick(View v) {
177177
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
178178
var name = WppCore.getMyName();
179179
var bio = WppCore.getMyBio();
180-
if (showBio && (param.args[0] == "" || param.args[0] == "WhatsApp")) {
180+
if (showBio && (param.args[0] == "" || param.args[0] == nameWa)) {
181181
ReflectionUtils.callMethod(methods[0], param.thisObject, bio);
182182
} else {
183183
ReflectionUtils.callMethod(methods[0], param.thisObject, "");
184184
}
185-
if (showName && (param.args[0] == "" || param.args[0] == "WhatsApp")) {
186-
param.args[0] = name;
185+
if (param.args[0] == "" || param.args[0] == nameWa) {
186+
param.args[0] = showName ? name : nameWa;
187187
}
188188

189189
var layoutParams = logo.getLayoutParams();

0 commit comments

Comments
 (0)