Skip to content

Commit

Permalink
coupled two method streams into single stream in APK frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
palaniappan1 committed Nov 6, 2024
1 parent 33cbf35 commit bcf5c2f
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 bcf5c2f

Please sign in to comment.