get all buttons in app page



I build a project in java, which suppose get smali code for page in the app, and return all the buttons in the layout of this page.


First, I implemented a parser for the appropriate xml file. The parser search all the buttons in the page. It works properly.


However, I have a problem because I noticed that the smali code can add dynamically buttons to the layout of the page. I thought to implement parser for the smali file but I think doesn't make a sense to do that.


I have a 2 ideas but I donwt know if they can be applied: 1) to run on the method onCreate, and add views to the xml file at the same time. After that, I have the full views in the page layout. 2) use UI hierarchy, which return hierarchy of the views in the page. But I don't know how use it programmatically and get it comfortably.


thanks, Yinon.


No comments:

Post a Comment