Пример #1
0
 def run(self):
     if monitor_type != TYPE_SOURCE_MODIFICATION and monitor_type != TYPE_HOOK:
         self.log.info("Only 1 or 2 is allowed to set on argument '-m' ")
         return
     
     system_img_path = None
     if self.monitor_type == TYPE_SOURCE_MODIFICATION:
         system_img_path = utils.get_system_img_path()
         if not os.path.exists(system_img_path):
             system_img_path = None
     
     self.emu_client = EmulatorClient(self.emu_port, self.emu_name, system_img_path)
     self.emu_client.start_emulator()
     
     #Install demo apk
     smcc_apk = utils.get_demo_apk_path('Smcc.apk')
     if os.path.exists(smcc_apk):
         self.log.info('Install Smcc.apk...')
         self.emu_client.install_app(smcc_apk)
     else:
         self.log.info('%s not exists' % smcc_apk)
             
     if self.monitor_type == TYPE_HOOK:
         # Root
         self.emu_client.root_emulator()
             
         # Install demo apks
         sandbox_apk = utils.get_demo_apk_path('SandBox.apk')
         if os.path.exists(sandbox_apk):
             self.log.info('Install SandBox.apk ...')
             self.emu_client.install_app(sandbox_apk)
         else:
             self.log.info('%s not exists' % sandbox_apk)
Пример #2
0
 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)
Пример #3
0
 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)