MCPcopy Create free account
hub / github.com/bytedance/android-inline-hook / parse_line

Function parse_line

tools/record_parser.py:319–336  ·  view source on GitHub ↗
(line, item_flags)

Source from the content-addressed store, hash-verified

317
318
319def parse_line(line, item_flags):
320 i = len(ItemInfos)
321 op = ''
322 for item in line.split(","):
323 i -= 1
324 while i >= 0 and (item_flags[i] != '1' or (op_is_unop(op) and ItemInfos[i].op_only)): i -= 1
325 if i < 0:
326 raise ValueError(f"format error: {item_flags}")
327 elif i == ITEM_TRACE_IDX:
328 print(f"* {ItemInfos[i].tag}")
329 parse_trace(item)
330 elif i == ITEM_FLAGS_IDX:
331 print(f"* {ItemInfos[i].tag:<20} : {parse_flags(item, op)}")
332 elif i == ITEM_OP_IDX:
333 op = item
334 print(f"* {ItemInfos[i].tag:<20} : {item}")
335 else:
336 print(f"* {ItemInfos[i].tag:<20} : {'0x' if ItemInfos[i].hex else ''}{item}")
337
338
339def main():

Callers 1

mainFunction · 0.85

Calls 3

op_is_unopFunction · 0.85
parse_traceFunction · 0.85
parse_flagsFunction · 0.85

Tested by

no test coverage detected