build.gradle.kts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. plugins {
  2. id("com.android.application")
  3. id("kotlin-android")
  4. // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
  5. id("dev.flutter.flutter-gradle-plugin")
  6. }
  7. android {
  8. namespace = "app.revanced.manager.flutter"
  9. compileSdk = 35
  10. ndkVersion = "27.0.12077973"
  11. compileOptions {
  12. isCoreLibraryDesugaringEnabled = true
  13. sourceCompatibility = JavaVersion.VERSION_17
  14. targetCompatibility = JavaVersion.VERSION_17
  15. }
  16. kotlinOptions {
  17. jvmTarget = JavaVersion.VERSION_17.toString()
  18. }
  19. defaultConfig {
  20. applicationId = "app.revanced.manager.flutter"
  21. minSdk = 26
  22. targetSdk = 35
  23. versionCode = flutter.versionCode
  24. versionName = flutter.versionName
  25. resValue("string", "app_name", "ReVanced Manager")
  26. }
  27. applicationVariants.all {
  28. outputs.all {
  29. this as com.android.build.gradle.internal.api.ApkVariantOutputImpl
  30. outputFileName = "revanced-manager-$versionName.apk"
  31. }
  32. }
  33. buildTypes {
  34. configureEach {
  35. isShrinkResources = false
  36. isMinifyEnabled = false
  37. signingConfig = signingConfigs["debug"]
  38. ndk.abiFilters += setOf("armeabi-v7a", "arm64-v8a", "x86_64")
  39. }
  40. release {
  41. isShrinkResources = true
  42. isMinifyEnabled = true
  43. val keystoreFile = file("keystore.jks")
  44. if (keystoreFile.exists()) {
  45. signingConfig = signingConfigs.create("release") {
  46. storeFile = keystoreFile
  47. storePassword = System.getenv("KEYSTORE_PASSWORD")
  48. keyAlias = System.getenv("KEYSTORE_ENTRY_ALIAS")
  49. keyPassword = System.getenv("KEYSTORE_ENTRY_PASSWORD")
  50. }
  51. resValue("string", "app_name", "ReVanced Manager")
  52. } else {
  53. applicationIdSuffix = ".debug"
  54. signingConfig = signingConfigs["debug"]
  55. resValue("string", "app_name", "ReVanced Manager (Debug signed)")
  56. }
  57. }
  58. debug {
  59. applicationIdSuffix = ".debug"
  60. resValue("string", "app_name", "ReVanced Manager (Debug)")
  61. }
  62. }
  63. packaging {
  64. jniLibs {
  65. useLegacyPackaging = true
  66. excludes.add("/prebuilt/**")
  67. }
  68. resources {
  69. excludes.add("/prebuilt/**")
  70. }
  71. }
  72. }
  73. flutter {
  74. source = "../.."
  75. }
  76. dependencies {
  77. coreLibraryDesugaring(libs.desugar.jdk.libs) // https://pub.dev/packages/flutter_local_notifications#gradle-setup
  78. implementation(libs.revanced.patcher)
  79. implementation(libs.revanced.library)
  80. }