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

Incompleted search results #426

Closed
ghost opened this issue Jan 10, 2019 · 2 comments
Closed

Incompleted search results #426

ghost opened this issue Jan 10, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 10, 2019

Search for 'SDK_INT' but not result found from SELinuxHelper.initForProcess
XposedBridge.zip

@jpstotz
Copy link
Collaborator

jpstotz commented Jan 10, 2019

This seems to be bug of Jadx caused by the else-if structure it is used in.

Currently for whatever reason the TextSearchIndex class ignores lines that start with a }:

if (line.length() != 0 && line.charAt(0) != '}') {

If I disable this check the number of search results for "SDK_INT" increases from 24 to 29.
Also the find spot inside the SELinuxHelper class is now found, however the search index is pointing to the wrong line. Instead of pointing to line 73 in the source code it points to line 71:

    static void initForProcess(String packageName) {
        if (!sIsSELinuxEnabled) {
            sServiceAppDataFile = new DirectAccessService();
        } else if (packageName == null) { // search index points to this line
            sServiceAppDataFile = new ZygoteService();
        } else if (!packageName.equals("android") || VERSION.SDK_INT >= 26) {
            sServiceAppDataFile = new DirectAccessService();
        } else {
            sServiceAppDataFile = BinderService.getService(0);
        }
    }

@skylot
Copy link
Owner

skylot commented Jan 10, 2019

Hm, looks like I was trying to skip lines not needed in the index: like "}" or "} else {".
Code line can be replaced with

if (line.length() != 0 && (line.length() != 1 || line.charAt(0) != '}')) {

to skip at least single closing brackets.
Also sadly, but StringRef does not support equals with string, so I can't do

if (line.length() != 0 && !line.equals("}")) {

This issue was closed.
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