Created
August 27, 2021 15:50
-
-
Save nfalliere/94351c2cf59d4a595990afe14fec75bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#?description= | |
#?shortcut= | |
from com.pnfsoftware.jeb.client.api import IScript | |
from com.pnfsoftware.jeb.core.units.code.android import IDexUnit | |
from com.pnfsoftware.jeb.core.actions import Actions, ActionContext, ActionOverridesData | |
class PrintDexOverrides(IScript): | |
def run(self, ctx): | |
prj = ctx.getMainProject() | |
# method 1: retrieving the selected method graphically: set the caret on a method item | |
unit = ctx.getFocusedUnit() | |
assert isinstance(unit, IDexUnit) | |
current_item = ctx.getFocusedItem() | |
item_id = current_item.getItemId() | |
# method 2: retrieving a method item programmatically via its signature | |
#unit = prj.findUnit(IDexUnit) | |
#cl = unit.getMethod('Lcom/foo/Bar;->func1(I)V') | |
#item_id = cl.getItemId() | |
data = ActionOverridesData() | |
if unit.prepareExecution(ActionContext(unit, Actions.QUERY_OVERRIDES, item_id, None), data): | |
print('Overrides (method signatures): %s' % data.getAddresses()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment