Added indication of whether the manager is hidden
This commit is contained in:
parent
5e01f785ae
commit
8024089bde
@ -4,6 +4,14 @@ import android.content.res.Resources
|
||||
|
||||
val specialChars = arrayOf('!', '@', '#', '$', '%', '&', '?')
|
||||
|
||||
fun String.replaceRandomWithSpecial(passes: Int): String {
|
||||
var string = this
|
||||
repeat(passes) {
|
||||
string = string.replaceRandomWithSpecial()
|
||||
}
|
||||
return string
|
||||
}
|
||||
|
||||
fun String.replaceRandomWithSpecial(): String {
|
||||
var random: Char
|
||||
do {
|
||||
|
@ -7,6 +7,8 @@ import com.topjohnwu.magisk.BuildConfig
|
||||
import com.topjohnwu.magisk.Info
|
||||
import com.topjohnwu.magisk.R
|
||||
import com.topjohnwu.magisk.data.repository.MagiskRepository
|
||||
import com.topjohnwu.magisk.extensions.packageName
|
||||
import com.topjohnwu.magisk.extensions.replaceRandomWithSpecial
|
||||
import com.topjohnwu.magisk.extensions.res
|
||||
import com.topjohnwu.magisk.model.entity.MagiskJson
|
||||
import com.topjohnwu.magisk.model.entity.ManagerJson
|
||||
@ -43,6 +45,15 @@ class HomeViewModel(
|
||||
}
|
||||
}
|
||||
|
||||
val stateHideManagerName = R.string.manager.res().let {
|
||||
val result = R.string.manager.res()
|
||||
if (packageName != BuildConfig.APPLICATION_ID) {
|
||||
result.replaceRandomWithSpecial(3)
|
||||
} else {
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
val itemsMainline =
|
||||
listOf(HomeItem.PayPal.Mainline, HomeItem.Patreon, HomeItem.Twitter.Mainline)
|
||||
val itemsApp =
|
||||
|
Loading…
Reference in New Issue
Block a user