本文整理了Java中org.jf.dexlib2.iface.ExceptionHandler
类的一些代码示例,展示了ExceptionHandler
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExceptionHandler
类的具体详情如下:
包路径:org.jf.dexlib2.iface.ExceptionHandler
类名称:ExceptionHandler
[英]This class represents an individual exception handler entry, in a try block.
[中]此类表示try块中的单个异常处理程序条目。
代码示例来源:origin: CalebFenton/simplify
if (null == handler.getExceptionType()) {
return handler.getHandlerCodeAddress();
String handlerType = handler.getExceptionType();
if (className.equals(handlerType)) {
return handler.getHandlerCodeAddress();
代码示例来源:origin: Tencent/tinker
(TypeReference) convertReference(exceptionHandler.getExceptionTypeReference()),
newLabel(codeAddressToIndex, exceptionHandler.getHandlerCodeAddress())));
代码示例来源:origin: JesusFreke/smali
@Nullable @Override public CharSequence getExceptionType(@Nonnull ExceptionHandler handler) {
return handler.getExceptionType();
}
代码示例来源:origin: JesusFreke/smali
@Nonnull
private AnalyzedInstruction[] buildExceptionHandlerArray(@Nonnull TryBlock<? extends ExceptionHandler> tryBlock) {
List<? extends ExceptionHandler> exceptionHandlers = tryBlock.getExceptionHandlers();
AnalyzedInstruction[] handlerInstructions = new AnalyzedInstruction[exceptionHandlers.size()];
for (int i=0; i<exceptionHandlers.size(); i++) {
handlerInstructions[i] = analyzedInstructions.get(exceptionHandlers.get(i).getHandlerCodeAddress());
}
return handlerInstructions;
}
代码示例来源:origin: KB5201314/ZjDroid
@Nullable @Override public BuilderTypeReference getExceptionType(@Nonnull ExceptionHandler handler) {
return checkTypeReference(handler.getExceptionTypeReference());
}
代码示例来源:origin: Sable/soot
/**
* 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;
}
代码示例来源:origin: testwhat/SmaliEx
@Override public int getHandlerCodeAddress() {
return exceptionHandler.getHandlerCodeAddress();
}
}
代码示例来源:origin: org.smali/dexlib2
@Nullable @Override public BuilderTypeReference getExceptionType(@Nonnull ExceptionHandler handler) {
return checkTypeReference(handler.getExceptionTypeReference());
}
代码示例来源:origin: JesusFreke/smali
int handlerAddress = handler.getHandlerCodeAddress();
if (handlerAddress >= codeSize) {
throw new ExceptionWithContext(
handler.getExceptionType(), startAddress, endAddress, handlerAddress);
methodItems.add(catchMethodItem);
代码示例来源:origin: KB5201314/ZjDroid
exceptionHandler.getExceptionTypeReference(),
newLabel(codeAddressToIndex, exceptionHandler.getHandlerCodeAddress())));
代码示例来源:origin: CalebFenton/simplify
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]);
}
代码示例来源:origin: KB5201314/ZjDroid
@Override public int getHandlerCodeAddress() {
return exceptionHandler.getHandlerCodeAddress();
}
}
代码示例来源:origin: testwhat/SmaliEx
@Nullable @Override public BuilderTypeReference getExceptionType(@Nonnull ExceptionHandler handler) {
return checkTypeReference(handler.getExceptionTypeReference());
}
代码示例来源:origin: JesusFreke/smali
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);
}
代码示例来源:origin: testwhat/SmaliEx
exceptionHandler.getExceptionTypeReference(),
newLabel(codeAddressToIndex, exceptionHandler.getHandlerCodeAddress())));
代码示例来源:origin: JesusFreke/smali
dexPool.typeSection.internNullable(handler.getExceptionType());
代码示例来源:origin: org.smali/dexlib2
@Override public int getHandlerCodeAddress() {
return exceptionHandler.getHandlerCodeAddress();
}
}
代码示例来源:origin: Sable/soot
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()));
代码示例来源:origin: com.tencent.tinker/tinker-patch-lib
(TypeReference) convertReference(exceptionHandler.getExceptionTypeReference()),
newLabel(codeAddressToIndex, exceptionHandler.getHandlerCodeAddress())));
代码示例来源:origin: testwhat/SmaliEx
@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());
}
}
};
内容来源于网络,如有侵权,请联系作者删除!