Skip to content

Commit

Permalink
realme 也是用的oppo软件商店
Browse files Browse the repository at this point in the history
  • Loading branch information
simplepeng committed Nov 26, 2021
1 parent 0ce6c04 commit 1dafccb
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions .idea/runConfigurations.xml

This file was deleted.

11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,11 @@
## 依赖

```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
maven { url 'https://jitpack.io' }
```

```groovy
dependencies {
implementation 'com.github.simplepeng:MarketHelper:v1.0.2'
}
implementation 'com.github.simplepeng:MarketHelper:v1.0.3'
```

## 使用
Expand Down
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

// implementation project(path: ':markethelper')
implementation 'com.github.simplepeng:MarketHelper:v1.0.2'
// implementation "me.simple:MarketHelper:1.0.1"
implementation project(path: ':markethelper')
// implementation 'com.github.simplepeng:MarketHelper:v1.0.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,20 @@ object MarketHelper {
val oppoPkgs = arrayOf("com.heytap.market", "com.oppo.market")

marketPkgMap["Google"] = arrayOf("com.android.vending")//Google Pixel-已测试

marketPkgMap["OPPO"] = oppoPkgs//oppo-已测试
marketPkgMap["OnePlus"] = oppoPkgs//一加-已测试
marketPkgMap["realme"] = oppoPkgs//realme-已测试

marketPkgMap["Xiaomi"] = arrayOf("com.xiaomi.market")//小米-有问题,红米-已测试
marketPkgMap["Meizu"] = arrayOf("com.meizu.mstore")//魅族-已测试
marketPkgMap["OPPO"] = oppoPkgs//oppo-已测试
marketPkgMap["vivo"] = arrayOf("com.bbk.appstore")//vivo-已测试
marketPkgMap["HUAWEI"] = arrayOf("com.huawei.appmarket")//华为-已测试,荣耀-已测试
marketPkgMap[SAM_SUNG] = arrayOf("com.sec.android.app.samsungapps")//三星
marketPkgMap["lenovo"] = arrayOf("com.lenovo.leos.appstore")//联想-已测试
marketPkgMap[LE_TV] = arrayOf("com.letv.app.appstore")//乐视
// marketPkgMap[""] = arrayOf()//红魔
// marketPkgMap[""] = arrayOf()//黑鲨
// marketPkgMap[""] = arrayOf()//realme
// marketPkgMap[""] = arrayOf()//海信
// marketPkgMap[SONY] = arrayOf()//索尼
}
Expand Down Expand Up @@ -88,12 +90,12 @@ object MarketHelper {
// val system = SAM_SUNG
val marketPkgArray = marketPkgMap[system]

if (marketPkgMap == null) {
if (marketPkgArray == null) {
return NullPointerException("marketPkgArray is null")
}

var e: Exception? = null
for (marketPkg in marketPkgArray!!) {
for (marketPkg in marketPkgArray) {
val intent = getMarketIntent(system, packageName, marketPkg)
e = startOpen(context, intent)
if (e == null) break
Expand Down

0 comments on commit 1dafccb

Please sign in to comment.