SAT_HOME = os.environ.get('SAT_HOME') parser = argparse.ArgumentParser(description='sat-panic-fetch fetch crash data from system') parser.add_argument('tracename', nargs='?', default=False, help='Panic trace matching trace filename') parser.add_argument('-p', '--panic', action='store', help='Panic tracing mode: 1=Normal, 2=Hooked(default)', required=False, default=2) args = parser.parse_args() def CrashlogKey(s): return int(s[8:]) print "... beginning" print "set adb to rootmode" print adb.set_adb_root(1) adb.wait_for_device() root = adb.shell_command("id") #print root path = os.getcwd() name = args.tracename if not (name and os.path.exists(path + '/' + name)): name = raw_input("Enter <<trace name>> to to fetch panic trace? :") if name: # Save the Traces path = path + '/' + name if not os.path.exists(path): print "Pre-trace info was not found from " + path sys.exit()
error,devices = adb.get_devices() if len(devices) == 0: print "[+] No devices detected!" print "Waiting for devices..." adb.wait_for_device() continue elif error is 2: print "You haven't enought permissions!" exit(-3) print "OK" dev = 1 # adb need run as root adb.set_adb_root() adb.wait_for_device() # built log and xlsx file name with datetime current_time = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S") speed_file = 'lmdd_perf_' + current_time + '.log' xlsx_file = 'lmdd_perf_' + current_time + '.xlsx' # built SPEED Tester. test_times = options.times test_target = options.target if test_target not in target_list: print 'PLEASE INPUT TARGET PATH!' print '--- Target: data or sdcard or sdcard1 ---' print '--- Target: data or sdcard or sdcard1 ---'