當前位置: 首頁>>代碼示例>>Python>>正文


Python RuntimeProjectUtil.filterUnits方法代碼示例

本文整理匯總了Python中com.pnfsoftware.jeb.core.RuntimeProjectUtil.filterUnits方法的典型用法代碼示例。如果您正苦於以下問題:Python RuntimeProjectUtil.filterUnits方法的具體用法?Python RuntimeProjectUtil.filterUnits怎麽用?Python RuntimeProjectUtil.filterUnits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.pnfsoftware.jeb.core.RuntimeProjectUtil的用法示例。


在下文中一共展示了RuntimeProjectUtil.filterUnits方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run

# 需要導入模塊: from com.pnfsoftware.jeb.core import RuntimeProjectUtil [as 別名]
# 或者: from com.pnfsoftware.jeb.core.RuntimeProjectUtil import filterUnits [as 別名]
  def run(self, ctx):
    if not isinstance(ctx, IGraphicalClientContext):
      print('This script must be run within a graphical client')
      return

    # show which unit view is currently focused
    v = ctx.getFocusedView()  # needs 2.1.4
    print('Focused view: %s' % v)

    # enumerate all unit views (views representing units) and fragments within those views
    print('Views and fragments:')
    views = ctx.getViews()
    for view in views:
      print('- %s' % view.getLabel())
      fragments = view.getFragments()
      for fragment in fragments:
        print('  - %s' % view.getFragmentLabel(fragment))

    # focus test
    if len(views) >= 2:
      print('Focusing the second Unit view (if any)')
      views[1].setFocus()

    # opening the first certificate unit we find (in an APK, there should be one)
    engctx = ctx.getEnginesContext()
    projects = engctx.getProjects()
    unitFilter = UnitFilter('cert')
    units = RuntimeProjectUtil.filterUnits(projects[0], unitFilter)
    if units:
      ctx.openView(units.get(0))
開發者ID:MindMac,項目名稱:jeb2-samplecode,代碼行數:32,代碼來源:JEB2UIDemo.py

示例2: jumpToTargetFile

# 需要導入模塊: from com.pnfsoftware.jeb.core import RuntimeProjectUtil [as 別名]
# 或者: from com.pnfsoftware.jeb.core.RuntimeProjectUtil import filterUnits [as 別名]
 def jumpToTargetFile(self, prj, ctx):
   unitFilter = UnitFilterByName(self.name + '.xml')
   unit = RuntimeProjectUtil.filterUnits(prj, unitFilter).get(0)
   if unit:
     ctx.openView(unit)
     return
   print("*** Cannot find target file ***")
開發者ID:pnfsoftware,項目名稱:jeb2-samplecode,代碼行數:9,代碼來源:DexJumpToResource.py


注:本文中的com.pnfsoftware.jeb.core.RuntimeProjectUtil.filterUnits方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。