Example #1
0
def main():
    adb.start_server()#start adb server
    dst_dir = ''
    #destination defaults to cwd if no dst_dir was specified
    try:
        dst_dir = sys.argv[1]
        if not os.path.isdir(dst_dir):
            print 'Error, directory "{0}" does not exist'.format(dst_dir)
            sys.exit()
    except IndexError as e:
        print 'No destination dir specified, dumping to "{0}"'.format(os.getcwd())
        pass

    devices = adb.get_list_of_connected_devices()
    if len(devices) == 0:
        print "Error, no devices connected..exiting"
        sys.exit()

    if len(devices) > 1:
        print "Warning, multiple devices..choosing the first: {0}".format(devices[0])

    device_id = devices[0]#default to the first device found
    package_list = adb.list_all_packages(device_id)
    report_list = extract_all_apk(device_id, package_list, dst_dir)
    generate_report(report_list, dst_dir)
Example #2
0
def main():
    src_dir = sys.argv[1]
    if not os.path.isdir(src_dir):
        print 'Error, source directory "{0}" does not exist'.fomat(src_dir)
        sys.exit()

    dst_dir = ''
    #destination defaults to cwd if no dst_dir was specified
    try:
        dst_dir = sys.argv[2]
        if not os.path.isdir(dst_dir):
            print 'Error, destination directory "{0}" does not exist'.format(dst_dir)
            sys.exit()
    except IndexError as e:
        print 'No destination dir specified, dumping to "{0}"'.format(os.getcwd())
        pass

    adb.start_server()
    decompile_all_apk(src_dir, dst_dir)