Fixed language won't change in certain views unless app restarts

This commit is contained in:
Viktor De Pasquale
2019-05-10 16:22:03 +02:00
parent ff7a0ba599
commit 67c3f40adb
7 changed files with 50 additions and 44 deletions
@@ -11,6 +11,12 @@ import android.provider.OpenableColumns
import com.topjohnwu.magisk.App
import java.io.FileNotFoundException
val packageName: String
get() {
val app: App by inject()
return app.packageName
}
val PackageInfo.processes
get() = activities?.processNames.orEmpty() +
services?.processNames.orEmpty() +
@@ -1,5 +1,7 @@
package com.topjohnwu.magisk.utils
import android.content.res.Resources
val specialChars = arrayOf('!', '@', '#', '$', '%', '&', '?')
fun String.replaceRandomWithSpecial(): String {
@@ -8,4 +10,9 @@ fun String.replaceRandomWithSpecial(): String {
random = random()
} while (random == '.')
return replace(random, specialChars.random())
}
fun Int.res(vararg args: Any): String {
val resources: Resources by inject()
return resources.getString(this, *args)
}