|
|
|
|
@ -1,3 +1,6 @@
|
|
|
|
|
import java.io.FileOutputStream
|
|
|
|
|
import kotlin.random.Random
|
|
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
|
alias(libs.plugins.android.library)
|
|
|
|
|
alias(libs.plugins.kotlin.android)
|
|
|
|
|
@ -5,9 +8,8 @@ plugins {
|
|
|
|
|
|
|
|
|
|
android {
|
|
|
|
|
namespace = "com.example.lib"
|
|
|
|
|
compileSdk {
|
|
|
|
|
version = release(36)
|
|
|
|
|
}
|
|
|
|
|
compileSdk = 34
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
buildFeatures {
|
|
|
|
|
buildConfig = true
|
|
|
|
|
@ -29,7 +31,7 @@ android {
|
|
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
|
release {
|
|
|
|
|
isMinifyEnabled = false
|
|
|
|
|
isMinifyEnabled = true
|
|
|
|
|
proguardFiles(
|
|
|
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
|
|
|
"proguard-rules.pro"
|
|
|
|
|
@ -38,12 +40,12 @@ android {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
|
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kotlinOptions {
|
|
|
|
|
jvmTarget = "11"
|
|
|
|
|
jvmTarget = "1.8"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -54,7 +56,38 @@ dependencies {
|
|
|
|
|
testImplementation(libs.junit)
|
|
|
|
|
androidTestImplementation(libs.runner)
|
|
|
|
|
androidTestImplementation(libs.espresso.core)
|
|
|
|
|
implementation("com.squareup.okhttp3:okhttp:5.2.1")
|
|
|
|
|
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2")
|
|
|
|
|
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
|
|
|
|
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.0")
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasks.register("generateProguardDic") {
|
|
|
|
|
val dic = "qwertyuiopasdfghjklzxcvbnm"
|
|
|
|
|
val chars: CharArray = dic.toCharArray()
|
|
|
|
|
chars.shuffle(Random)
|
|
|
|
|
var maxSize = 1000
|
|
|
|
|
val charsSize = chars.size
|
|
|
|
|
val stringSet = HashSet<String>()
|
|
|
|
|
while (maxSize > 0) {
|
|
|
|
|
val key = "${chars[Random.nextInt(charsSize)]}" + (Random.nextInt(80) + 10)
|
|
|
|
|
if (stringSet.contains(key)) {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
stringSet += key
|
|
|
|
|
maxSize--
|
|
|
|
|
}
|
|
|
|
|
val keys = stringSet.joinToString("\n")
|
|
|
|
|
val proguardDic = File(rootDir.path + "/dict.txt")
|
|
|
|
|
FileOutputStream(proguardDic).use {
|
|
|
|
|
it.write(keys.toByteArray())
|
|
|
|
|
}
|
|
|
|
|
println(proguardDic.absolutePath)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
afterEvaluate {
|
|
|
|
|
tasks.forEach { task ->
|
|
|
|
|
if(task.name == "extractProguardFiles") {
|
|
|
|
|
task.dependsOn(tasks["generateProguardDic"])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|