def app_details(self, serialno, appid): try: d = pd.read_sql('select * from apps where appid=?', self.app_info_conn, params=(appid, )) if not isinstance(d.get('permissions', ''), list): d['permissions'] = d.get('permissions', pd.Series([])) d['permissions'] = d['permissions'].fillna('').str.split(', ') if 'descriptionHTML' not in d: d['descriptionHTML'] = d['description'] dfname = self.dump_file_name(serialno) if self.device_type == 'ios': ddump = parse_dump.IosDump(dfname) else: ddump = parse_dump.AndroidDump(dfname) info = ddump.info(appid) if self.device_type == 'ios': d['permissions'] = [info['permissions']] d['title'] = [info['title']] #print(info['permissions']) del info['permissions'] print("AppInfo: ", info, appid, dfname, ddump) # p = self.run_command( # 'bash scripts/android_scan.sh info {ser} {appid}', # ser=serialno, appid=appid # ); p.wait() # d['info'] = p.stdout.read().decode().replace('\n', '<br/>') return d.fillna(''), info except KeyError as ex: print("Exception:::", ex) return pd.DataFrame([]), dict()
def app_details(self, serialno, appid): try: d = pd.read_sql('select * from apps where appid=?', self.app_info_conn, params=(appid, )) if not isinstance(d.get('permissions', ''), list): d['permissions'] = d.get('permissions', pd.Series([])) d['permissions'] = d['permissions'].fillna('').str.split(', ') if 'descriptionHTML' not in d: d['descriptionHTML'] = d['description'] dfname = self.dump_path(serialno) if self.device_type == 'ios': ddump = self.parse_dump if not ddump: ddump = parse_dump.IosDump(dfname) else: ddump = parse_dump.AndroidDump(dfname) info = ddump.info(appid) print('BEGIN APP INFO') print("info={}".format(info)) print('END APP INFO') # FIXME: sloppy iOS hack but should fix later, just add these to DF # directly. if self.device_type == 'ios': # TODO: add extra info about iOS? Like idevicediagnostics # ioregentry AppleARMPMUCharger or IOPMPowerSource or # AppleSmartBattery. d['permissions'] = pd.Series(info.get('permissions', '')) #d['permissions'] = [info.get('permissions','')] d['title'] = pd.Series(info.get('title', '')) del info['permissions'] print("AppInfo: ", info, appid, dfname, ddump) return d.fillna(''), info except KeyError as ex: print(">>> Exception:::", ex, file=sys.stderr) return pd.DataFrame([]), dict()