Skip to content

Conversation

@zhuowei
Copy link

@zhuowei zhuowei commented Mar 21, 2018

ButterKnife, a popular UI library used by 4.38% of all apps tracked by AppBrain, specifies UI listeners via method annotations. In particular, the Kickstarter app (popular open-source test case) uses it for all listeners.

Since Dare doesn't preserve annotations, make an external utility that uses dexlib2 to extract annotations into a .json. Currently only ButterKnife.OnClick annotations are extracted.

Note that this is a temporary approach: ButterKnife doesn't use the annotations at runtime, so some apps such as Microsoft Outlook strips the view IDs during build, making the annotations useless. The proper way is to parse the ViewBinder/ViewBinding classes generated by ButterKnife, but that is more difficult.

Another issue: the annotation extractor uses a dexlib2 build from Java 8, but the rest of IntelliDroid needs Java 7. Will rebuild dexlib2 later.

Tested with Kickstarter as the test application and Context.startActivity as the target method: this successfully finds three additional paths.

This depends on #1.

zhuowei added 2 commits March 14, 2018 18:08
ButterKnife, a popular UI library used by 4.38% of all apps tracked
by AppBrain, specifies UI listeners via method annotations. In particular,
the Kickstarter app (popular open-source test case) uses it for all listeners.

Since Dare doesn't preserve annotations, make an external utility
that uses dexlib2 to extract annotations into a .json. Currently
only ButterKnife.OnClick annotations are extracted.

Note that this is a temporary approach: ButterKnife doesn't use the
annotations at runtime, so some apps such as Microsoft Outlook strips the
view IDs during build, making the annotations useless. The proper way is
to parse the ViewBinder/ViewBinding classes generated by ButterKnife,
but that is more difficult.

Another issue: the annotation extractor uses a dexlib2 build from Java 8,
but the rest of IntelliDroid needs Java 7. Will rebuild dexlib2 later.

Tested with Kickstarter as the test application and startActivity as
the target method: this successfully finds additional paths.
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

Successfully merging this pull request may close these issues.

1 participant