コード例 #1
0
ファイル: qark.py プロジェクト: zhouat/qark
        use_check_permission()
    except Exception as e:
        common.logger.error("Unable to run checks for improper use of checkCallingPermission: " + str(e))
    '''

    height = common.term.height

    try:
        clear_amount = (len(PROGRESS_BARS) - 1) * 2
        for plugin in manager.getAllPlugins():
            clear_amount += 2
        clear_lines(clear_amount)

        # TODO: change to list comprehension to make it more pythonic
        # all static writers included in every static analysis
        writers = [common.Writer((0, height-8)), common.Writer((0, height-6)), common.Writer((0, height-4)), 
                    common.Writer((0, height-2)), common.Writer((0, height-10)), common.Writer((0, height-12)), common.Writer((0, height-14))]
        pbars = {}
   
        # create dictionary for progress bars, pbars = { name: ProgressBar }
        for barNum in range(len(PROGRESS_BARS)-1):
            pbars[PROGRESS_BARS[barNum]] = ProgressBar(widgets=[PROGRESS_BARS[barNum], Percentage(), Bar()], maxval=100, fd=writers[barNum]).start()

        # create writer and progress bar for each plugin
        placer = 0
        for plugin in manager.getAllPlugins():
            writer = common.Writer((0, height-(16+placer)))
            writers.append(writer)
            if 'Plugin issues' not in pbars:
                pbars['Plugin issues'] = {}
コード例 #2
0
import shutil
import time
from subprocess import Popen, PIPE, STDOUT
from collections import defaultdict
from multiprocessing import Process
from threading import Thread, Lock

from lib.progressbar import *
from lib import blessings
from modules.common import logger
from modules import report
from modules import common
from lib.pubsub import pub

lock = Lock()
progresswriter1 = common.Writer((0, common.term.height - 10))
progressbar1 = ProgressBar(widgets=['JD CORE ',
                                    Percentage(),
                                    Bar()],
                           maxval=100,
                           fd=progresswriter1)
progresswriter2 = common.Writer((0, common.term.height - 8))
progressbar2 = ProgressBar(widgets=['Procyon ',
                                    Percentage(),
                                    Bar()],
                           maxval=100,
                           fd=progresswriter2)
progresswriter3 = common.Writer((0, common.term.height - 6))
progressbar3 = ProgressBar(widgets=['CFR ', Percentage(),
                                    Bar()],
                           maxval=100,
コード例 #3
0
ファイル: qark.py プロジェクト: ualwayswithme/qark
common.logger.info("Running Static Code Analysis...")
common.keyFiles=common.findKeys(common.sourceDirectory)

'''
#Look for improper use of checkCallingPermission, rather than enforceCallingPermission
try:
	useCheckPermission()
except Exception as e:
	common.logger.error("Unable to run checks for improper use of checkCallingPermission: " + str(e))
'''

clearlines(14)
height = common.term.height

try:
	writer1 = common.Writer((0, height-8))
	pbar1 = ProgressBar(widgets=['X.509 Validation ', Percentage(), Bar()], maxval=100, fd=writer1).start()
	writer2 = common.Writer((0, height-6))
	pbar2 = ProgressBar(widgets=['Pending Intents ', Percentage(), Bar()], maxval=100, fd=writer2).start()
	writer3 = common.Writer((0, height-4))
	pbar3 = ProgressBar(widgets=['File Permissions (check 1) ', Percentage(), Bar()], maxval=100, fd=writer3).start()
	writer4 = common.Writer((0, height-2))
	pbar4 = ProgressBar(widgets=['File Permissions (check 2) ', Percentage(), Bar()], maxval=100, fd=writer4).start()
	writer5 = common.Writer((0, height-10))
	pbar5 = ProgressBar(widgets=['Webview checks ', Percentage(), Bar()], maxval=100, fd=writer5).start()
	writer6 = common.Writer((0, height-12))
	pbar6 = ProgressBar(widgets=['Broadcast issues ', Percentage(), Bar()], maxval=100, fd=writer6).start()
	writer7 = common.Writer((0, height-14))
	pbar7 = ProgressBar(widgets=['Crypto issues ', Percentage(), Bar()], maxval=100, fd=writer7).start()

	pub.subscribe(progress_bar_update, 'progress')