Skip to content

Commit

Permalink
Merge pull request #1124 from soot-oss/ApkFrontEndDumbIssue
Browse files Browse the repository at this point in the history
resolved a blunder in APK frontend
  • Loading branch information
stschott authored Oct 31, 2024
2 parents 1390a6e + 934ab1d commit 33cbf35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
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

0 comments on commit 33cbf35

Please sign in to comment.