forked from RikkaApps/Shizuku
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
60 lines (55 loc) · 1.66 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
plugins {
id 'com.android.application'
}
android {
namespace 'rikka.shizuku.shell'
defaultConfig {
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
}
buildTypes {
debug {
multiDexEnabled false
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dependenciesInfo {
includeInApk false
}
lint {
checkReleaseBuilds false
}
}
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "shizuku-v${versionName}.apk"
def outDir = new File(rootDir, "out")
def mappingPath = new File(outDir, "mapping").absolutePath
def dexPath = "${rootProject.rootDir.path}/manager/src/main/assets"
variant.assembleProvider.get().doLast {
if (variant.getBuildType().isMinifyEnabled()) {
copy {
from variant.mappingFileProvider.get()
into mappingPath
rename { String fileName ->
mappingPath + File.separator + "cmd-v${variant.versionName}.txt"
}
}
}
copy {
def file = zipTree(file(outputFile)).matching { include 'classes*.dex' }.singleFile
from file
into dexPath
rename { String fileName ->
fileName.replace(file.getName(), "rish_shizuku.dex")
}
}
}
}
}
dependencies {
compileOnly libs.hidden.stub
}