MCPcopy
hub / github.com/mitmproxy/mitmproxy / ASCommandResponse

Class ASCommandResponse

mitmproxy/contrib/wbxml/ASCommandResponse.py:33–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31import logging
32
33class ASCommandResponse:
34
35 def __init__(self, response):
36 self.wbxmlBody = response
37 try:
38 if ( len(response) > 0):
39 self.xmlString = self.decodeWBXML(self.wbxmlBody)
40 else:
41 raise ValueError("Empty WBXML body passed")
42 except Exception as e:
43 self.xmlString = None
44 raise ValueError("Error: {0}".format(e))
45
46 def getWBXMLBytes(self):
47 return self.wbxmlBytes
48
49 def getXMLString(self):
50 return self.xmlString
51
52 def decodeWBXML(self, body):
53 self.instance = ASWBXML()
54 self.instance.loadBytes(body)
55 return self.instance.getXml()
56
57if __name__ == "__main__":
58 import os

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…