def unpack_function(file_path, tmp_dir): ''' file_path specifies the input file. tmp_dir should be used to store the extracted files. ''' output = execute_shell_command( '(cd {} && fakeroot {} --extract {})'.format(tmp_dir, TOOL_PATH, file_path)) return {'output': output}
def unpack_function(file_path, tmp_dir): ''' file_path specifies the input file. local_tmp_dir should be used to store the extracted files. ''' output = execute_shell_command( 'fakeroot ubireader_extract_files -v --output-dir {} {}'.format( tmp_dir, file_path)) + '\n' meta_data = {'output': output} logging.debug(output) return meta_data
def _unpack_trx(file_path, target_dir): path_to_unpacker = path.join(get_faf_bin_dir(), 'untrx') return execute_shell_command('fakeroot {} {} {}'.format(path_to_unpacker, file_path, target_dir))
def _extract_kernel_image(file_path, tmp_dir): return execute_shell_command('{} {} {}/kernel_decompressed.img'.format(UNPACK_KERNEL_TOOL_PATH, file_path, tmp_dir))
def _extract_squashfs(file_path, tmp_dir): return execute_shell_command('cd {} && {} {}'.format(tmp_dir, FIND_SQUASHFS_TOOL_PATH, file_path))
def _unpack_trx(file_path, target_dir): return execute_shell_command('fakeroot {} {} {}'.format( UNPACKER_EXECUTEABLE, file_path, target_dir))