def run(self): apk_list = [] apk_list.append(utils.get_demo_apk_path('AntiEmulator.apk')) apk_list.append(utils.get_demo_apk_path('FakeFacebook.apk')) for apk_file in apk_list: if not os.path.exists(apk_file): self.log.info('"%s not exists!' % apk_file) return # Start emulator self.emu_client = EmulatorClient(self.emu_port, self.emu_name) self.emu_client.start_emulator() # Root emulator self.emu_client.root_emulator() # Repackage decompiled_dir = utils.get_decompiled_dir() if not os.path.exists(decompiled_dir): os.makedirs(decompiled_dir) repackage_dir = utils.get_repackage_dir() if not os.path.exists(repackage_dir): os.makedirs(repackage_dir) for apk_file in apk_list: apk_file_name = os.path.basename(apk_file) decompiled_dir = os.path.join(decompiled_dir, apk_file_name) repackage_path = os.path.join(repackage_dir, apk_file_name) repackage = Repackage(decompiled_dir, repackage_path, apk_file) self.log.info('Decompile %s...' % apk_file) repackage.decompile(NO_RES) self.log.info('Modifying Smali...') self.__scan_build_prop(decompiled_dir) self.log.info('Repackaging and singing...' ) repackage.do_repackage() if not os.path.exists(repackage_path): self.log.info('%s not exists' % repackage_path) continue self.emu_client.install_app(repackage_path) # Install EmulatorAntiDetect.apk demo_apk_path = utils.get_demo_apk_path('EmulatorAntiDetect.apk') if not os.path.exists(demo_apk_path): self.log.info('%s not exists!' % demo_apk_path) return self.emu_client.install_app(demo_apk_path)
def run(self): self.apk_file = utils.get_demo_apk_path('SlideMe.apk') if not os.path.exists(self.apk_file): self.log.info('"%s not exists!' % self.apk_file) return # Start emulator self.emu_client = EmulatorClient(self.emu_port, self.emu_name) self.emu_client.start_emulator() # Repackage if self.launcher_type == TYPE_REPACAKGE: decompiled_dir = utils.get_decompiled_dir() if not os.path.exists(decompiled_dir): os.makedirs(decompiled_dir) repackage_dir = utils.get_repackage_dir() if not os.path.exists(repackage_dir): os.makedirs(repackage_dir) apk_file_name = os.path.basename(self.apk_file) decompiled_dir = os.path.join(decompiled_dir, apk_file_name) repackage_path = os.path.join(repackage_dir, apk_file_name) repackage = Repackage(decompiled_dir, repackage_path, self.apk_file) self.log.info('Decompile %s...' % self.apk_file) repackage.decompile(NO_SRC) self.log.info('Modifying AndroidManifest...') self.__modify_manifest(decompiled_dir) self.log.info('Repackaging and singing...' ) repackage.do_repackage() if not os.path.exists(repackage_path): self.log.info('%s not exists' % repackage_path) return self.emu_client.install_app(repackage_path) elif self.launcher_type == TYPE_HOOK: # Root emulator self.emu_client.root_emulator() # Install demo apks component_proxy_apk = utils.get_demo_apk_path('ComponentProxy.apk') if not os.path.exists(component_proxy_apk): self.log.info('%s not exists' % component_proxy_apk) return self.emu_client.install_app(component_proxy_apk) self.emu_client.install_app(self.apk_file)