use of jadx.api.plugins.input.data.impl.TryData in project jadx by skylot.
the class DexCodeReader method getTries.
@Override
public List<ITry> getTries() {
int triesOffset = getTriesOffset();
if (triesOffset == -1) {
return Collections.emptyList();
}
int triesCount = getTriesCount();
Map<Integer, ICatch> catchHandlers = getCatchHandlers(triesOffset + 8 * triesCount, in.copy());
in.pos(triesOffset);
List<ITry> triesList = new ArrayList<>(triesCount);
for (int i = 0; i < triesCount; i++) {
int startAddr = in.readInt();
int insnsCount = in.readUShort();
int handlerOff = in.readUShort();
ICatch catchHandler = catchHandlers.get(handlerOff);
if (catchHandler == null) {
throw new DexException("Catch handler not found by byte offset: " + handlerOff);
}
triesList.add(new TryData(startAddr, startAddr + insnsCount - 1, catchHandler));
}
return triesList;
}
Aggregations