Skip to content

Commit

Permalink
update soot to 4.6.0. Trim unwanted commons-io and csv packages (#93)
Browse files Browse the repository at this point in the history
* update soot to 4.6.0. Trim unwanted commons-io and csv packages

Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>

* Reuse existing xBOM tags

Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>

* Update commons-io which is needed for apk

Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>

---------

Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu authored Nov 18, 2024
1 parent 83680ac commit 3a859cf
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 9 deletions.
8 changes: 7 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "chen"
ThisBuild / organization := "io.appthreat"
ThisBuild / version := "2.2.2"
ThisBuild / version := "2.2.3"
ThisBuild / scalaVersion := "3.5.2"

val cpgVersion = "1.0.1"
Expand Down Expand Up @@ -38,6 +38,12 @@ ThisBuild / libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-nop" % "2.0.16" % Optional,
)

ThisBuild / excludeDependencies ++= Seq(
ExclusionRule("com.google.protobuf", "protobuf-java-util"),
ExclusionRule("com.github.tototoshi", "scala-csv_3"),
ExclusionRule("au.com.bytecode", "opencsv")
)

ThisBuild / compile / javacOptions ++= Seq(
"-g", // debug symbols
"-Xlint",
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"downloadUrl": "https://github.com/AppThreat/chen",
"issueTracker": "https://github.com/AppThreat/chen/issues",
"name": "chen",
"version": "2.2.2",
"version": "2.2.3",
"description": "Code Hierarchy Exploration Net (chen) is an advanced exploration toolkit for your application source code and its dependency hierarchy.",
"applicationCategory": "code-analysis",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "2.2.2" %}
{% set version = "2.2.3" %}

package:
name: chen
Expand Down
3 changes: 2 additions & 1 deletion platform/frontends/jimple2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ dependsOn(Projects.dataflowengineoss, Projects.x2cpg % "compile->compile;test->t

libraryDependencies ++= Seq(
"io.appthreat" %% "cpg2" % Versions.cpg,
"org.soot-oss" % "soot" % "4.5.0",
"commons-io" % "commons-io" % "2.17.0",
"org.soot-oss" % "soot" % "4.6.0",
"org.scala-lang.modules" % "scala-asm" % "9.7.0-scala-2",
"org.ow2.asm" % "asm" % "9.7.1",
"org.ow2.asm" % "asm-analysis" % "9.7.1",
Expand Down
17 changes: 17 additions & 0 deletions platform/frontends/x2cpg/src/main/resources/tags-vocab.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,20 @@ jdbm
kerberos
oidc
oauth2
bluetooth
wifi
wireless
driver
graphics
firmware
gyroscope
accelerometer
mobile
network
battery
registry
payment
stripe
apple-pay
icloud
azure
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CdxPass(atom: Cpg) extends CpgPass(atom):
val language: String = atom.metaData.language.head

// Number of tags needed
private val TAGS_COUNT: Int = 2
private val TAGS_COUNT: Int = 3

// Number of dots to use in the package namespace
// Example: org.apache.logging.* would be used for tagging purposes
Expand Down Expand Up @@ -94,9 +94,14 @@ class CdxPass(atom: Cpg) extends CpgPass(atom):
val compType = comp.hcursor.downField("type").as[String].getOrElse("")
val compDescription: String =
comp.hcursor.downField("description").as[String].getOrElse("")
val descTags = keywords.filter(k =>
compDescription.toLowerCase().contains(" " + k)
).take(TAGS_COUNT)
// Reuse existing tags from the xBOM
val compTags: List[String] =
comp.hcursor.downField("tags").as[List[String]].getOrElse(List.empty)
val descTags = if compTags.nonEmpty then compTags.take(TAGS_COUNT)
else
keywords.filter(k =>
compDescription.toLowerCase().contains(" " + k)
).take(TAGS_COUNT)
if (language == Languages.PYTHON || language == Languages.PYTHONSRC) && compPurl.startsWith(
"pkg:pypi"
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "appthreat-chen"
version = "2.2.2"
version = "2.2.3"
description = "Code Hierarchy Exploration Net (chen)"
authors = ["Team AppThreat <cloud@appthreat.com>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 3a859cf

Please sign in to comment.