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

type-inference-wip branch: variable is used outside its scope #483

Closed
bagipro opened this issue Mar 21, 2019 · 1 comment
Closed

type-inference-wip branch: variable is used outside its scope #483

bagipro opened this issue Mar 21, 2019 · 1 comment

Comments

@bagipro
Copy link
Collaborator

bagipro commented Mar 21, 2019

Hi, please check the following code, class p001.abhz (you can grep for "com.google.android.finsky.instantapps.dna.PhoneskyArchiveProvider" to find the class)

if (f951d.match(uri) == 1) {
    java.lang.String encodedPath = uri.getEncodedPath();
    java.lang.String decode = android.net.Uri.decode(encodedPath.substring(encodedPath.indexOf(47, 1) + 1));
    java.io.File[] listFiles = this.f953b.listFiles();
    if (listFiles != null) {
        if (length == 0) {
            r3 = null; // <<< use of a register
        } else {
            for (java.io.File file : listFiles) {
                if (android.text.TextUtils.equals(file.getName(), decode) && file.isFile()) {
                    break;
                }
            }
            file = null;
        }
    } else {
        file = null; // <<< use of "file" variable which is not accessible here, only in the loop above
    }
    if (file != null) {
        parcelFileDescriptor = android.os.ParcelFileDescriptor.open(file, 268435456);
    }
}

APK: https://drive.google.com/file/d/1dW_iGusWGuRg55Ttlb9-ZOZ227rfRHzc/view?usp=sharing

@skylot
Copy link
Owner

skylot commented Mar 24, 2019

@sergey-wowwow fixed in both branches

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

2 participants