We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ffcc752 commit 0611926Copy full SHA for 0611926
app/src/main/kotlin/com/glodanif/bluetoothchat/model/ApkExtractor.kt
@@ -25,9 +25,14 @@ class ApkExtractor(private val context: Context) : FileExtractor {
25
val file = File(application.applicationInfo.publicSourceDir)
26
27
thread {
28
- val newFile = copyAndZip(file, directory, "BluetoothChat")
29
- handler.post {
30
- onExtracted.invoke(Uri.fromFile(newFile))
+
+ try {
+ val newFile = copyAndZip(file, directory, "BluetoothChat")
31
+ handler.post {
32
+ onExtracted.invoke(Uri.fromFile(newFile))
33
+ }
34
+ } catch (e: IOException) {
35
+ onFailed.invoke()
36
}
37
38
0 commit comments