From 25972604c483c13eb3efc7e896fd977030e810e2 Mon Sep 17 00:00:00 2001 From: leixiao <1729888211@qq.com> Date: Tue, 7 Jan 2025 21:19:36 +0800 Subject: [PATCH] adapt the new version of soot-infoflow-android to solve similar bugs: https://github.com/secure-software-engineering/FlowDroid/issues/716 --- build.gradle.kts | 2 +- .../kotlin/net/bytedance/security/app/android/AndroidUtils.kt | 4 ++-- .../net/bytedance/security/app/pointer/PLLocalPointer.kt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 251320a..527f9c8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,7 +34,7 @@ dependencies { // implementation("de.fraunhofer.sit.sse.flowdroid:soot-infoflow:2.10.0") // implementation("de.fraunhofer.sit.sse.flowdroid:soot-infoflow-android:2.10.0") - implementation("io.github.nkbai:soot-infoflow-android:2.10.4") + implementation("de.fraunhofer.sit.sse.flowdroid:soot-infoflow-android:2.14.1") implementation("org.eclipse.jdt:org.eclipse.jdt.core:3.24.0") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3") diff --git a/src/main/kotlin/net/bytedance/security/app/android/AndroidUtils.kt b/src/main/kotlin/net/bytedance/security/app/android/AndroidUtils.kt index e8d2e9d..303913a 100644 --- a/src/main/kotlin/net/bytedance/security/app/android/AndroidUtils.kt +++ b/src/main/kotlin/net/bytedance/security/app/android/AndroidUtils.kt @@ -297,7 +297,7 @@ object AndroidUtils { Log.logDebug("Load resource") resources = ARSCFileParser() try { - resources!!.parse(targetAPK.absolutePath) + resources!!.parse(File(targetAPK.absolutePath)) // use proper Files instead of strings and set the proper root directory (https://github.com/secure-software-engineering/FlowDroid/commit/cc921a6b714ca8418da92806a743f8c6ef06c40d) } catch (e: IOException) { e.printStackTrace() } @@ -346,7 +346,7 @@ object AndroidUtils { TargetSdk = manifest.targetSdkVersion Log.logDebug("TargetSdk $TargetSdk") layoutFileParser = LayoutFileParser(manifest.packageName, resources) - layoutFileParser!!.parseLayoutFileDirect(apkPath) + layoutFileParser!!.parseLayoutFileDirect(File(apkPath)) // use proper Files instead of strings and set the proper root directory (https://github.com/secure-software-engineering/FlowDroid/commit/cc921a6b714ca8418da92806a743f8c6ef06c40d) parseAllComponents(manifest) this.manifestVulnerability?.check(manifest) diff --git a/src/main/kotlin/net/bytedance/security/app/pointer/PLLocalPointer.kt b/src/main/kotlin/net/bytedance/security/app/pointer/PLLocalPointer.kt index 71a6e38..3c8aa69 100644 --- a/src/main/kotlin/net/bytedance/security/app/pointer/PLLocalPointer.kt +++ b/src/main/kotlin/net/bytedance/security/app/pointer/PLLocalPointer.kt @@ -119,14 +119,14 @@ class PLLocalPointer : PLPointer { fun SootMethod.shortSignature(): String { if (shortNameEnable) { - return "${this.declaringClass.shortName}:${this.name}.${this.number}" + return "${this.declaringClass.shortName}:${this.name}" // soot remove some numbers which are actually not really needed (https://github.com/soot-oss/soot/commit/554dbc3815b12165086850b27517a8d1fda72488) } return this.signature } fun SootField.shortSignature(): String { if (shortNameEnable) { - return "${this.declaringClass.shortName}:${this.name}.${this.number}" + return "${this.declaringClass.shortName}:${this.name}" // soot remove some numbers which are actually not really needed (https://github.com/soot-oss/soot/commit/554dbc3815b12165086850b27517a8d1fda72488) } return this.signature }