package ru.andrew.jclazz.decompiler.engine.ops;
import ru.andrew.jclazz.core.*;
import ru.andrew.jclazz.core.code.ops.*;
import ru.andrew.jclazz.core.attributes.*;
import ru.andrew.jclazz.decompiler.engine.blocks.*;
import ru.andrew.jclazz.decompiler.*;
import java.util.*;
import ru.andrew.jclazz.decompiler.engine.CodeItem;
import ru.andrew.jclazz.decompiler.engine.LocalVariable;
public class InvokeView extends OperationView
{
private String objectref;
private Vector pushedParams;
private boolean isConstructor = false;
private boolean isAnonymousConstructor = false;
private InnerClass anonymousClass;
private String anonymousIndent;
// Inner Class support
private boolean isICField = false;
private String icFieldName;
private int paramsAddition = 0;
private boolean isICMethod = false;
private String icMethodName;
public CodeItem newInstance(Operation operation, MethodSourceView methodView)
{
super.newInstance(operation, methodView);
pushedParams = new Vector();
if (getOpcode() == 184) // invokestatic
{
objectref = ((Invoke) operation).getClassForStaticInvoke();
// Inner Class support
if (methodView.getClazzView().isInnerClass() && ((Invoke) operation).getMethodName().startsWith("access$"))
{
MethodSourceView m_ic = methodView.getClazzView().getOuterClazz().getSyntheticMethodForIC(((Invoke) operation).getMethodName());
if (m_ic != null && m_ic.getMethodNameForIC() != null)
{
icMethodName = m_ic.getMethodNameForIC();
isICMethod = true;
}
else if (objectref.equals(methodView.getClazzView().getOuterClazz().getClazz().getThisClassInfo().getFullyQualifiedName()))
{
if (m_ic != null && m_ic.isForIC())
{
icFieldName = m_ic.getFieldNameForIC();
isICField = true;
}
}
}
}
return this;
}
public String source()
{
/*
if (isICField) return icFieldName;
// if (ref != null)
// {
// return ref.getOperation();
// }
//
StringBuffer sb = new StringBuffer();
boolean isInit = false;
if ("<init>".equals(((Invoke) operation).getMethodName()))
{
isInit = true;
}
String anonymousClassAsString = "";
if (isConstructor)
{
// Anonymous Class support ^
if (isAnonymousConstructor)
{
String inname = anonymousClass.getInnerClass().getName();
String enclosingClassFileName = methodView.getClazz().getFileName();
String path = enclosingClassFileName.substring(0, enclosingClassFileName.lastIndexOf(System.getProperty("file.separator")) + 1);
Clazz innerClazz;
try
{
innerClazz = new Clazz(path + inname + ".class");
}
catch (Exception e)
{
throw new RuntimeException(e);
}
AnonymousClazzSourceView csv = new AnonymousClazzSourceView(innerClazz, methodView.getClazzView());
csv.setPrintAsAnonymous(true);
//csv.setIndent(anonymousIndent);
csv.setIndent(" ");
InnerClassView icv = methodView.getClazzView().getInnerClassView(innerClazz.getThisClassInfo().getFullyQualifiedName());
icv.setClazzView(csv);
anonymousClassAsString = csv.getSource();
objectref = alias(csv.getAnonymousSuperClassFQN());
}
// Anonymous Class support v
sb.append("new ").append(objectref);
}
else
{
if (((Invoke) operation).isSuperMethodInvoke())
{
if (isInit)
{
// Do not print invokation of default constructor
if (((Invoke) operation).getMethodDescriptor().getParams().size() > 0)
{
sb.append("super");
}
else
{
return null;
}
}
else
{
sb.append("super.").append(((Invoke) operation).getMethodName());
}
}
else
{
if (isInit)
{
sb.append("this");
}
else
{
if (!("this".equals(objectref) && ClazzSourceView.SUPPRESS_EXCESSED_THIS))
{
if (getOpcode() == 184)
{
if (!isICMethod)
{
sb.append(alias(objectref)).append(".");
}
}
else
{
sb.append(objectref).append(".");
}
}
// Inner class support method invokation
if (isICMethod)
{
sb.append(icMethodName);
}
else
{
sb.append(((Invoke) operation).getMethodName());
}
}
}
}
sb.append("(");
if (((Invoke) operation).getMethodDescriptor().getParams().size() > 0)
{
if ((pushedParams == null) || (pushedParams.size() + paramsAddition != ((Invoke) operation).getMethodDescriptor().getParams().size()))
{
throw new OperationException("Invoke: invalid parameters");
}
boolean firstParam = true;
for (int i = pushedParams.size() - 1; i >= 0; i--)
{
// Inner class method invokation support
if (i == pushedParams.size() - 1 && isICMethod) continue;
if (!firstParam)
{
sb.append(", ");
}
OperationView pushOp = (OperationView) pushedParams.get(i);
FieldDescriptor argDescriptor = (FieldDescriptor) ((Invoke) operation).getMethodDescriptor().getParams().get(pushedParams.size() + paramsAddition - i - 1);
if ("boolean".equals(argDescriptor.getBaseType()))
{
if ("1".equals(pushOp.source()))
{
sb.append("true");
}
else
{
sb.append("false");
}
}
else
{
// Narrowing Primitive Conversions
if (argDescriptor.isBaseType())
{
if (Block.widePrimitiveConversion(argDescriptor.getBaseType(), pushOp.getPushType()))
{
sb.append("(").append(argDescriptor.getBaseType()).append(") ");
}
}
sb.append(pushOp.source());
}
firstParam = false;
}
}
sb.append(")");
if (isAnonymousConstructor)
{
sb.append(anonymousClassAsString);
}
return sb.toString()
没有合适的资源?快使用搜索试试~ 我知道了~
jClazzME_src.zip_Jclazzme_class反编译器_jclazz
共195个文件
java:186个
xml:4个
properties:3个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 171 浏览量
2022-09-22
19:05:48
上传
评论
收藏 221KB ZIP 举报
温馨提示
手机端Class反编译器源码,俄国人开发的
资源推荐
资源详情
资源评论
收起资源包目录
jClazzME_src.zip_Jclazzme_class反编译器_jclazz (195个子文件)
jClazzME.jad 285B
InvokeView.java 22KB
Opcode.java 18KB
Block.java 18KB
MethodSourceView.java 13KB
SignatureView.java 13KB
ClazzSourceView.java 12KB
Clazz.java 10KB
ClazzTreeUI.java 8KB
GetFieldView.java 8KB
ReturnView.java 8KB
ClazzPrinter.java 8KB
PutFieldView.java 7KB
IfDetector.java 7KB
Loop.java 7KB
Condition.java 7KB
TryDetector.java 7KB
ImportManager.java 6KB
ElementValuePair.java 6KB
PopView.java 6KB
MethodInfo.java 6KB
ByteCodeConverter.java 6KB
IfBlock.java 6KB
Code.java 6KB
Try.java 6KB
FieldInfo.java 5KB
PushConst.java 5KB
AttributesLoader.java 5KB
Switch.java 5KB
Catch.java 5KB
OperationView.java 5KB
OperationFactory.java 4KB
CONSTANT_Class.java 4KB
Dup2View.java 4KB
EnumSourceView.java 4KB
DecompileForm.java 4KB
LoopDetector.java 4KB
InnerClasses.java 4KB
LocalVariableTable.java 3KB
LocalVariable.java 3KB
SourceView.java 3KB
ConstantPoolItemLoader.java 3KB
Else.java 3KB
MethodSignature.java 3KB
Invoke.java 3KB
UnconditionalBackLoopDetector.java 3KB
FieldDescriptor.java 3KB
LocalVariableTypeTable.java 3KB
MainForm.java 3KB
BackLoopDetector.java 3KB
NewArrayView.java 3KB
AnonymousClazzSourceView.java 3KB
SwitchDetector.java 2KB
MonitorEnterView.java 2KB
RuntimeVisibleParameterAnnotations.java 2KB
MultiNewArrayView.java 2KB
NewArray.java 2KB
Annotation.java 2KB
FullFrame.java 2KB
FieldSourceView.java 2KB
NewView.java 2KB
CONSTANT_String.java 2KB
VerificationTypeInfo.java 2KB
LineNumberTable.java 2KB
DupView.java 2KB
AnonymousInitMethodView.java 2KB
PushVariableView.java 2KB
ClassDecompiler.java 2KB
ClassTypeSignature.java 2KB
StackMapFrame.java 2KB
BitArithmetic.java 2KB
Rms.java 2KB
ClazzTreeNode.java 2KB
ArithmeticView.java 2KB
EnclosingMethod.java 2KB
SimpleClassTypeSignature.java 2KB
Operation.java 2KB
TypeSignature.java 2KB
GoToView.java 2KB
ClazzInputStream.java 2KB
CheckCastView.java 2KB
EnumInitMethodSourceView.java 2KB
RuntimeVisibleAnnotations.java 2KB
FormalTypeParameter.java 2KB
CONSTANT_Ref.java 2KB
FieldTypeSignature.java 2KB
Dup2.java 2KB
Wide.java 2KB
Exceptions.java 2KB
MethodDescriptor.java 2KB
ClassSignature.java 2KB
Arithmetic.java 2KB
StackMapTable.java 2KB
ArrayPushView.java 2KB
AppendFrame.java 2KB
CaseBlock.java 2KB
CONSTANT_NameAndType.java 2KB
PutField.java 1KB
ConstantValue.java 1KB
GetField.java 1KB
共 195 条
- 1
- 2
资源评论
周楷雯
- 粉丝: 78
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于MFC的校园导航程序(使用最短路径dijkstra算法).rar
- Android Studio android APP 视频作为视图背景需要源代码或想了解其实现原理的可以私心我
- com.ZeroneGames.GreenProject.apk
- Python自动化开发入门教程
- 4399GameSem_116_13955_207551_6.apk
- python 3.9.19源码编译包
- php-8.2.18-Win32-vs16-x64.rar
- 字节跳动青训营-抖音项目
- SQL资料手册,语句教程,高级查询语句语法
- 上位机和串口建立 Modbus 协议进行数据传输,并使用 Mysql 数据库存储,能够实现实时温湿度显示和动态变化曲线,历史数据
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功