Skip to content

[core] switch over string, but the first switchRegion is a ifRegion #2770

@ewt45

Description

@ewt45

Issue details

switch(string) is splitted into two switches in smali. but d8 optimization sometimes changes the first switch into if. Currently SwitchOverStringVisitor doesn't handle this situation.

Relevant log output or stacktrace

decompiled code

/* JADX WARN: Removed duplicated region for block: B:34:0x0070  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private void changeUIByCurFragment() {
        String tag = getSupportFragmentManager().findFragmentById(2131296368).getTag();
        byte b = 0;
        if (tag == null) {
            setHomeIsActionBack(false);
        }
        if (tag.equals(FRAGMENT_TAG_CONTAINER_PROP) || tag.equals(FRAGMENT_TAG_CHOOSE_FILE)) {
            setHomeIsActionBack(true);
        } else {
            setHomeIsActionBack(false);
        }
        int iHashCode = tag.hashCode();
        if (iHashCode != -2019877892) {
            if (iHashCode != -1058712772) {
                if (iHashCode != -487288020) {
                    b = (iHashCode == 2807996 && tag.equals(FRAGMENT_TAG_INSTALL_NEW)) ? (byte) 2 : (byte) -1;
                } else if (tag.equals(FRAGMENT_TAG_MANAGE_CONTAINERS)) {
                    b = 3;
                }
            } else if (tag.equals(FRAGMENT_TAG_START_MENU)) {
                b = 1;
            }
        } else if (!tag.equals(FRAGMENT_TAG_DESKTOP)) {
        }
        switch (b) {
            case 0:
                this.mNavigationView.setCheckedItem(2131296369);
                break;
            case 1:
                this.mNavigationView.setCheckedItem(2131296373);
                break;
            case 2:
                this.mNavigationView.setCheckedItem(2131296371);
                break;
            case 3:
                this.mNavigationView.setCheckedItem(2131296372);
                break;
        }
    }

Provide sample and class/method full name

sample smali

Jadx version

latest (331c4aa)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions