/* * This file is part of LSPosed. * * LSPosed is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * LSPosed is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LSPosed. If not, see . * * Copyright (C) 2021 LSPosed Contributors */ import java.time.Instant plugins { id("com.android.application") id("androidx.navigation.safeargs") id("dev.rikka.tools.autoresconfig") id("dev.rikka.tools.materialthemebuilder") } val defaultManagerPackageName: String by rootProject.extra val androidStoreFile: String? by rootProject val androidStorePassword: String? by rootProject val androidKeyAlias: String? by rootProject val androidKeyPassword: String? by rootProject android { buildFeatures { viewBinding = true buildConfig = true } defaultConfig { applicationId = defaultManagerPackageName buildConfigField("long", "BUILD_TIME", Instant.now().epochSecond.toString()) } packagingOptions { resources { excludes += "META-INF/**" excludes += "okhttp3/**" excludes += "kotlin/**" excludes += "org/**" excludes += "**.properties" excludes += "**.bin" } } dependenciesInfo.includeInApk = false signingConfigs { create("config") { androidStoreFile?.also { storeFile = rootProject.file(it) storePassword = androidStorePassword keyAlias = androidKeyAlias keyPassword = androidKeyPassword } } } buildTypes { signingConfigs.named("config").get().also { debug { if (it.storeFile?.exists() == true) signingConfig = it } release { signingConfig = if (it.storeFile?.exists() == true) it else signingConfigs.named("debug").get() isMinifyEnabled = true isShrinkResources = true proguardFiles("proguard-rules.pro") } } } sourceSets { named("main") { res { srcDirs("src/common/res") } } } namespace = "org.lsposed.manager" } autoResConfig { generateClass.set(true) generateRes.set(false) generatedClassFullName.set("org.lsposed.manager.util.LangList") generatedArrayFirstItem.set("SYSTEM") } materialThemeBuilder { themes { for ((name, color) in listOf( "Red" to "F44336", "Pink" to "E91E63", "Purple" to "9C27B0", "DeepPurple" to "673AB7", "Indigo" to "3F51B5", "Blue" to "2196F3", "LightBlue" to "03A9F4", "Cyan" to "00BCD4", "Teal" to "009688", "Green" to "4FAF50", "LightGreen" to "8BC3A4", "Lime" to "CDDC39", "Yellow" to "FFEB3B", "Amber" to "FFC107", "Orange" to "FF9800", "DeepOrange" to "FF5722", "Brown" to "795548", "BlueGrey" to "607D8F", "Sakura" to "FF9CA8" )) { create("Material$name") { lightThemeFormat = "ThemeOverlay.Light.%s" darkThemeFormat = "ThemeOverlay.Dark.%s" primaryColor = "#$color" } } } // Add Material Design 3 color tokens (such as palettePrimary100) in generated theme // rikka.material >= 2.0.0 provides such attributes generatePalette = true } dependencies { val glideVersion = "4.14.2" val navVersion: String by project annotationProcessor("com.github.bumptech.glide:compiler:$glideVersion") implementation("androidx.activity:activity:1.6.1") implementation("androidx.browser:browser:1.4.0") implementation("androidx.constraintlayout:constraintlayout:2.1.4") implementation("androidx.core:core:1.9.0") implementation("androidx.fragment:fragment:1.5.4") implementation("androidx.navigation:navigation-fragment:$navVersion") implementation("androidx.navigation:navigation-ui:$navVersion") implementation("androidx.preference:preference:1.2.0") implementation("androidx.recyclerview:recyclerview:1.2.1") implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01") implementation("com.github.bumptech.glide:glide:$glideVersion") implementation("com.google.android.material:material:1.7.0") implementation("com.google.code.gson:gson:2.10") implementation(platform("com.squareup.okhttp3:okhttp-bom:4.10.0")) implementation("com.squareup.okhttp3:okhttp") implementation("com.squareup.okhttp3:okhttp-dnsoverhttps") implementation("com.squareup.okhttp3:logging-interceptor") implementation("dev.rikka.rikkax.appcompat:appcompat:1.5.0.1") implementation("dev.rikka.rikkax.core:core:1.4.1") implementation("dev.rikka.rikkax.insets:insets:1.3.0") implementation("dev.rikka.rikkax.material:material:2.5.1") implementation("dev.rikka.rikkax.material:material-preference:2.0.0") implementation("dev.rikka.rikkax.preference:simplemenu-preference:1.0.3") implementation("dev.rikka.rikkax.recyclerview:recyclerview-ktx:1.3.1") implementation("dev.rikka.rikkax.widget:borderview:1.1.0") implementation("dev.rikka.rikkax.widget:mainswitchbar:1.0.2") implementation("dev.rikka.rikkax.layoutinflater:layoutinflater:1.2.0") implementation("me.zhanghai.android.appiconloader:appiconloader:1.5.0") implementation("org.lsposed.hiddenapibypass:hiddenapibypass:4.3") implementation(projects.services.managerService) val appCenter = "4.4.5" debugImplementation("com.microsoft.appcenter:appcenter-crashes:${appCenter}") debugImplementation("com.microsoft.appcenter:appcenter-analytics:${appCenter}") } configurations.all { exclude("org.jetbrains", "annotations") exclude("androidx.appcompat", "appcompat") exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk7") exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk8") }