Skip to content

Commit e42788c

Browse files
committed
fix(Others): always show me tab menu item in options menu
1 parent a1e1be3 commit e42788c

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

  • app/src/main/java/com/wmods/wppenhacer/xposed/features/general

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.os.PowerManager;
77
import android.text.TextUtils;
88
import android.view.Menu;
9+
import android.view.MenuItem;
910
import android.view.View;
1011
import android.view.ViewGroup;
1112
import android.widget.TextView;
@@ -82,7 +83,6 @@ public void doHook() throws Exception {
8283
var animationEmojis = prefs.getBoolean("animation_emojis", false);
8384
var disableProfileStatus = prefs.getBoolean("disable_profile_status", false);
8485
var disableExpiration = prefs.getBoolean("disable_expiration", false);
85-
var isAction = prefs.getBoolean("buttonaction", true);
8686

8787
propsInteger.put(3877, oldStatus ? igstatus ? 2 : 0 : 2);
8888

@@ -105,18 +105,19 @@ public void doHook() throws Exception {
105105
propsInteger.put(18564, newSettings ? 2 : 0);
106106

107107
if (newSettings) {
108-
if (!isAction) {
109-
Method hideMeIcon = Unobfuscator.loadHideMeTabIcon(classLoader);
110-
XposedBridge.hookMethod(hideMeIcon, XC_MethodReplacement.returnConstant(null));
111-
propsBoolean.put(25516, false);
112-
propsBoolean.put(23920, false);
113-
propsBoolean.put(14862, true);
114-
propsInteger.put(18564, 2);
115-
}
116-
}else {
117-
propsBoolean.put(14862, newSettings); // WHATS_HAPPENING_SENDING_ENABLED_CODE
118-
propsInteger.put(18564, newSettings ? 2 : 0); // ME_TAB_V2_VARIANTS_CODE
108+
XposedBridge.hookAllMethods(WppCore.getHomeActivityClass(classLoader), "onCreateOptionsMenu", new XC_MethodHook() {
109+
@Override
110+
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
111+
var menu = (Menu)param.args[0];
112+
var menuItem = menu.findItem(Utils.getID("me_tab_menu_item","id"));
113+
if (menuItem != null){
114+
menuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
115+
}
116+
}
117+
});
119118
}
119+
propsBoolean.put(14862, newSettings); // WHATS_HAPPENING_SENDING_ENABLED_CODE
120+
propsInteger.put(18564, newSettings ? 2 : 0); // ME_TAB_V2_VARIANTS_CODE
120121

121122
propsBoolean.put(2889, floatingMenu);
122123

0 commit comments

Comments
 (0)