build.gradle.kts 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. import org.jetbrains.kotlin.cli.jvm.main
  2. plugins {
  3. id("com.android.application")
  4. id("org.jetbrains.kotlin.android")
  5. id("com.google.gms.google-services")
  6. id("com.google.firebase.crashlytics")
  7. }
  8. android {
  9. namespace = "com.vpn.fastestvpnservice"
  10. compileSdk = 34
  11. defaultConfig {
  12. applicationId = "com.vpn.fastestvpnservice"
  13. minSdk = 21
  14. targetSdk = 34
  15. versionCode = 1
  16. versionName = "1.0"
  17. testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
  18. ndk {
  19. abiFilters.add("arm64-v8a")
  20. abiFilters.add("armeabi-v7a")
  21. abiFilters.add("x86")
  22. abiFilters.add("x86_64")
  23. }
  24. vectorDrawables {
  25. useSupportLibrary = true
  26. }
  27. }
  28. buildTypes {
  29. release {
  30. isMinifyEnabled = false
  31. proguardFiles(
  32. getDefaultProguardFile("proguard-android-optimize.txt"),
  33. "proguard-rules.pro"
  34. )
  35. }
  36. debug {
  37. isMinifyEnabled = false
  38. proguardFiles(
  39. getDefaultProguardFile("proguard-android-optimize.txt"),
  40. "proguard-rules.pro"
  41. )
  42. }
  43. }
  44. compileOptions {
  45. sourceCompatibility = JavaVersion.VERSION_1_8
  46. targetCompatibility = JavaVersion.VERSION_1_8
  47. }
  48. kotlinOptions {
  49. jvmTarget = "1.8"
  50. }
  51. buildFeatures {
  52. compose = true
  53. }
  54. composeOptions {
  55. kotlinCompilerExtensionVersion = "1.5.1"
  56. }
  57. packaging {
  58. resources {
  59. excludes += "/META-INF/{AL2.0,LGPL2.1}"
  60. }
  61. }
  62. sourceSets {
  63. getByName("main") {
  64. aidl {
  65. srcDirs("src/main/aidl")
  66. }
  67. }
  68. }
  69. buildToolsVersion = "30.0.2"
  70. ndkVersion = "19.2.5345600"
  71. }
  72. dependencies {
  73. implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
  74. implementation("androidx.core:core-ktx:1.12.0")
  75. implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
  76. implementation("androidx.activity:activity-compose:1.8.2")
  77. implementation("androidx.fragment:fragment-ktx:1.6.2")
  78. implementation("androidx.activity:activity-ktx:1.8.2")
  79. implementation(platform("androidx.compose:compose-bom:2023.08.00"))
  80. implementation("androidx.compose.ui:ui")
  81. implementation("androidx.compose.ui:ui-graphics")
  82. implementation("androidx.compose.ui:ui-tooling-preview")
  83. implementation("androidx.compose.material3:material3:1.2.0")
  84. implementation("androidx.compose.material:material:1.6.1")
  85. implementation("androidx.navigation:navigation-compose:2.7.7")
  86. implementation("androidx.compose.material:material-icons-extended:1.6.1")
  87. implementation("androidx.compose.ui:ui-text-google-fonts:1.6.1")
  88. implementation("androidx.compose.foundation:foundation:1.6.3")
  89. // Retrofit
  90. implementation("com.squareup.retrofit2:retrofit:2.9.0")
  91. implementation("com.squareup.retrofit2:converter-gson:2.9.0")
  92. implementation("com.squareup.okhttp3:logging-interceptor:4.9.0")
  93. // Coroutines
  94. implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1")
  95. implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
  96. implementation("androidx.compose.runtime:runtime-livedata:1.6.1")
  97. implementation("com.wireguard.android:tunnel:1.0.20210211")
  98. implementation("androidx.navigation:navigation-fragment:2.7.7")
  99. implementation("androidx.appcompat:appcompat:1.6.1")
  100. implementation("com.google.android.material:material:1.11.0")
  101. implementation("com.google.accompanist:accompanist-pager-indicators:0.30.1")
  102. // Ping
  103. implementation("com.github.stealthcopter:AndroidNetworkTools:0.4.5.3")
  104. // Billing
  105. implementation("com.android.billingclient:billing:6.1.0")
  106. implementation("io.coil-kt:coil-compose:1.3.1")
  107. implementation("com.google.accompanist:accompanist-drawablepainter:0.34.0")
  108. implementation("com.google.firebase:firebase-crashlytics:18.6.2")
  109. implementation("com.google.firebase:firebase-messaging:23.4.1")
  110. implementation("com.google.firebase:firebase-analytics:21.5.1") //16.0.6
  111. // implementation("com.firebase:firebase-jobdispatcher:0.8.5")
  112. implementation("androidx.constraintlayout:constraintlayout-compose:1.0.1")
  113. testImplementation("junit:junit:4.13.2")
  114. androidTestImplementation("androidx.test.ext:junit:1.1.5")
  115. androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
  116. androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00"))
  117. androidTestImplementation("androidx.compose.ui:ui-test-junit4")
  118. debugImplementation("androidx.compose.ui:ui-tooling")
  119. debugImplementation("androidx.compose.ui:ui-test-manifest")
  120. //strongswan
  121. android{
  122. sourceSets {
  123. getByName("main") {
  124. jni.srcDirs(emptyList<String>())
  125. jniLibs.srcDirs("src/main/libs")
  126. }
  127. }
  128. }
  129. tasks.register<Exec>("buildNative") {
  130. workingDir = file("src/main/jni")
  131. commandLine(android.ndkDirectory.absolutePath + "/ndk-build", "-j", Runtime.getRuntime().availableProcessors().toString())
  132. }
  133. tasks.register<Exec>("cleanNative") {
  134. workingDir = file("src/main/jni")
  135. commandLine(android.ndkDirectory.absolutePath + "/ndk-build", "clean")
  136. }
  137. // tasks.withType<JavaCompile> {
  138. // dependsOn("buildNative")
  139. // options.compilerArgs.addAll(listOf("-Xlint:unchecked", "-Xlint:deprecation"))
  140. // }
  141. tasks.getByName("clean").dependsOn("cleanNative")
  142. }