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

Undeclared Method isMethodSynthetic being called in LibraryProfiler.java 155 and many other places #16

Closed
chamorajg opened this issue Jun 20, 2018 · 11 comments

Comments

@chamorajg
Copy link

isMethodSyntetic is not a method in IMethod class in com.ibm.wala.classLoader . There is a method named isSynthetic which is defined instead.
Here is the link https://www.ibm.com/support/knowledgecenter/SSS9LM_9.0.0/com.ibm.rational.appscansrc.utilities.osx.doc/api/com/ibm/wala/classLoader/IMethod.html

@reddr
Copy link
Owner

reddr commented Jun 21, 2018

You are right. I added isMethodSynthetic to prevent undesired side-effects. Large parts of the code always assumed isSynthetic to return false. By correctly implementing this functionality, I encountered quite a number of issues at various places. As I'm unsure about all the possible side-effects in the WALA code base, I decided to add this new class that only my code is calling.

Find attached the patch I applied. If someone is familiar with the WALA code base, I would for sure welcome to get rid of this extra method again.
wala_add_check_synthethic_methods.txt

@chamorajg
Copy link
Author

Thank you sir for your reply.
One more issue is to be answered.
At
->/src/de/infsec/tpl/utils/WalaUtils.java:243

eturn clazz.getClassHierarchy().getScope().isApplicationLoader(clazz.getClassLoader()) && !isAndroidResourceClass(clazz) && !isEmptyInnerClass && !clazz.isSynthetic()
symbol: method isSynthetic()
location: variable clazz of type IClass
IClass is using the method isSynthetic() which is actually an IMethod function. So is there any patch to this or any correction as of now ???
Thanks for your early reply.

@eighthave
Copy link

Seems like this patch should either be included by upstream in WALA, or it should be handled by changing the code in LibScout. It is generally better to fix things in their code base than patch them in Debian.

@eighthave
Copy link

If WALA upstream accepts the patch, then we'll just included it in the Debian WALA package immediately.

1 similar comment
@eighthave
Copy link

If WALA upstream accepts the patch, then we'll just included it in the Debian WALA package immediately.

@reddr
Copy link
Owner

reddr commented Jun 26, 2018

@ryuzaki-yagami clazz.isSythetic is referring to IClass.isSynthetic not IMethod. This was already integrated in the WALA code and is not something I added. Thus, the code is correct.

@eighthave The problem with the IMethod.isSynthethic patch is that it might have side-effects on other WALA code. Including the patch is trivial, however checking the entire WALA code is very time-consuming if you're not familiar with all the internals.

@chamorajg
Copy link
Author

@reddr isSynthetic is an IMethod function but clazz is an IClass member so it creates an error if clazz was a variable of IClass it would have been correct.

@reddr
Copy link
Owner

reddr commented Jun 28, 2018

Can't follow you on this. In this code location (WalaUtils.isAppClass), the clazz variable is of type IClass and calls the isSynthetic method defined by the WALA framework. Can't see any issue there.

@eighthave
Copy link

eighthave commented Jun 28, 2018 via email

@reddr
Copy link
Owner

reddr commented Jun 28, 2018

@eighthave This is more than just submitting a single patch. I adopted WALA from the JOANA project (https://github.com/joana-team/joana). They integrated SCanDroids WALA dex frontend and developed it further. There were plans to, at some point, submit this dex frontend upstream, but I haven't checked the current status for a while.

LibScout uses JOANA's fork WALA. I applied around 10 additional patches on top of their code base (mainly fixing bugs, 2-3 to customize functionalty to fit my needs). A few patches might be already in their code base, but I haven't followed the development for at least a year, As I rarely change code in this WALA fork, I decided to ship the pre-compiled custom jar for convenience since I don't have time to check both the fork and whatever is merged into the WALA master.

@reddr
Copy link
Owner

reddr commented Sep 14, 2018

Moving to WALA master is now discussed in #20.

@reddr reddr closed this as completed Sep 14, 2018
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