forked from RikkaApps/Shizuku
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
179 lines (159 loc) · 6.08 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
import java.nio.file.Paths
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion rootProject.ext.targetSdkVersion
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "moe.shizuku.privileged.api"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs 'en', 'ar', 'cs', 'de', 'es-rCL', 'b+es+419', 'eo', 'hy', 'ja', 'ko', 'pl', 'pt-rBR', 'ru', 'tr', 'uk', 'zh-rCN', 'zh-rTW'
resValue "string", "versionName", "${rootProject.ext.versionName}"
externalNativeBuild {
cmake {
arguments '-DANDROID_STL=none'
}
}
}
buildFeatures {
viewBinding true
prefab true
}
signingConfigs {
sign
}
buildTypes {
debug {
signingConfig signingConfigs.sign
}
release {
signingConfig signingConfigs.sign
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path 'src/main/jni/CMakeLists.txt'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
useIR = true
}
packagingOptions {
exclude '/META-INF/*.version'
exclude '/META-INF/*.kotlin_module'
exclude '/kotlin/**'
}
lintOptions {
checkReleaseBuilds false
}
dependenciesInfo {
includeInApk false
}
}
def optimizeReleaseResources = task('optimizeReleaseResources').doLast {
def aapt2 = Paths.get(project.android.sdkDirectory.path, 'build-tools', project.android.buildToolsVersion, 'aapt2')
def zip = Paths.get(project.buildDir.path, 'intermediates',
'processed_res', 'release', 'out', "resources-release.ap_")
def optimized = new File("${zip}.opt")
def cmd = exec {
commandLine aapt2, 'optimize', '--collapse-resource-names',
'--shorten-resource-paths',
'--resources-config-path', 'aapt2-resources.cfg',
'-o', optimized, zip
ignoreExitValue false
}
if (cmd.exitValue == 0) {
delete(zip)
optimized.renameTo("$zip")
}
}
tasks.whenTaskAdded { task ->
if (task.name == 'processReleaseResources') {
task.finalizedBy optimizeReleaseResources
}
}
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "shizuku-${variant.versionName}-${variant.name}.apk"
variant.assembleProvider.get().doLast {
def outDir = new File(rootDir, "out")
def mappingDir = new File(outDir, "mapping").absolutePath
def apkDir = new File(outDir, "apk").absolutePath
if (variant.getBuildType().isMinifyEnabled()) {
copy {
from variant.mappingFileProvider.get()
into mappingDir
rename { String fileName -> "mapping-${variant.versionName}.txt" }
}
copy {
from outputFile
into apkDir
}
}
}
}
}
configurations.all {
exclude group: 'androidx.appcompat', module: 'appcompat'
exclude group: 'moe.shizuku.preference', module: 'preference-android'
exclude group: 'moe.shizuku.preference', module: 'preference-simplemenu-android'
}
repositories {
maven {
url 'https://jitpack.io'
content {
includeGroup('com.github.topjohnwu.libsu')
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3"
//compileOnly project(':hidden-api-common')
implementation project(':hidden-api-common-bridge')
implementation project(':server')
implementation project(':starter')
implementation project(':api')
implementation project(':provider')
implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.fragment:fragment-ktx:1.3.3'
implementation 'androidx.recyclerview:recyclerview:1.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'com.github.topjohnwu.libsu:core:3.1.2'
implementation 'dev.rikka.rikkax.appcompat:appcompat:1.2.0-rc01'
implementation 'dev.rikka.rikkax.core:core:1.3.2'
implementation 'dev.rikka.rikkax.material:material:1.6.5'
implementation 'dev.rikka.rikkax.html:html-ktx:1.1.2'
implementation 'dev.rikka.rikkax.recyclerview:recyclerview-adapter:1.2.0'
implementation 'dev.rikka.rikkax.recyclerview:recyclerview-ktx:1.2.1'
implementation 'dev.rikka.rikkax.widget:borderview:1.0.1'
implementation 'dev.rikka.rikkax.preference:simplemenu-preference:1.0.2'
implementation 'io.github.vvb2060.ndk:boringssl:2.1'
implementation 'dev.rikka.ndk.thirdparty:cxx:1.1.0'
implementation 'moe.shizuku.fontprovider:api:10'
implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:1.1'
implementation 'org.bouncycastle:bcpkix-jdk15on:1.68'
implementation 'me.zhanghai.android.appiconloader:appiconloader:1.3.1'
}
apply from: rootProject.file('signing.gradle')