Add preset support for LineageOS overlays and EvoX (community request)
This commit is contained in:
parent
c45bc1fb83
commit
60c657a8db
2 changed files with 26 additions and 1 deletions
|
|
@ -76,4 +76,16 @@ object Utils {
|
|||
|
||||
return false
|
||||
}
|
||||
|
||||
fun endsWithMultiple(source: String, vararg targets: String): Boolean {
|
||||
assert(source.isNotEmpty() && targets.isNotEmpty())
|
||||
|
||||
for (target in targets) {
|
||||
if (source.endsWith(target)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
@ -4,11 +4,18 @@ import android.content.pm.ApplicationInfo
|
|||
import icu.nullptr.hidemyapplist.common.Utils
|
||||
|
||||
class CustomROMPreset() : BasePreset("custom_rom") {
|
||||
override val exactPackageNames = setOf<String>()
|
||||
override val exactPackageNames = setOf(
|
||||
"io.chaldeaprjkt.gamespace"
|
||||
)
|
||||
|
||||
override fun canBeAddedIntoPreset(appInfo: ApplicationInfo): Boolean {
|
||||
val packageName = appInfo.packageName
|
||||
|
||||
// LineageOS overlays
|
||||
if (appInfo.sourceDir.contains("_lineage_")) {
|
||||
return true
|
||||
}
|
||||
|
||||
// LineageOS apps
|
||||
if (Utils.startsWithMultiple(packageName, "lineageos.", "org.lineageos.")) {
|
||||
return true
|
||||
|
|
@ -29,6 +36,12 @@ class CustomROMPreset() : BasePreset("custom_rom") {
|
|||
return true
|
||||
}
|
||||
|
||||
// EvoX (just added by the community request)
|
||||
if (Utils.startsWithMultiple("org.evolution.", "org.evolutionx.") ||
|
||||
Utils.endsWithMultiple(".evolution", ".evolutionx")) {
|
||||
return true
|
||||
}
|
||||
|
||||
// TODO: Add more custom ROM apps
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue