Skip to content

Commit

Permalink
fix cannot include the java source code in the detail report.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkbai committed Nov 23, 2023
1 parent c855ede commit 7c5bc5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import java.io.File
import java.io.IOException
import java.nio.charset.StandardCharsets
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
import kotlin.system.exitProcess
Expand Down Expand Up @@ -130,8 +129,7 @@ object ComponentDescriptionDataSerializer : KSerializer<ComponentDescription> {
object AndroidUtils {
var apkAbsPath: String? = null
var JavaSourceDir: String? = null

var dexToJavaProcess: Process? = null

var resources: ARSCFileParser? = null
var isApkParsed = false //

Expand Down Expand Up @@ -189,7 +187,7 @@ object AndroidUtils {
val start = System.currentTimeMillis()
Log.logInfo("==========>Start dex to Java")

val doneFile = File(JavaSourceDir,".done")
val doneFile = File(JavaSourceDir, ".done")

if (doneFile.exists()) {
Log.logInfo("Using jadx cache")
Expand Down Expand Up @@ -222,7 +220,8 @@ object AndroidUtils {
val timeoutMillis = 1800000L // 1800 seconds
if (!processBuilder.waitFor(timeoutMillis, TimeUnit.MILLISECONDS)) {
processBuilder.destroyForcibly()
processBuilder.waitFor()
val exitCode = processBuilder.waitFor()
Log.logInfo("command ${command.joinToString(" ")} exit with $exitCode")
}

val exitCode = try {
Expand Down
4 changes: 0 additions & 4 deletions src/main/kotlin/net/bytedance/security/app/ui/util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package net.bytedance.security.app.ui

import net.bytedance.security.app.Log
import net.bytedance.security.app.PLUtils
import net.bytedance.security.app.android.AndroidUtils
import net.bytedance.security.app.engineconfig.isLibraryClass
import net.bytedance.security.app.util.JavaAST
import soot.Scene
Expand All @@ -33,9 +32,6 @@ import java.nio.file.Files
return method's full Java source code,
*/
internal fun getJavaSource(method: SootMethod): String? {
if (AndroidUtils.dexToJavaProcess == null) {
return null
}
val methodSig = method.signature
// val anonymousMethodSig: String? = null
// val declaringClassName = method.declaringClass.name
Expand Down

0 comments on commit 7c5bc5a

Please sign in to comment.