Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.13.4' propVersionName = '3.13.6' kotlin_version = '1.2.21' support_libs = '27.0.2' } Loading commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt +12 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,18 @@ fun Context.getSDCardPath(): String { sdCardPath = directories.firstOrNull() ?: "" } if (sdCardPath.isEmpty()) { val SDpattern = Pattern.compile("^[A-Za-z0-9]{4}-[A-Za-z0-9]{4}$") try { File("/storage").listFiles()?.forEach { if (SDpattern.matcher(it.name).matches()) { sdCardPath = "/storage/${it.name}" } } } catch (e: Exception) { } } return sdCardPath.trimEnd('/') } Loading Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.13.4' propVersionName = '3.13.6' kotlin_version = '1.2.21' support_libs = '27.0.2' } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt +12 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,18 @@ fun Context.getSDCardPath(): String { sdCardPath = directories.firstOrNull() ?: "" } if (sdCardPath.isEmpty()) { val SDpattern = Pattern.compile("^[A-Za-z0-9]{4}-[A-Za-z0-9]{4}$") try { File("/storage").listFiles()?.forEach { if (SDpattern.matcher(it.name).matches()) { sdCardPath = "/storage/${it.name}" } } } catch (e: Exception) { } } return sdCardPath.trimEnd('/') } Loading