Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

& and && #202

Closed
JamesLiAndroid opened this issue Jan 14, 2018 · 3 comments
Closed

& and && #202

JamesLiAndroid opened this issue Jan 14, 2018 · 3 comments

Comments

@JamesLiAndroid
Copy link

This is the java code from jadx translate:

this.tv_printPreview2.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Cut_activity.this.playSound();
                if ((Cut_activity.this.isWork | Cut_activity.this.cutStatus) != 0) { // please see this line 
                    MyToast.createToastConfig().ToastShow(Cut_activity.this.getApplicationContext(), "打印设置前请停止工作");
                    return;
                }
                Intent intent = new Intent(Cut_activity.this, NewRun.class);
                intent.putExtra("CutCreate", true);
                Cut_activity.this.startActivityForResult(intent, 1001);
            }
        });

maybe
if ((Cut_activity.this.isWork | Cut_activity.this.cutStatus) != 0) {

should be translate to this:

if (Cut_activity.this.isWork || Cut_activity.this.cutStatus) {

I have to change this error in AndroidStudio many times, so I want to listen your advice!

@skylot
Copy link
Owner

skylot commented Jan 14, 2018

Can you provide link to this apk? Or part of this method in smali or in jadx fallback format?
I don't know how to write the test to reproduce this issue.

@asashour
Copy link
Contributor

I am trying to look into this, and I want to create the corresponding code as in if (boolean1 || boolean2) to replace a single IfNode, in SimplifyVisitor

What would be the best way? Create IfNodes, then how to put them in a block? Or should two blocks are created?

Thanks.

@skylot
Copy link
Owner

skylot commented Mar 26, 2019

I think that optimization must be placed in IfCondition.simplify method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants