def __enter__(self): self.db_wrapper, self.db_pool_manager = DbFactory.get_wrapper(args) args.apk_storage_interface = 'fs' (self.storage_manager, self.storage_elem) = get_storage_obj(args, self.db_wrapper) self.db_purge() return self.storage_elem
def setUp(self): self.storage_init() self.db_wrapper, self.db_pool_manager = DbFactory.get_wrapper(args) try: storage_type = self.storage_type except AttributeError: storage_type = 'fs' if storage_type == 'fs': args.apk_storage_interface = 'fs' else: args.apk_storage_interface = 'db' (self.storage_manager, self.storage_elem) = get_storage_obj(args, self.db_wrapper) self.db_purge() self.storage_elem.delete_file(APK_Type.rgc, APK_Arch.noarch)
def __enter__(self): self.db_wrapper, self.db_pool_manager = DbFactory.get_wrapper(args) args.apk_storage_interface = 'fs' (self.storage_manager, self.storage_elem) = get_storage_obj(args, self.db_wrapper) self.db_purge() self.pogo_versions = { APKArch.armeabi_v7a: None, APKArch.arm64_v8a: None, } # determine supported pogo versions with open('configs/version_codes.json', 'rb') as fh: data = json.load(fh) for version in list(data.keys()): version_info = version.rsplit('_') if version_info[-1] == '32': self.pogo_versions[APKArch.armeabi_v7a] = version_info[0] elif version_info[-1] == '64': self.pogo_versions[APKArch.arm64_v8a] = version_info[0] return self
mapping_manager_manager = MappingManagerManager() mapping_manager_manager.start() mapping_manager: MappingManager = mapping_manager_manager.MappingManager( db_wrapper, args, data_manager, configmode=args.config_mode) if args.only_routes: logger.info( 'Running in route recalculation mode. MAD will exit once complete') recalc_in_progress = True while recalc_in_progress: time.sleep(5) sql = "SELECT COUNT(*) > 0 FROM `settings_routecalc` WHERE `recalc_status` = 1" recalc_in_progress = db_wrapper.autofetch_value(sql) logger.info("Done calculating routes!") # TODO: shutdown managers properly... sys.exit(0) (storage_manager, storage_elem) = get_storage_obj(args, db_wrapper) if not args.config_mode: pogo_win_manager = PogoWindows(args.temp_path, args.ocr_thread_count) MitmMapperManager.register('MitmMapper', MitmMapper) mitm_mapper_manager = MitmMapperManager() mitm_mapper_manager.start() mitm_mapper = mitm_mapper_manager.MitmMapper(args, mapping_manager, db_wrapper.stats_submit) logger.info('Starting PogoDroid Receiver server on port {}'.format( str(args.mitmreceiver_port))) mitm_data_processor_manager = MitmDataProcessorManager( args, mitm_mapper, db_wrapper) mitm_data_processor_manager.launch_processors()