Skip to content

Commit

Permalink
Merge pull request #1128 from soot-oss/ApkFrontEndDumbIssue
Browse files Browse the repository at this point in the history
coupled two method streams into single stream in APK frontend
  • Loading branch information
palaniappan1 authored Nov 6, 2024
2 parents 9ffc0fd + bf76ea2 commit 68dd0e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.nio.file.Path;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import javax.annotation.Nonnull;
import org.jf.dexlib2.dexbacked.raw.EncodedValue;
Expand Down Expand Up @@ -78,16 +77,9 @@ public DexClassSource(
@Override
public Collection<? extends JavaSootMethod> resolveMethods() throws ResolveException {
if (classInformation != null) {
Iterable<? extends Method> methodIterable = classInformation.classDefinition.getMethods();
DexMethod dexMethod = createDexMethodFactory(classInformation.dexEntry, classSignature);
// Convert the Iterable to a Stream
Stream<? extends Method> methodStream =
StreamSupport.stream(methodIterable.spliterator(), false);
Iterable<? extends Method> virtualMethodIterable =
classInformation.classDefinition.getVirtualMethods();
Stream<? extends Method> virtualMethodStream =
StreamSupport.stream(virtualMethodIterable.spliterator(), false);
return Stream.concat(methodStream, virtualMethodStream)
return StreamSupport.stream(
classInformation.classDefinition.getMethods().spliterator(), false)
.map(method -> loadMethod(method, dexMethod))
.collect(Collectors.toSet());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void loadAnApk() {
methodsSize += methods.size();
}
// There are a total of 740 classes and 10559 methods present in the given APK
assertEquals(10559, methodsSize);
assertEquals(6220, methodsSize);
assertEquals(740, classes.size());
}

Expand Down

0 comments on commit 68dd0e8

Please sign in to comment.