Error in building InterProceduralSuperSpark
Closed this issue · 3 comments
yurushao commented
After upgrading to 3.1.2 I found that InterProceduralSuperSpark APIs changed a lot. I edited my code accordingly but got the following exception while building InterProceduralSuperSpark. Tested with several different APKs.
java.util.NoSuchElementException: key not found: PtaNode(PointArgReturn(v0,0,L110528,5,xxxxxxx;.onStartJob:(Landroid/app/job/JobParameters;)Z),(JobSchedulerService.onStartJob,L110528)(JobSchedulerService.onStartJob,L110528))
at scala.collection.MapLike.default(MapLike.scala:232)
at scala.collection.MapLike.default$(MapLike.scala:231)
at scala.collection.AbstractMap.default(Map.scala:59)
at scala.collection.MapLike.apply(MapLike.scala:141)
at scala.collection.MapLike.apply$(MapLike.scala:140)
at scala.collection.AbstractMap.apply(Map.scala:59)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.getNode(PointerAssignmentGraph.scala:504)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$3(PointerAssignmentGraph.scala:352)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$3$adapted(PointerAssignmentGraph.scala:346)
at scala.collection.mutable.HashSet.foreach(HashSet.scala:78)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$2(PointerAssignmentGraph.scala:346)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$2$adapted(PointerAssignmentGraph.scala:337)
at scala.collection.mutable.HashMap.$anonfun$foreach$1(HashMap.scala:138)
at scala.collection.mutable.HashTable.foreachEntry(HashTable.scala:236)
at scala.collection.mutable.HashTable.foreachEntry$(HashTable.scala:229)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:138)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$1(PointerAssignmentGraph.scala:337)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$1$adapted(PointerAssignmentGraph.scala:335)
at scala.collection.mutable.HashMap.$anonfun$foreach$1(HashMap.scala:138)
at scala.collection.mutable.HashTable.foreachEntry(HashTable.scala:236)
at scala.collection.mutable.HashTable.foreachEntry$(HashTable.scala:229)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:138)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.buildingEdges(PointerAssignmentGraph.scala:335)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$constructGraph$2(PointerAssignmentGraph.scala:201)
at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:320)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:976)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.constructGraph(PointerAssignmentGraph.scala:197)
at org.argus.jawa.alir.pta.suspark.InterProceduralSuperSpark.doPTA(InterProceduralSuperSpark.scala:56)
at org.argus.jawa.alir.pta.suspark.InterProceduralSuperSpark.$anonfun$pta$1(InterProceduralSuperSpark.scala:47)
at org.argus.jawa.alir.pta.suspark.InterProceduralSuperSpark.$anonfun$pta$1$adapted(InterProceduralSuperSpark.scala:42)
at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:320)
at org.argus.jawa.alir.pta.suspark.InterProceduralSuperSpark.pta(InterProceduralSuperSpark.scala:42)
at org.argus.jawa.alir.pta.suspark.InterProceduralSuperSpark.build(InterProceduralSuperSpark.scala:37)
fgwei commented
Could you give me one apk to reproduce this bug?
yurushao commented
object Test {
def main(args: Array[String]): Unit = {
AndroidReachingFactsAnalysisConfig.parallel = false
AndroidReachingFactsAnalysisConfig.resolve_static_init = true
val inputUri = FileUtil.toUri("./BaiduBaike_v2.3.0.apk")
val outputUri = FileUtil.toUri("./output")
val reporter = new DefaultReporter
val yard = new ApkYard(reporter)
val layout = DecompileLayout(outputUri)
val settings = DecompilerSettings(debugMode = false, forceDelete = false,
reporter = reporter, listener = None,
strategy = DecompileStrategy(layout, libraryAPISummary = new
DefaultLibraryAPISummary(AndroidGlobalConfig.settings.third_party_lib_file)))
val apk = yard.loadApk(inputUri, settings, collectInfo = true,
resolveCallBack = false)
apk.model.getComponents foreach { svc =>
System.out.println(svc)
val clz = apk.getClassOrResolve(svc)
val eps = clz.getDeclaredMethods
val spark = new InterProceduralSuperSpark(apk)
val idfg = spark.build(eps.map(_.getSignature))
System.out.println(idfg.ptaresult)
}
}
}
…On Mon, Nov 6, 2017 at 11:08 PM Fengguo Wei ***@***.***> wrote:
Could you give me one apk to reproduce this bug?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABTNTxiSsj_KprxvmhAqGQEn6EDH2yJrks5sz9ewgaJpZM4QUMMl>
.
LorenzoSorzana commented
I'm having the same problem, using Java, when i call the 'build' function. I post my output:
Exception in thread "main" java.util.NoSuchElementException: key not found: PtaNode(PointParamExit(v2,android.os.Bundle,0,Llopi/it/lopitestapp/MainActivity;.onCreate:(Landroid/os/Bundle;)V),(MainActivity.onCreate,onCreate)(MainActivity.onCreate,onCreate))
at scala.collection.MapLike.default(MapLike.scala:232)
at scala.collection.MapLike.default$(MapLike.scala:231)
at scala.collection.AbstractMap.default(Map.scala:59)
at scala.collection.MapLike.apply(MapLike.scala:141)
at scala.collection.MapLike.apply$(MapLike.scala:140)
at scala.collection.AbstractMap.apply(Map.scala:59)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.getNode(PointerAssignmentGraph.scala:504)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$3(PointerAssignmentGraph.scala:352)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$3$adapted(PointerAssignmentGraph.scala:346)
at scala.collection.mutable.HashSet.foreach(HashSet.scala:78)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$2(PointerAssignmentGraph.scala:346)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$2$adapted(PointerAssignmentGraph.scala:337)
at scala.collection.mutable.HashMap.$anonfun$foreach$1(HashMap.scala:138)
at scala.collection.mutable.HashTable.foreachEntry(HashTable.scala:236)
at scala.collection.mutable.HashTable.foreachEntry$(HashTable.scala:229)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:138)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$1(PointerAssignmentGraph.scala:337)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$buildingEdges$1$adapted(PointerAssignmentGraph.scala:335)
at scala.collection.mutable.HashMap.$anonfun$foreach$1(HashMap.scala:138)
at scala.collection.mutable.HashTable.foreachEntry(HashTable.scala:236)
at scala.collection.mutable.HashTable.foreachEntry$(HashTable.scala:229)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:138)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.buildingEdges(PointerAssignmentGraph.scala:335)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.$anonfun$constructGraph$2(PointerAssignmentGraph.scala:201)
at scala.collection.immutable.Set$Set3.foreach(Set.scala:167)
at org.argus.jawa.alir.pta.suspark.PointerAssignmentGraph.constructGraph(PointerAssignmentGraph.scala:197)
at org.argus.jawa.alir.pta.suspark.InterProceduralSuperSpark.doPTA(InterProceduralSuperSpark.scala:56)
at org.argus.jawa.alir.pta.suspark.InterProceduralSuperSpark.$anonfun$pta$1(InterProceduralSuperSpark.scala:47)
at org.argus.jawa.alir.pta.suspark.InterProceduralSuperSpark.$anonfun$pta$1$adapted(InterProceduralSuperSpark.scala:42)
at scala.collection.immutable.Set$Set1.foreach(Set.scala:95)
at org.argus.jawa.alir.pta.suspark.InterProceduralSuperSpark.pta(InterProceduralSuperSpark.scala:42)
at org.argus.jawa.alir.pta.suspark.InterProceduralSuperSpark.build(InterProceduralSuperSpark.scala:37)
at Main.main(Main.java:156)