MCPcopy Create free account
hub / github.com/FeJQ/AUPK / loadAllMethodsWithClass

Method loadAllMethodsWithClass

frameworks/base/core/java/android/app/Aupk.java:145–180  ·  view source on GitHub ↗

获取指定类里所有的方法 返回类的方法数量

(Class klass,ClassInfo classInfo)

Source from the content-addressed store, hash-verified

143 * 返回类的方法数量
144 */
145 public static int loadAllMethodsWithClass(Class klass,ClassInfo classInfo)
146 {
147 //Log.i("AUPK", "ActivityThread:loadAllMethods from class:" + className);
148 int count=0;
149 try
150 {
151 if (klass == null)
152 {
153 return 0;
154 }
155
156 // 获取目标类的所有构造函数
157 Constructor constructors[] = klass.getDeclaredConstructors();
158 for (Object constructor : constructors)
159 {
160
161 String methodName=klass.getName()+constructor.toString();
162 classInfo.methodMap.put(methodName,constructor);
163 count++;
164 }
165
166 // 获取目标类的所有成员函数
167 Method[] methods = klass.getDeclaredMethods();
168 for (Method method : methods)
169 {
170 String methodName=klass.getName()+method.toString();
171 classInfo.methodMap.put(methodName,method);
172 count++;
173 }
174 }
175 catch (Error | Exception e)
176 {
177 e.printStackTrace();
178 }
179 return count;
180 }
181
182
183

Callers 1

aupkThreadClassesMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected