build.gradle
4.33 KB
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
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.huawei.agconnect'
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.naji.one_key"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a'
}
manifestPlaceholders = [
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "27ceb79c44af41ad99202f7a", // NOTE: JPush 上注册的包名对应的 Appkey.
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
HUAWEI_APPID:"101934783",//华为平台注册的appid
XIAOMI_APPKEY : "MI-5811835841457", // 小米平台注册的appkey
XIAOMI_APPID : "MI-2882303761518358457", // 小米平台注册的appid
OPPO_APPKEY : "OP-94d77d10e7bb4c60bcf18a84c8ca8bdd", // OPPO平台注册的appkey
OPPO_APPID : "OP-30260281", // OPPO平台注册的appid
OPPO_APPSECRET: "OP-9b7e372f93794593953f93f118619570",//OPPO平台注册的appsecret
// VIVO_APPKEY : "5811835841457", // VIVO平台注册的appkey
// VIVO_APPID : "2882303761518358457", // VIVO平台注册的appid
]
// manifestPlaceholders = [
// XG_ACCESS_ID : '2100332241',
// XG_ACCESS_KEY : 'A51T8RX1HS1W',
// XG_ACCESS_SCHEME: 'fake_push',// 非官方参数,可自定义,统一打开方式为 intent
// HW_APPID : '100728875',
// XIAOMI_APPID : '2882303761517989384',
// XIAOMI_APPKEY : '5141798993384',
// PACKAGE_NAME : "${applicationId}",// 小米通道
// ]
}
signingConfigs {
release {
storeFile file("./src/main/assets/xiaotao.jks")
storePassword "xt123456"
keyAlias "key0"
keyPassword "xt123456"
}
debug {
storeFile file("./src/main/assets/xiaotao.jks")
storePassword "xt123456"
keyAlias "key0"
keyPassword "xt123456"
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug{
minifyEnabled false
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
//华为推送
implementation 'cn.jiguang.sdk.plugin:huawei:3.5.8'
implementation 'com.huawei.hms:push:3.0.3.301'
//小米推送
implementation 'cn.jiguang.sdk.plugin:xiaomi:3.5.8'
//OPPO推送
implementation 'cn.jiguang.sdk.plugin:oppo:3.5.8'
//
// //vivo推送
// implementation 'cn.jiguang.sdk.plugin:vivo:3.5.8'
}