diff --git a/app/src/main/kotlin/com/fox2code/mmm/installer/InstallerActivity.kt b/app/src/main/kotlin/com/fox2code/mmm/installer/InstallerActivity.kt index 1beb1489..5d9e37b7 100644 --- a/app/src/main/kotlin/com/fox2code/mmm/installer/InstallerActivity.kt +++ b/app/src/main/kotlin/com/fox2code/mmm/installer/InstallerActivity.kt @@ -224,7 +224,7 @@ class InstallerActivity : FoxActivity() { prgInd?.setProgressCompat(progress, true) } } - } else readSU(moduleCache!!) + } else rawModule = readSU(moduleCache!!) runOnUiThread { prgInd?.visibility = View.GONE prgInd?.isIndeterminate = true diff --git a/app/src/main/kotlin/com/fox2code/mmm/utils/IntentHelper.kt b/app/src/main/kotlin/com/fox2code/mmm/utils/IntentHelper.kt index d481c5a5..e1915d24 100644 --- a/app/src/main/kotlin/com/fox2code/mmm/utils/IntentHelper.kt +++ b/app/src/main/kotlin/com/fox2code/mmm/utils/IntentHelper.kt @@ -374,6 +374,7 @@ enum class IntentHelper {; if ((destination == null) || (destination.parentFile.also { destinationFolder = it } == null) || (!destinationFolder?.mkdirs()!! && !destinationFolder!!.isDirectory)) { + Timber.w("dest null.for open") callback.onReceived(destination, null, RESPONSE_ERROR) return } @@ -387,10 +388,8 @@ enum class IntentHelper {; ).toBundle() compatActivity.startActivityForResult(intent, param) { result: Int, data: Intent? -> val uri = data?.data - if (uri == null || result == Activity.RESULT_CANCELED && ContentResolver.SCHEME_FILE == uri.scheme && uri.path != null && (uri.path!!.startsWith( - "/sdcard/" - ) || uri.path!!.startsWith("/data/")) || ContentResolver.SCHEME_ANDROID_RESOURCE != uri.scheme - ) { + if (uri == null || result == Activity.RESULT_CANCELED) { + Timber.d("invalid uri recieved") callback.onReceived(destination, null, RESPONSE_ERROR) return@startActivityForResult } @@ -467,4 +466,4 @@ enum class IntentHelper {; }) } } -} \ No newline at end of file +} diff --git a/app/src/main/kotlin/com/fox2code/mmm/utils/io/Files.kt b/app/src/main/kotlin/com/fox2code/mmm/utils/io/Files.kt index f9a96087..5651c9ac 100644 --- a/app/src/main/kotlin/com/fox2code/mmm/utils/io/Files.kt +++ b/app/src/main/kotlin/com/fox2code/mmm/utils/io/Files.kt @@ -196,9 +196,9 @@ enum class Files { val zipOutputStream = ZipOutputStream(outputStream) var nRead: Int val data = ByteArray(16384) - var zipEntry: ZipEntry + var zipEntry: ZipEntry? while (zipInputStream.nextEntry.also { zipEntry = it } != null) { - val name = zipEntry.name + val name = zipEntry!!.name val i = name.indexOf('/', 1) if (i == -1) continue val newName = name.substring(i + 1) @@ -304,4 +304,4 @@ enum class Files { } } } -} \ No newline at end of file +}