Merge branch 'remote-master' into development

# Conflicts:
#	app/src/main/java/com/topjohnwu/magisk/di/ViewModelsModule.kt
#	app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
#	app/src/main/java/com/topjohnwu/magisk/utils/XString.kt
This commit is contained in:
Viktor De Pasquale
2019-05-10 16:43:37 +02:00
12 changed files with 82 additions and 58 deletions
@@ -13,6 +13,12 @@ import com.topjohnwu.magisk.App
import java.io.File
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 {
@@ -11,4 +13,9 @@ fun String.replaceRandomWithSpecial(): String {
}
fun StringBuilder.appendIf(condition: Boolean, builder: StringBuilder.() -> Unit) =
if (condition) apply(builder) else this
if (condition) apply(builder) else this
fun Int.res(vararg args: Any): String {
val resources: Resources by inject()
return resources.getString(this, *args)
}