-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathandroid_market.dart
246 lines (189 loc) · 6.55 KB
/
android_market.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
import 'dart:convert';
import 'dart:typed_data';
/// @Describe: Android Application market
///
/// @Author: LiWeNHuI
/// @Date: 2022/1/17
class AndroidMarket {
AndroidMarket({
this.isGooglePlay = false,
this.isHuawei = false,
this.isHonor = false,
this.isXiaomi = false,
this.isOppo = false,
this.isVivo = false,
this.isMeizu = false,
this.isZte = false,
this.isSamsung = false,
this.isLenovo = false,
this.isNubia = false,
this.isTencent = false,
this.is360 = false,
this.isBaidu = false,
this.isWanDouJia = false,
this.is91 = false,
this.isPp = false,
this.isAnZhi = false,
this.isYingYongHui = false,
this.isCool = false,
this.isMM = false,
});
late bool isGooglePlay;
late bool isHuawei;
late bool isHonor;
late bool isXiaomi;
late bool isOppo;
late bool isVivo;
late bool isMeizu;
late bool isZte;
late bool isSamsung;
late bool isLenovo;
late bool isNubia;
late bool isTencent;
late bool is360;
late bool isBaidu;
late bool isWanDouJia;
late bool is91;
late bool isPp;
late bool isAnZhi;
late bool isYingYongHui;
late bool isCool;
late bool isMM;
/// Google Play Store - https://play.google.com/
static const String MARKET_GOOGLE = 'com.android.vending';
/// 华为 - 华为应用市场 - http://app.hicloud.com/
static const String MARKET_HUAWEI = 'com.huawei.appmarket';
/// 荣耀 - 荣耀应用市场 - http://app.hicloud.com/
static const String MARKET_HONOR = 'com.hihonor.appmarket';
/// 小米 - 小米应用商店 - https://app.mi.com/
static const String MARKET_XIAOMI = 'com.xiaomi.market';
/// OPPO/realme/OnePlus - OPPO软件商店(Android 9及以下) - https://store.oppomobile.com/
static const String MARKET_OPPO = 'com.oppo.market';
/// OPPO/realme/OnePlus - OPPO软件商店(Android 9及以上,新版本,支持全家桶手机)- https://store.oppomobile.com/
static const String MARKET_OPPO_NEW = 'com.heytap.market';
/// vivo/iqoo - vivo应用商店 - http://zs.vivo.com.cn/
static const String MARKET_VIVO = 'com.bbk.appstore';
/// 魅族 - 魅族应用商店 - http://app.flyme.cn/
static const String MARKET_MEIZU = 'com.meizu.mstore';
/// ZTE - 中兴应用商店 - https://apps.ztems.com/
static const String MARKET_ZTE = 'zte.com.market';
/// Samsung - 三星应用商店 - https://seller.samsungapps.com/
static const String MARKET_SANSUNG = 'com.sec.android.app.samsungapps';
/// Lenovo - 联想应用中心 - https://www.lenovomm.com/
static const String MARKET_LENOVO = 'com.lenovo.leos.appstore';
/// 努比亚 - 努比亚应用中心 - https://ui.nubia.cn/app/
static const String MARKET_NUBIA = 'cn.nubia.neostore';
/// 腾讯 - 应用宝 - https://sj.qq.com/
static const String MARKET_TENCENT = 'com.tencent.android.qqdownloader';
/// 360 - 360手机助手 - http://zhushou.360.cn/
static const String MARKET_360 = 'com.qihoo.appstore';
/// 百度 - 百度手机助手 - https://shouji.baidu.com/
static const String MARKET_BAIDU = 'com.baidu.appsearch';
/// 阿里 - 豌豆荚 - https://www.wandoujia.com/
static const String MARKET_WANDOUJIA = 'com.wandoujia.phoenix2';
/// 91手机助手 - http://zs.91.com/
static const String MARKET_91 = 'com.dragon.android.pandaspace';
/// 阿里 - PP助手 - https://www.25pp.com/
static const String MARKET_PP = 'com.pp.assistant';
/// 安智 - 安智市场 - http://www.anzhi.com/
static const String MARKET_ANZHI = 'cn.goapk.market';
/// 掌汇天下 - 应用汇 - http://www.appchina.com/
static const String MARKET_YINGYONGHUI = 'com.yingyonghui.market';
/// 酷安 - https://www.coolapk.com/
static const String MARKET_COOL = 'com.coolapk.market';
/// 移动 - MM应用商城 - http://mm.10086.cn/store
static const String MARKET_MM = 'com.aspire.mm';
/// Gets a list of package names set to `true'
List<String> toMarkets() {
final List<String> markets = <String>[];
if (isGooglePlay) markets.add(MARKET_GOOGLE);
if (isHuawei) markets.add(MARKET_HUAWEI);
if (isHonor) markets.add(MARKET_HONOR);
if (isXiaomi) markets.add(MARKET_XIAOMI);
if (isOppo) {
markets
..add(MARKET_OPPO)
..add(MARKET_OPPO_NEW);
}
if (isVivo) markets.add(MARKET_VIVO);
if (isMeizu) markets.add(MARKET_MEIZU);
if (isZte) markets.add(MARKET_ZTE);
if (isSamsung) markets.add(MARKET_SANSUNG);
if (isLenovo) markets.add(MARKET_LENOVO);
if (isNubia) markets.add(MARKET_NUBIA);
if (isTencent) markets.add(MARKET_TENCENT);
if (is360) markets.add(MARKET_360);
if (isBaidu) markets.add(MARKET_BAIDU);
if (isWanDouJia) markets.add(MARKET_WANDOUJIA);
if (is91) markets.add(MARKET_91);
if (isPp) markets.add(MARKET_PP);
if (isAnZhi) markets.add(MARKET_ANZHI);
if (isYingYongHui) markets.add(MARKET_YINGYONGHUI);
if (isCool) markets.add(MARKET_COOL);
if (isMM) markets.add(MARKET_MM);
return markets;
}
/// Google Play
static AndroidMarket get gp => AndroidMarket(isGooglePlay: true);
/// 华为、小米、oppo、vivo
static AndroidMarket get hmov => AndroidMarket(
isHuawei: true,
isXiaomi: true,
isOppo: true,
isVivo: true,
);
/// 国内厂商
static AndroidMarket get chn => AndroidMarket(
isHuawei: true,
isXiaomi: true,
isOppo: true,
isVivo: true,
isMeizu: true,
isZte: true,
isSamsung: true,
isLenovo: true,
isNubia: true,
);
/// ALL true
static AndroidMarket get allTrue => AndroidMarket(
isGooglePlay: true,
isHuawei: true,
isXiaomi: true,
isOppo: true,
isVivo: true,
isMeizu: true,
isZte: true,
isSamsung: true,
isLenovo: true,
isNubia: true,
isTencent: true,
is360: true,
isBaidu: true,
isWanDouJia: true,
is91: true,
isPp: true,
isAnZhi: true,
isYingYongHui: true,
isCool: true,
isMM: true,
);
}
/// Software information in the Android application market
class AndroidMarketModel {
AndroidMarketModel({
this.packageName,
this.showName,
this.icon,
});
AndroidMarketModel.fromJson(Map<dynamic, dynamic> json) {
packageName = json['packageName'] as String?;
showName = json['showName'] as String?;
icon = base64Decode(json['icon'].toString());
}
/// The name of the software.
String? showName;
/// The name of the package of the software.
String? packageName;
/// The icon of software.
Uint8List? icon;
}