519 lines
18 KiB
Groovy
519 lines
18 KiB
Groovy
buildscript {
|
||
repositories {
|
||
google()
|
||
// mavenCentral()
|
||
maven { url "https://jitpack.io" }
|
||
maven { url 'https://developer.huawei.com/repo/' }
|
||
maven { url 'https://maven.aliyun.com/repository/central' }
|
||
maven { url "https://maven.aliyun.com/repository/jcenter" }
|
||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||
}
|
||
|
||
dependencies {
|
||
classpath GRADLE_CLASS_PATH
|
||
classpath PROTOBUF_CLASS_PATH
|
||
}
|
||
}
|
||
|
||
allprojects {
|
||
gradle.projectsEvaluated {
|
||
tasks.withType(JavaCompile) {
|
||
options.compilerArgs.add('-Xbootclasspath/p:libs/framework.jar')
|
||
}
|
||
}
|
||
}
|
||
|
||
def appName() {
|
||
return "KuxinLauncher3"
|
||
}
|
||
|
||
def releaseTime() {
|
||
return new Date().format("yyyyMMdd_HHmmss", TimeZone.getDefault())
|
||
}
|
||
|
||
final String ANDROID_TOP = "${rootDir}"
|
||
final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/framework_intermediates/"
|
||
|
||
apply plugin: 'com.android.application'
|
||
apply plugin: 'com.google.protobuf'
|
||
|
||
|
||
android {
|
||
lintOptions {
|
||
checkReleaseBuilds false
|
||
abortOnError false
|
||
}
|
||
|
||
compileSdkVersion COMPILE_SDK
|
||
buildToolsVersion BUILD_TOOLS_VERSION
|
||
|
||
defaultConfig {
|
||
minSdkVersion 26
|
||
targetSdkVersion 28
|
||
|
||
versionCode 24
|
||
versionName "1.2.3"
|
||
|
||
ndk {
|
||
//选择要添加的对应 cpu 类型的 .so 库。
|
||
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||
// 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
|
||
}
|
||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||
vectorDrawables.useSupportLibrary = true
|
||
}
|
||
|
||
//签名
|
||
signingConfigs {
|
||
G10P {
|
||
storeFile file("keystore/G10PMTK11.jks")
|
||
storePassword "123456"
|
||
keyAlias "G10PMTK11"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
U807 {
|
||
storeFile file("keystore/AllwinnerU807.jks")
|
||
storePassword "123456"
|
||
keyAlias "u807"
|
||
keyPassword "123456"
|
||
v2SigningEnabled false
|
||
}
|
||
|
||
iPlay50SE {
|
||
storeFile file("keystore/iPlay50SE.keystore")
|
||
storePassword "123456"
|
||
keyAlias "iplay50se"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
teclast8183 {
|
||
storeFile file("keystore/TeclastMTK12.jks")
|
||
storePassword "123456"
|
||
keyAlias "TeclastMTK12"
|
||
keyPassword "123456"
|
||
v2SigningEnabled false
|
||
}
|
||
|
||
UnisocS6688 {
|
||
storeFile file("keystore/UnisocS6688Userdebug.jks")
|
||
storePassword "123456"
|
||
keyAlias "unisocs6688userdebug"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
Aigo1071 {
|
||
storeFile file("keystore/Aigo1071.jks")
|
||
storePassword "123456"
|
||
keyAlias "aigo1071"
|
||
keyPassword "123456"
|
||
v1SigningEnabled true
|
||
v2SigningEnabled true
|
||
}
|
||
|
||
W5A {
|
||
storeFile file("keystore/Unisoc_W5A.jks")
|
||
storePassword "123456"
|
||
keyAlias "Unisoc_W5A"
|
||
keyPassword "123456"
|
||
v2SigningEnabled false
|
||
}
|
||
}
|
||
|
||
buildTypes {
|
||
W5ADebug.initWith(debug)
|
||
W5ADebug {
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.W5A
|
||
buildConfigField "String", "platform", '"YKWA5E"'
|
||
manifestPlaceholders = [
|
||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||
]
|
||
}
|
||
|
||
W5ARelease.initWith(release)
|
||
W5ARelease {
|
||
signingConfig signingConfigs.W5A
|
||
buildConfigField "String", "platform", '"YKWA5E"'
|
||
manifestPlaceholders = [
|
||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||
]
|
||
}
|
||
|
||
Aigo1071Debug.initWith(debug)
|
||
Aigo1071Debug {
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.Aigo1071
|
||
buildConfigField "String", "platform", '"W8183"'
|
||
}
|
||
|
||
Aigo1071Release.initWith(release)
|
||
Aigo1071Release {
|
||
signingConfig signingConfigs.Aigo1071
|
||
buildConfigField "String", "platform", '"W8183"'
|
||
}
|
||
|
||
UnisocS6688Debug.initWith(debug)
|
||
UnisocS6688Debug {
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.UnisocS6688
|
||
buildConfigField "String", "platform", '"S6688"'
|
||
}
|
||
|
||
UnisocS6688Release.initWith(release)
|
||
UnisocS6688Release {
|
||
signingConfig signingConfigs.UnisocS6688
|
||
buildConfigField "String", "platform", '"S6688"'
|
||
}
|
||
|
||
teclast8183Debug.initWith(debug)
|
||
teclast8183Debug {
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.teclast8183
|
||
buildConfigField "String", "platform", '"A11MTK8183"'
|
||
}
|
||
|
||
teclast8183Release.initWith(release)
|
||
teclast8183Release {
|
||
signingConfig signingConfigs.teclast8183
|
||
buildConfigField "String", "platform", '"A11MTK8183"'
|
||
}
|
||
|
||
G10PDebug.initWith(debug)
|
||
G10PDebug {
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.G10P
|
||
buildConfigField "String", "platform", '"G10P"'
|
||
}
|
||
|
||
G10PRelease.initWith(release)
|
||
G10PRelease {
|
||
signingConfig signingConfigs.G10P
|
||
buildConfigField "String", "platform", '"G10P"'
|
||
}
|
||
|
||
U807Debug.initWith(debug)
|
||
U807Debug {
|
||
buildConfigField "String", "platform", '"U807"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.U807
|
||
}
|
||
|
||
U807Release.initWith(release)
|
||
U807Release {
|
||
buildConfigField "String", "platform", '"U807"'
|
||
signingConfig signingConfigs.U807
|
||
}
|
||
|
||
iPlay50SEDebug.initWith(debug)
|
||
iPlay50SEDebug {
|
||
buildConfigField "String", "platform", '"iPaly50SE"'
|
||
versionNameSuffix "-debug"
|
||
debuggable true
|
||
signingConfig signingConfigs.iPlay50SE
|
||
}
|
||
|
||
iPlay50SERelease.initWith(release)
|
||
iPlay50SERelease {
|
||
buildConfigField "String", "platform", '"iPaly50SE"'
|
||
signingConfig signingConfigs.iPlay50SE
|
||
}
|
||
|
||
debug {
|
||
buildConfigField "String", "platform", '"MTK"'
|
||
debuggable true
|
||
versionNameSuffix "-debug"
|
||
minifyEnabled false
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
//Zipalign优化
|
||
zipAlignEnabled true
|
||
signingConfig signingConfigs.U807
|
||
applicationVariants.all { variant ->
|
||
variant.outputs.each { output ->
|
||
def outputFile = output.outputFile
|
||
if (outputFile != null) {
|
||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${productFlavors[0].name}.apk"
|
||
output.outputFileName = fileName
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
release {
|
||
buildConfigField "String", "platform", '"MTK"'
|
||
//混淆
|
||
minifyEnabled false
|
||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
//Zipalign优化
|
||
zipAlignEnabled true
|
||
//签名
|
||
signingConfig signingConfigs.U807
|
||
//将release版本的包名重命名,加上版本及日期
|
||
applicationVariants.all { variant ->
|
||
variant.outputs.each { output ->
|
||
def outputFile = ""
|
||
if (outputFile != null) {
|
||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${productFlavors[0].name}-${buildType.name}.apk"
|
||
output.outputFileName = fileName
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_1_8
|
||
targetCompatibility JavaVersion.VERSION_1_8
|
||
}
|
||
|
||
// The flavor dimensions for build variants (e.g. aospWithQuickstep, aospWithoutQuickstep)
|
||
// See: https://developer.android.com/studio/build/build-variants#flavor-dimensions
|
||
flavorDimensions "app", "recents"
|
||
|
||
productFlavors {
|
||
aosp {
|
||
dimension "app"
|
||
applicationId 'com.uiuipad.os'
|
||
testApplicationId 'com.uiuipad.os.tests'
|
||
}
|
||
|
||
/*hide l3go*/
|
||
// l3go {
|
||
// dimension "app"
|
||
// applicationId 'com.uiuipad.os'
|
||
// testApplicationId 'com.uiuipad.os.tests'
|
||
// }
|
||
|
||
/*withQuickstep {
|
||
dimension "recents"
|
||
|
||
minSdkVersion 28
|
||
}
|
||
|
||
withQuickstepIconRecents {
|
||
dimension "recents"
|
||
|
||
minSdkVersion 28
|
||
}*/
|
||
|
||
withoutQuickstep {
|
||
dimension "recents"
|
||
}
|
||
}
|
||
|
||
// Disable release builds for now
|
||
// android.variantFilter { variant ->
|
||
// if (variant.buildType.name.endsWith('release')) {
|
||
// variant.setIgnore(true)
|
||
// }
|
||
//
|
||
// // Icon recents is Go only
|
||
// if (name.contains("WithQuickstepIconRecents") && !name.contains("l3go")) {
|
||
// variant.setIgnore(true)
|
||
// }
|
||
// }
|
||
|
||
sourceSets {
|
||
main {
|
||
res.srcDirs = ['res']
|
||
java.srcDirs = ['src', 'src_plugins']
|
||
manifest.srcFile 'AndroidManifest-common.xml'
|
||
proto {
|
||
srcDir 'protos/'
|
||
srcDir 'proto_overrides/'
|
||
}
|
||
}
|
||
|
||
debug {
|
||
manifest.srcFile "AndroidManifest.xml"
|
||
}
|
||
|
||
androidTest {
|
||
res.srcDirs = ['tests/res']
|
||
java.srcDirs = ['tests/src', 'tests/tapl']
|
||
manifest.srcFile "tests/AndroidManifest-common.xml"
|
||
}
|
||
|
||
androidTestDebug {
|
||
manifest.srcFile "tests/AndroidManifest.xml"
|
||
}
|
||
|
||
aosp {
|
||
java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
|
||
manifest.srcFile "AndroidManifest.xml"
|
||
}
|
||
|
||
/*hide l3go*/
|
||
// l3go {
|
||
// res.srcDirs = ['go/res']
|
||
// java.srcDirs = ['go/src']
|
||
// manifest.srcFile "go/AndroidManifest.xml"
|
||
// }
|
||
|
||
withoutQuickstep {
|
||
java.srcDirs = ['src_ui_overrides']
|
||
}
|
||
|
||
/*withQuickstep {
|
||
res.srcDirs = ['quickstep/res', 'quickstep/recents_ui_overrides/res']
|
||
java.srcDirs = ['quickstep/src', 'quickstep/recents_ui_overrides/src']
|
||
manifest.srcFile "quickstep/AndroidManifest.xml"
|
||
}
|
||
|
||
withQuickstepIconRecents {
|
||
res.srcDirs = ['quickstep/res', 'go/quickstep/res']
|
||
java.srcDirs = ['quickstep/src', 'go/quickstep/src']
|
||
manifest.srcFile "quickstep/AndroidManifest.xml"
|
||
}*/
|
||
}
|
||
}
|
||
|
||
repositories {
|
||
maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
|
||
maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
|
||
google()
|
||
// mavenCentral()
|
||
maven { url "https://jitpack.io" }
|
||
maven { url 'https://developer.huawei.com/repo/' }
|
||
maven { url 'https://maven.aliyun.com/repository/central' }
|
||
maven { url "https://maven.aliyun.com/repository/jcenter" }
|
||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||
}
|
||
|
||
dependencies {
|
||
compileOnly files('libs/framework.jar')
|
||
implementation files('libs/vendor.mediatek.hardware.nvram-V1.0-java.jar')
|
||
implementation project(path: ':niceimageview')
|
||
|
||
implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
|
||
implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
|
||
implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
|
||
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
|
||
implementation project(':IconLoader')
|
||
implementation fileTree(dir: "${ANDROID_TOP}/libs", include: 'launcher_protos.jar')
|
||
|
||
// Recents lib dependency
|
||
//withQuickstepImplementation fileTree(dir: "${ANDROID_TOP}/libs", include: 'sysui_shared.jar')
|
||
|
||
// Recents lib dependency for Go
|
||
//withQuickstepIconRecentsImplementation fileTree(dir: "${ANDROID_TOP}/libs", include: 'sysui_shared.jar')
|
||
|
||
// Required for AOSP to compile. This is already included in ANDROID_TOP sysui_shared.jar
|
||
implementation 'androidx.appcompat:appcompat:1.3.0'
|
||
withoutQuickstepImplementation fileTree(dir: "${ANDROID_TOP}/libs", include: 'plugin_core.jar')
|
||
|
||
testImplementation 'junit:junit:4.12'
|
||
androidTestImplementation "org.mockito:mockito-core:1.9.5"
|
||
androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
|
||
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
|
||
androidTestImplementation 'com.android.support.test:runner:1.0.0'
|
||
androidTestImplementation 'com.android.support.test:rules:1.0.0'
|
||
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
|
||
androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
|
||
//OkHttp
|
||
implementation 'com.squareup.okhttp3:okhttp:4.9.2'
|
||
//RxJava
|
||
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
|
||
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
|
||
//Retrofit
|
||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||
implementation 'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
|
||
// gson converter
|
||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||
// 标准转换器,去掉 Retrofit以Mutipart上传参数时,String参数会多一对双引号
|
||
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||
//生命周期管理
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-android:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-components:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-components-preference:4.0.2'
|
||
implementation 'com.trello.rxlifecycle4:rxlifecycle-android-lifecycle:4.0.2'
|
||
//gson
|
||
implementation 'com.google.code.gson:gson:2.9.0'
|
||
//bindView
|
||
implementation 'com.jakewharton:butterknife:10.2.3'
|
||
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
|
||
//磁盘缓存
|
||
implementation 'com.jakewharton:disklrucache:2.0.2'
|
||
//mmkv
|
||
implementation 'com.tencent:mmkv-static:1.2.13'
|
||
//阿里云推送
|
||
implementation 'com.aliyun.ams:alicloud-android-push:3.8.0'
|
||
//下载
|
||
implementation 'me.laoyuyu.aria:core:3.8.16'
|
||
annotationProcessor 'me.laoyuyu.aria:compiler:3.8.16'
|
||
//工具类
|
||
implementation 'com.blankj:utilcodex:1.31.0'
|
||
implementation 'com.tencent.bugly:crashreport:4.1.9.2'
|
||
implementation 'com.iqiyi.xcrash:xcrash-android-lib:3.0.0'
|
||
//状态栏透明
|
||
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
|
||
implementation 'com.facebook.rebound:rebound:0.3.8'
|
||
//videoplayer
|
||
implementation 'cn.jzvd:jiaozivideoplayer:7.7.0'
|
||
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-core:1.0.16'
|
||
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native:1.0.16'
|
||
//glide
|
||
implementation 'com.github.bumptech.glide:glide:4.13.1'
|
||
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.1'
|
||
}
|
||
|
||
preBuild {
|
||
doLast {
|
||
def imlFile = file(project.name + ".iml")
|
||
println 'Change ' + project.name + '.iml order'
|
||
try {
|
||
def parsedXml = (new XmlParser()).parse(imlFile)
|
||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||
parsedXml.component[1].remove(jdkNode)
|
||
def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform"
|
||
println 'what' + sdkString
|
||
new Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK'])
|
||
groovy.xml.XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile))
|
||
} catch (FileNotFoundException e) {
|
||
// nop, iml not found
|
||
println "no iml found"
|
||
}
|
||
}
|
||
//https://www.pianshen.com/article/93481144911/
|
||
//https://blog.csdn.net/dhl_1986/article/details/102856026
|
||
//使用系统编译后的framework.jar
|
||
}
|
||
|
||
protobuf {
|
||
// Configure the protoc executable
|
||
protoc {
|
||
artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
|
||
|
||
generateProtoTasks {
|
||
all().each { task ->
|
||
task.builtins {
|
||
remove java
|
||
javanano {
|
||
option "java_package=launcher_log_extension.proto|com.uiuipad.os.userevent.nano"
|
||
option "java_package=launcher_log.proto|com.uiuipad.os.userevent.nano"
|
||
option "java_package=launcher_dump.proto|com.uiuipad.os.model.nano"
|
||
option "enum_style=java"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|