Skip to content

Commit 08b6c2c

Browse files
committed
🐛 fix screen freeze
1 parent 18818f9 commit 08b6c2c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

data/src/main/kotlin/com/theapache64/stackzy/data/repo/ApkAnalyzerRepo.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import com.theapache64.stackzy.data.util.AndroidVersionIdentifier
99
import com.theapache64.stackzy.data.util.StringUtils
1010
import com.theapache64.stackzy.data.util.sizeInMb
1111
import com.toxicbakery.logging.Arbor
12+
import kotlinx.coroutines.Dispatchers
13+
import kotlinx.coroutines.withContext
1214
import org.yaml.snakeyaml.Yaml
1315
import org.yaml.snakeyaml.representer.Representer
1416
import java.io.File
@@ -32,15 +34,15 @@ class ApkAnalyzerRepo @Inject constructor() {
3234
/**
3335
* To get final report
3436
*/
35-
fun analyze(
37+
suspend fun analyze(
3638
packageName: String,
3739
apkFile: File,
3840
decompiledDir: File,
3941
allLibraries: List<Library>
40-
): AnalysisReport {
42+
): AnalysisReport = withContext(Dispatchers.IO) {
4143
val platform = getPlatform(decompiledDir)
4244
val (untrackedLibs, libraries) = getLibraries(platform, decompiledDir, allLibraries)
43-
return AnalysisReport(
45+
AnalysisReport(
4446
appName = getAppName(decompiledDir) ?: packageName,
4547
packageName = packageName,
4648
platform = platform,
@@ -310,9 +312,6 @@ class ApkAnalyzerRepo @Inject constructor() {
310312
if (fileContent.contains(library.packageName.replace(".", "/"))) {
311313
// has lib usage
312314
appLibs.add(library)
313-
if (library.name == "okio") {
314-
println(smaliFile.absolutePath)
315-
}
316315
}
317316
}
318317

0 commit comments

Comments
 (0)