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

confusing logic #26

Open
ntop001 opened this issue Dec 9, 2013 · 1 comment
Open

confusing logic #26

ntop001 opened this issue Dec 9, 2013 · 1 comment

Comments

@ntop001
Copy link

ntop001 commented Dec 9, 2013

I find some code snippet in ApkDecoder.java

JarFile jf = new JarFile(mApkFile.getAbsoluteFile());
            JarEntry je = jf.getJarEntry("resources.arsc");
            if (je != null) {
                int compression = je.getMethod();
                mCompressResources = (compression != ZipEntry.STORED)
                        && (compression == ZipEntry.DEFLATED);
            }
            jf.close();

as java define

public static final int DEFLATED
Added in API level 1
Zip entry state: Deflated.
Constant Value: 8 (0x00000008)
public static final int STORED
Added in API level 1
Zip entry state: Stored.
Constant Value: 0 (0x00000000)

possible output for above logic

input(compression's value) output(mCompressResources's value )
ZipEntry.STORED false
ZipEntry.DEFLATED true
Others value false

why not just use mCompressResources = (compression == ZipEntry.DEFLATED); which get the same result ?

@iBotPeaches
Copy link
Contributor

Thanks. I've made the change: iBotPeaches/Apktool@d5d03fe

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