@Nullable @Override public CharSequence getExceptionType(@Nonnull ExceptionHandler handler) { return handler.getExceptionType(); }
/** * Return the types that are used in this body. */ public Set<Type> usedTypes() { Set<Type> types = new HashSet<Type>(); for (DexlibAbstractInstruction i : instructions) { types.addAll(i.introducedTypes()); } if (tries != null) { for (TryBlock<? extends ExceptionHandler> tryItem : tries) { List<? extends ExceptionHandler> hList = tryItem.getExceptionHandlers(); for (ExceptionHandler handler : hList) { String exType = handler.getExceptionType(); if (exType == null) { // Exceptions continue; } types.add(DexType.toSoot(exType)); } } } return types; }
private String[] buildExceptions(Method method) { if (method.getImplementation() == null) { return null; } Set<String> exceptionTypes = new HashSet<>(); for (TryBlock<? extends ExceptionHandler> tryBlock : method.getImplementation() .getTryBlocks()) { for (ExceptionHandler handler : tryBlock.getExceptionHandlers()) { String type = handler.getExceptionType(); if (type == null) { // Type is null if it's a catchall continue; } exceptionTypes.add(stripName(type)); } } return exceptionTypes.toArray(new String[0]); }
if (null == handler.getExceptionType()) { return handler.getHandlerCodeAddress(); String handlerType = handler.getExceptionType(); if (className.equals(handlerType)) { return handler.getHandlerCodeAddress();
handler.getExceptionType(), startAddress, endAddress, handlerAddress); methodItems.add(catchMethodItem);
if ("Ljava/lang/Throwable;".equals(handler.getExceptionType())) { builder.addCatch(new ImmutableTypeReference(handler.getExceptionType()), labelAssigner.getLabelAtAddress(range.startAddress), labelAssigner.getLabelAtAddress(range.endAddress), labelAssigner.getLabelAtAddress(handler.getHandlerCodeAddress()));
private void analyzeMoveException(@Nonnull AnalyzedInstruction analyzedInstruction) { int instructionAddress = getInstructionAddress(analyzedInstruction); RegisterType exceptionType = RegisterType.UNKNOWN_TYPE; for (TryBlock<? extends ExceptionHandler> tryBlock: methodImpl.getTryBlocks()) { for (ExceptionHandler handler: tryBlock.getExceptionHandlers()) { if (handler.getHandlerCodeAddress() == instructionAddress) { String type = handler.getExceptionType(); if (type == null) { exceptionType = RegisterType.getRegisterType(RegisterType.REFERENCE, classPath.getClass("Ljava/lang/Throwable;")); } else { exceptionType = RegisterType.getRegisterType(RegisterType.REFERENCE, classPath.getClass(type)) .merge(exceptionType); } } } } if (exceptionType.category == RegisterType.UNKNOWN) { throw new AnalysisException("move-exception must be the first instruction in an exception handler block"); } setDestinationRegisterTypeAndPropagateChanges(analyzedInstruction, exceptionType); }
dexPool.typeSection.internNullable(handler.getExceptionType());
String exceptionType = handler.getExceptionType(); if (exceptionType == null) { exceptionType = "Ljava/lang/Throwable;";
if (ehLast.getExceptionType() == null) { ehSize = ehSize * (-1) + 1;
@Override public int compare(ExceptionHandler o1, ExceptionHandler o2) { String exceptionType1 = o1.getExceptionType(); if (exceptionType1 == null) { if (o2.getExceptionType() != null) { return 1; } return 0; } else { String exceptionType2 = o2.getExceptionType(); if (exceptionType2 == null) { return -1; } return exceptionType1.compareTo(o2.getExceptionType()); } } };
@Nullable @Override public CharSequence getExceptionType(@Nonnull ExceptionHandler handler) { return handler.getExceptionType(); }
@Override @Nullable public String getExceptionType() { return RewriterUtils.rewriteNullable(rewriters.getTypeRewriter(), exceptionHandler.getExceptionType()); }
@Override @Nullable public String getExceptionType() { return RewriterUtils.rewriteNullable(rewriters.getTypeRewriter(), exceptionHandler.getExceptionType()); }
@Override public boolean equals(@Nullable Object o) { if (o instanceof ExceptionHandler) { ExceptionHandler other = (ExceptionHandler)o; return Objects.equal(getExceptionType(), other.getExceptionType()) && (getHandlerCodeAddress() == other.getHandlerCodeAddress()); } return false; }
public static ImmutableExceptionHandler of(ExceptionHandler exceptionHandler) { if (exceptionHandler instanceof ImmutableExceptionHandler) { return (ImmutableExceptionHandler)exceptionHandler; } return new ImmutableExceptionHandler( exceptionHandler.getExceptionType(), exceptionHandler.getHandlerCodeAddress()); }
public static ImmutableExceptionHandler of(ExceptionHandler exceptionHandler) { if (exceptionHandler instanceof ImmutableExceptionHandler) { return (ImmutableExceptionHandler)exceptionHandler; } return new ImmutableExceptionHandler( exceptionHandler.getExceptionType(), exceptionHandler.getHandlerCodeAddress()); }
@Override public boolean equals(@Nullable Object o) { if (o instanceof ExceptionHandler) { ExceptionHandler other = (ExceptionHandler)o; return Objects.equal(getExceptionType(), other.getExceptionType()) && (getHandlerCodeAddress() == other.getHandlerCodeAddress()); } return false; }
public static ImmutableExceptionHandler of(ExceptionHandler exceptionHandler) { if (exceptionHandler instanceof ImmutableExceptionHandler) { return (ImmutableExceptionHandler)exceptionHandler; } return new ImmutableExceptionHandler( exceptionHandler.getExceptionType(), exceptionHandler.getHandlerCodeAddress()); }
@Override public boolean equals(@Nullable Object o) { if (o instanceof ExceptionHandler) { ExceptionHandler other = (ExceptionHandler)o; return Objects.equal(getExceptionType(), other.getExceptionType()) && (getHandlerCodeAddress() == other.getHandlerCodeAddress()); } return false; }