mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-16 06:43:23 -08:00
Download to proper filename
This commit is contained in:
@@ -70,12 +70,6 @@ object Utils {
|
||||
return info.loadLabel(pm).toString()
|
||||
}
|
||||
|
||||
fun getLegalFilename(filename: CharSequence): String {
|
||||
return filename.toString().replace(" ", "_").replace("'", "").replace("\"", "")
|
||||
.replace("$", "").replace("`", "").replace("*", "").replace("/", "_")
|
||||
.replace("#", "").replace("@", "").replace("\\", "_")
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
fun loadModulesLeanback(): Map<String, OldModule> {
|
||||
val moduleMap = ValueSortedMap<String, OldModule>()
|
||||
|
||||
@@ -20,4 +20,8 @@ fun Int.res(vararg args: Any): String {
|
||||
return resources.getString(this, *args)
|
||||
}
|
||||
|
||||
fun String.trimEmptyToNull(): String? = if (isBlank()) null else this
|
||||
fun String.trimEmptyToNull(): String? = if (isBlank()) null else this
|
||||
|
||||
fun String.legalFilename() = replace(" ", "_").replace("'", "").replace("\"", "")
|
||||
.replace("$", "").replace("`", "").replace("*", "").replace("/", "_")
|
||||
.replace("#", "").replace("@", "").replace("\\", "_")
|
||||
|
||||
Reference in New Issue
Block a user