Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolved a blunder in APK frontend #1124

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,10 @@ public JavaSootMethod makeSootMethod(
final Method method, List<BodyInterceptor> bodyInterceptors, @Nonnull View view) {
int modifierFlags = method.getAccessFlags();
if (Modifier.isAbstract(modifierFlags) || Modifier.isNative(modifierFlags)) {
String className = declaringclassType.getClassName();
if (DexUtil.isByteCodeClassName(className)) {
className = DexUtil.dottedClassName(className);
}
MethodSignature methodSignature =
new MethodSignature(
declaringclassType,
className,
method.getName(),
Collections.emptyList(),
DexUtil.toSootType(method.getReturnType(), 0));
DexMethodSource dexMethodSource =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,12 @@ public JavaSootMethod makeSootMethod(
// If the Nop Statements are not removed, graph.initializeWith throws a runtime exception
// It is only for the case where there is a JNop Statement after the return statement. Crazy
// android code :(
String className = classType.getClassName();
if (DexUtil.isByteCodeClassName(className)) {
className = DexUtil.dottedClassName(className);
}
MethodSignature methodSignature =
new MethodSignature(
classType, className, parameterTypes, DexUtil.toSootType(method.getReturnType(), 0));
classType,
method.getName(),
parameterTypes,
DexUtil.toSootType(method.getReturnType(), 0));
while (stmtList.get(stmtList.size() - 1) instanceof JNopStmt) {
stmtList.remove(stmtList.size() - 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ public void loadOneClass() {
Paths.get(apk_path), "", DexBodyInterceptors.Default.bodyInterceptors());
JavaView view = new JavaView(sootClassApkAnalysisInputLocation);
String className = "android.support.v4.app.FragmentState$1";
String methodName = "FragmentState$1";
String methodName = "<init>";
ClassType classType = view.getIdentifierFactory().getClassType(className);
assertTrue(view.getClass(classType).isPresent());
// Retrieve class
SootClass sootClass = (SootClass) view.getClass(classType).get();
SootClass sootClass = view.getClass(classType).get();
// write MethodSignature
MethodSignature methodSignature =
new MethodSignature(classType, methodName, Collections.emptyList(), VoidType.getInstance());
Expand Down
Loading