()
| 473 | } |
| 474 | |
| 475 | private Code readCode() { |
| 476 | int registersSize = readUnsignedShort(); |
| 477 | int insSize = readUnsignedShort(); |
| 478 | int outsSize = readUnsignedShort(); |
| 479 | int triesSize = readUnsignedShort(); |
| 480 | int debugInfoOffset = readInt(); |
| 481 | int instructionsSize = readInt(); |
| 482 | short[] instructions = readShortArray(instructionsSize); |
| 483 | Try[] tries; |
| 484 | CatchHandler[] catchHandlers; |
| 485 | if (triesSize > 0) { |
| 486 | if (instructions.length % 2 == 1) { |
| 487 | readShort(); // padding |
| 488 | } |
| 489 | |
| 490 | /* |
| 491 | * We can't read the tries until we've read the catch handlers. |
| 492 | * Unfortunately they're in the opposite order in the dex file |
| 493 | * so we need to read them out-of-order. |
| 494 | */ |
| 495 | Section triesSection = open(data.position()); |
| 496 | skip(triesSize * SizeOf.TRY_ITEM); |
| 497 | catchHandlers = readCatchHandlers(); |
| 498 | tries = triesSection.readTries(triesSize, catchHandlers); |
| 499 | } else { |
| 500 | tries = new Try[0]; |
| 501 | catchHandlers = new CatchHandler[0]; |
| 502 | } |
| 503 | return new Code(registersSize, insSize, outsSize, debugInfoOffset, instructions, |
| 504 | tries, catchHandlers); |
| 505 | } |
| 506 | |
| 507 | private CatchHandler[] readCatchHandlers() { |
| 508 | int baseOffset = data.position(); |
nothing calls this directly
no test coverage detected