ScriptFuncObj.java
5.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa;
import com.adobe.xfa.Arg;
import com.adobe.xfa.DependencyTracker;
import com.adobe.xfa.Obj;
import com.adobe.xfa.ut.ExFull;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public final class ScriptFuncObj {
private final Class<?> mClass;
private final String msName;
private final int meRetType;
private final int[] meParamTypes;
private final int mnMinParam;
private final int mnXFAVersion;
private final int mnAvailability;
private final int mnVersionDep;
private final Method mMethod;
private final boolean mbHasMethodDep;
private final Method mPermsMethod;
public ScriptFuncObj(Class<?> clazz, String name, String sFunc, int eRetType, int[] paramTypes, int minParams, int nVersion, int nAvailability, int nVersionDep) {
this(clazz, name, sFunc, eRetType, paramTypes, minParams, nVersion, nAvailability, null, nVersionDep);
}
public ScriptFuncObj(Class<?> clazz, String sName, String sFunc, int eRetType, int[] paramTypes, int minParams, int nVersion, int nAvailability, String sPermsMethod, int nVersionDep) {
Method m;
block14 : {
boolean bHasMethodDep;
block13 : {
assert (clazz != null);
assert (sName != null);
assert (sFunc != null);
assert (paramTypes != null);
this.mClass = clazz;
this.msName = sName;
this.meRetType = eRetType;
this.meParamTypes = paramTypes;
this.mnMinParam = minParams;
this.mnXFAVersion = nVersion;
this.mnAvailability = nAvailability;
this.mnVersionDep = nVersionDep;
bHasMethodDep = false;
m = null;
try {
m = this.mClass.getMethod(sFunc, Obj.class, Arg.class, Arg[].class);
}
catch (NoSuchMethodException ex) {
// empty catch block
}
if (m == null) {
try {
m = this.mClass.getMethod(sFunc, Obj.class, Arg.class, Arg[].class, DependencyTracker.class);
bHasMethodDep = true;
}
catch (NoSuchMethodException ex) {
if ($assertionsDisabled) break block13;
throw new AssertionError();
}
}
}
this.mMethod = m;
this.mbHasMethodDep = bHasMethodDep;
m = null;
if (sPermsMethod != null) {
try {
m = this.mClass.getMethod(sPermsMethod, Obj.class, Arg[].class);
assert (m.getReturnType() == Boolean.TYPE);
}
catch (NoSuchMethodException ex) {
if ($assertionsDisabled) break block14;
throw new AssertionError();
}
}
}
this.mPermsMethod = m;
}
public boolean invoke(Obj scriptThis, Arg retVal, Arg[] parms, DependencyTracker dependencyTracker) {
boolean bError = false;
try {
if (this.hasDependencyTracker()) {
this.mMethod.invoke(scriptThis, scriptThis, retVal, parms, dependencyTracker);
} else {
this.mMethod.invoke(scriptThis, scriptThis, retVal, parms);
}
}
catch (IllegalAccessException e3) {
bError = true;
}
catch (InvocationTargetException e2) {
Throwable t = e2.getCause();
if (t instanceof ExFull) {
((ExFull)t).resolve();
throw (ExFull)t;
}
bError = true;
}
return bError;
}
public boolean invokePermsFunc(Obj scriptThis, Arg[] parms) {
boolean bAllow;
block5 : {
if (this.mPermsMethod == null) {
return true;
}
bAllow = false;
try {
Boolean bResult = (Boolean)this.mPermsMethod.invoke(null, scriptThis, parms);
bAllow = bResult;
}
catch (IllegalAccessException ex) {
assert (false);
}
catch (InvocationTargetException ex) {
if ($assertionsDisabled) break block5;
throw new AssertionError();
}
}
return bAllow;
}
public int getMinParam() {
return this.mnMinParam;
}
public int[] getParamTypes() {
return this.meParamTypes;
}
public String getName() {
return this.msName;
}
public int getXFAVersion() {
return this.mnXFAVersion;
}
public int getAvailability() {
return this.mnAvailability;
}
public int getVersionDeprecated() {
return this.mnVersionDep;
}
public int getRetType() {
return this.meRetType;
}
public boolean hasDependencyTracker() {
return this.mbHasMethodDep;
}
}