Skip to content
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 @@ -29,11 +29,15 @@ public AbstractAndroidEntryPointCreator(IManifestHandler manifest) {
@Override
public SootMethod createDummyMain() {
// Initialize the utility class
this.entryPointUtils = new AndroidEntryPointUtils();
this.entryPointUtils = createEntryPointUtils();

return super.createDummyMain();
}

protected AndroidEntryPointUtils createEntryPointUtils() {
return new AndroidEntryPointUtils();
}

protected Stmt searchAndBuildMethod(String subsignature, Local classLocal) {
return searchAndBuildMethod(subsignature, classLocal, Collections.<SootClass>emptySet());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ public ComponentType getComponentType(SootClass currentClass) {

// Check the type of this class
ComponentType ctype = ComponentType.Plain;
FastHierarchy fh = Scene.v().getOrMakeFastHierarchy();
FastHierarchy fh = getFastHierarchy();

if (fh != null) {
// We first look for the specialized types

// (a1) android.app.Fragment
if (osClassFragment != null && Scene.v().getOrMakeFastHierarchy().canStoreType(currentClass.getType(),
osClassFragment.getType()))
if (osClassFragment != null
&& getFastHierarchy().canStoreType(currentClass.getType(), osClassFragment.getType()))
ctype = ComponentType.Fragment;
else if (osClassSupportFragment != null
&& fh.canStoreType(currentClass.getType(), osClassSupportFragment.getType()))
Expand Down Expand Up @@ -168,7 +168,7 @@ else if (osClassContentProvider != null
*/
public boolean isApplicationClass(SootClass clazz) {
return osClassApplication != null
&& Scene.v().getOrMakeFastHierarchy().canStoreType(clazz.getType(), osClassApplication.getType());
&& getFastHierarchy().canStoreType(clazz.getType(), osClassApplication.getType());
}

/**
Expand All @@ -180,7 +180,7 @@ public boolean isApplicationClass(SootClass clazz) {
*/
public boolean isComponentFactoryClass(SootClass clazz) {
return osClassComponentFactory != null
&& Scene.v().getOrMakeFastHierarchy().canStoreType(clazz.getType(), osClassComponentFactory.getType());
&& getFastHierarchy().canStoreType(clazz.getType(), osClassComponentFactory.getType());
}

/**
Expand Down Expand Up @@ -291,7 +291,7 @@ private static Collection<? extends MethodOrMethodContext> getLifecycleMethods(S
SootMethodRepresentationParser parser = SootMethodRepresentationParser.v();

Scene scene = Scene.v();
FastHierarchy fh = Scene.v().getOrMakeFastHierarchy();
FastHierarchy fh = scene.getOrMakeFastHierarchy();
nextMethod: for (String sig : methods) {
SootClass currentClass = sc;
String name = parser.getMethodNameFromSubSignature(sig);
Expand Down Expand Up @@ -328,6 +328,14 @@ private static Collection<? extends MethodOrMethodContext> getLifecycleMethods(S
return lifecycleMethods;
}

/**
* Returns the used fast hierarchy
* @return the used fast hierarchy
*/
protected FastHierarchy getFastHierarchy() {
return Scene.v().getOrMakeFastHierarchy();
}

/**
* Checks whether a method is potentially callable from JavaScript
* @param m the method
Expand Down