-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
231 lines (189 loc) · 7.76 KB
/
build.gradle
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
/*
* This file is part of Blokada.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* Copyright © 2021 Blocka AB. All rights reserved.
*
* @author Karol Gusak ([email protected])
*/
plugins {
id 'com.android.application'
id 'kotlin-android'
}
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: "kotlin-kapt"
android {
compileSdkVersion 33
ndkVersion "24.0.8215888"
buildFeatures {
buildConfig = true
dataBinding = true
viewBinding = true
}
defaultConfig {
applicationId "org.blokada" // Not a real name, see flavors below
minSdkVersion 28
targetSdkVersion 31
versionCode 666230102
versionName "23.1.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
}
}
buildTypes {
debug {
// By default it is a 'debuggable' build, signed with a debug key.
}
release {
def f = rootProject.file('keystore.properties')
if (f.exists()) {
println "Release build will use Blokada keystore"
Properties props = new Properties()
InputStream inputStream = new FileInputStream(f)
props.load(inputStream)
inputStream.close()
signingConfigs {
release {
storeFile rootProject.file(props['BLOKADA_KEY_PATH'])
storePassword props['BLOKADA_STORE_PASSWORD']
keyAlias 'blokada'
keyPassword props['BLOKADA_KEY_PASSWORD']
}
}
signingConfig signingConfigs.release
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
beta {
// 'Beta' are builds used for internal and external beta testing.
initWith(release)
matchingFallbacks = ['release']
debuggable = true
minifyEnabled false
}
}
// It needs to be defined in order for the flavor setup to work.
flavorDimensions("model")
productFlavors {
five {
// Blokada 5 lands on blokada.org, and secondary app stores (Samsung, Huawei)
applicationId "org.blokada.origin.alarm"
minSdkVersion 21
}
googleslim {
// googleslim is a legacy "Slim" build that got banned from Google Play.
// It'll be phased out eventually once users are migrated away.
applicationId "org.blokada.alarm.dnschanger"
minSdkVersion 21
}
escaped {
// escaped build can be installed on top of googleslim build to get all features.
applicationId "org.blokada.alarm.dnschanger"
minSdkVersion 21
}
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/legacy/kotlin'
main.java.srcDirs += 'src/engine/kotlin'
main.jniLibs.srcDirs += 'src/engine/jniLibs'
debug.java.srcDirs += 'src/mock/kotlin'
googleslim.res.srcDirs += 'src/google/res'
googleslim.java.srcDirs += 'src/google/kotlin'
googleslim.java.srcDirs += 'src/libre/kotlin'
googleslim.assets.srcDirs += 'src/libre/assets'
googleslim.jniLibs.srcDirs += 'src/libre/jniLibs'
googleslim.res.srcDirs += 'src/libre/res'
googleslim.manifest.srcFile 'src/google/AndroidManifest.xml'
five.res.srcDirs += 'src/notgoogle/res'
five.java.srcDirs += 'src/notgoogle/kotlin'
five.java.srcDirs += 'src/libre/kotlin'
five.assets.srcDirs += 'src/libre/assets'
five.jniLibs.srcDirs += 'src/libre/jniLibs'
five.manifest.srcFile 'src/libre/AndroidManifest.xml'
five.res.srcDirs += 'src/libre/res'
escaped.res.srcDirs += 'src/notgoogle/res'
escaped.java.srcDirs += 'src/notgoogle/kotlin'
escaped.java.srcDirs += 'src/libre/kotlin'
escaped.assets.srcDirs += 'src/libre/assets'
escaped.jniLibs.srcDirs += 'src/libre/jniLibs'
escaped.manifest.srcFile 'src/libre/AndroidManifest.xml'
escaped.res.srcDirs += 'src/libre/res'
// Do not include translations in debug builds (does not clutter search during development)
release.res.srcDirs += 'src/translations/res'
beta.res.srcDirs += 'src/translations/res'
}
}
dependencies {
// forgot what is it for
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
// androidx and kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.7.0"
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.8.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
//implementation 'androidx.navigation:navigation-fragment:2.4.1'
//implementation 'androidx.navigation:navigation-ui:2.4.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.browser:browser:1.4.0'
implementation 'androidx.webkit:webkit:1.5.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'
// json
implementation 'com.squareup.moshi:moshi:1.13.0'
implementation 'com.squareup.moshi:moshi-adapters:1.13.0'
kapt("com.squareup.moshi:moshi-kotlin-codegen:1.13.0")
// http and rest
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.9'
// dynamic translations
implementation 'com.akexorcist:localization:1.2.9'
// engine deps
implementation 'org.pcap4j:pcap4j-core:1.7.7'
implementation 'org.pcap4j:pcap4j-packetfactory-propertiesbased:1.7.7'
implementation 'dnsjava:dnsjava:2.1.9'
implementation 'org.slf4j:slf4j-nop:1.6.1'
// unzip default blocklist
implementation 'net.lingala.zip4j:zip4j:2.6.4'
// External integration (Tasker)
implementation 'com.twofortyfouram:android-plugin-client-sdk-for-locale:4.0.3'
// Google in app billing
implementation 'com.android.billingclient:billing:5.1.0'
implementation 'com.android.billingclient:billing-ktx:5.1.0'
// Hopefully normal date api?
implementation 'net.danlew:android.joda:2.10.14'
// Biometric api to protect account id
implementation "androidx.biometric:biometric-ktx:1.2.0-alpha05"
// test deps
testImplementation 'junit:junit:'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
// legacy (for import of v4 settings)
implementation 'io.paperdb:paperdb:2.7.1'
}
apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
cargo {
module = "../blocka_engine"
libname = "blocka_dns"
targets = ["arm", "arm64", "x86", "x86_64"]
profile = "release"
}