Skip to content

Commit 7c31448

Browse files
committed
Fix SeparateGroup in low versions
1 parent 97bd233 commit 7c31448

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,14 @@ private void hookTabInstance(Class<?> cFrag) throws Exception {
201201
XposedBridge.hookMethod(recreateFragmentMethod, new XC_MethodHook() {
202202
@Override
203203
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
204-
var bundle = (Bundle) param.args[0];
205-
var state = bundle.getParcelable("state");
206-
var string = state.toString();
204+
var string = "";
205+
if (param.args[0] instanceof Bundle bundle) {
206+
var state = bundle.getParcelable("state");
207+
if (state == null) return;
208+
string = state.toString();
209+
} else {
210+
string = param.args[2].toString();
211+
}
207212
var matcher = pattern.matcher(string);
208213
if (matcher.find()) {
209214
var tabId = Integer.parseInt(matcher.group(1));

0 commit comments

Comments
 (0)