Merge pull request #21 from WenHao2130/origin/wenhao-patch-1

manager: enhanced device model retrieval with Huawei' market name checking
This commit is contained in:
ShirkNeko
2025-03-29 16:27:01 +08:00
committed by GitHub

View File

@@ -582,9 +582,10 @@ private fun getDeviceModel(context: Context): String {
val systemProperties = Class.forName("android.os.SystemProperties")
val getMethod = systemProperties.getMethod("get", String::class.java, String::class.java)
val marketNameKeys = listOf(
"ro.product.marketname",
"ro.vendor.oplus.market.name",
"ro.vivo.market.name"
"ro.product.marketname", // Xiaomi
"ro.vendor.oplus.market.name", // Oppo, OnePlus, Realme
"ro.vivo.market.name", // Vivo
"ro.config.marketing_name" // Huawei
)
for (key in marketNameKeys) {
val marketName = getMethod.invoke(null, key, "") as String