7676import soot .toolkits .graph .ExceptionalUnitGraph ;
7777import soot .toolkits .graph .ExceptionalUnitGraphFactory ;
7878import soot .toolkits .scalar .SimpleLocalDefs ;
79+ import soot .util .ConcurrentHashMultiMap ;
7980import soot .util .HashMultiMap ;
8081import soot .util .MultiMap ;
8182
@@ -129,8 +130,8 @@ public abstract class AbstractCallbackAnalyzer {
129130 protected final MultiMap <SootClass , AndroidCallbackDefinition > callbackMethods = new HashMultiMap <>();
130131 protected final MultiMap <SootClass , Integer > layoutClasses = new HashMultiMap <>();
131132 protected final Set <SootClass > dynamicManifestComponents = Collections .newSetFromMap (new ConcurrentHashMap <>());
132- protected final MultiMap <SootClass , SootClass > fragmentClasses = new HashMultiMap <>();
133- protected final MultiMap <SootClass , SootClass > fragmentClassesRev = new HashMultiMap <>();
133+ protected final MultiMap <SootClass , SootClass > fragmentClasses = new ConcurrentHashMultiMap <>();
134+ protected final MultiMap <SootClass , SootClass > fragmentClassesRev = new ConcurrentHashMultiMap <>();
134135 protected final Map <SootClass , Integer > fragmentIDs = new ConcurrentHashMap <>();
135136
136137 protected final List <ICallbackFilter > callbackFilters = new ArrayList <>();
@@ -201,7 +202,7 @@ else if (arrayLocals.contains(lop))
201202
202203 });
203204
204- private MultiMap <SootMethod , Stmt > javaScriptInterfaces = new HashMultiMap <SootMethod , Stmt >();
205+ private MultiMap <SootMethod , Stmt > javaScriptInterfaces = new ConcurrentHashMultiMap <SootMethod , Stmt >();
205206
206207 public AbstractCallbackAnalyzer (InfoflowAndroidConfiguration config , Set <SootClass > entryPointClasses )
207208 throws IOException {
@@ -454,9 +455,7 @@ protected void analyzeMethodForJavascriptInterfaces(SootMethod method) {
454455 final SootMethodRef methodRef = iexpr .getMethodRef ();
455456 if (methodRef .getName ().equals ("addJavascriptInterface" ) && iexpr .getArgCount () == 2
456457 && fastHierarchy .canStoreType (methodRef .getDeclaringClass ().getType (), webViewType )) {
457- synchronized (javaScriptInterfaces ) {
458- this .javaScriptInterfaces .put (method , stmt );
459- }
458+ this .javaScriptInterfaces .put (method , stmt );
460459 }
461460 }
462461 }
@@ -993,10 +992,8 @@ && isEmpty(method.retrieveActiveBody()))
993992 if (!filterAccepts (lifecycleClass , method ))
994993 return false ;
995994
996- synchronized (this .callbackMethods ) {
997- return this .callbackMethods .put (lifecycleClass ,
998- new AndroidCallbackDefinition (method , parentMethod , callbackType ));
999- }
995+ return this .callbackMethods .put (lifecycleClass ,
996+ new AndroidCallbackDefinition (method , parentMethod , callbackType ));
1000997 }
1001998
1002999 /**
@@ -1006,7 +1003,7 @@ && isEmpty(method.retrieveActiveBody()))
10061003 * fragment belongs
10071004 * @param fragmentClass The fragment class
10081005 */
1009- protected synchronized void checkAndAddFragment (SootClass componentClass , SootClass fragmentClass ) {
1006+ protected void checkAndAddFragment (SootClass componentClass , SootClass fragmentClass ) {
10101007 this .fragmentClasses .put (componentClass , fragmentClass );
10111008 this .fragmentClassesRev .put (fragmentClass , componentClass );
10121009 }
0 commit comments