You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
3.2 KiB
112 lines
3.2 KiB
import java.io.File
|
|
|
|
plugins {
|
|
alias(libs.plugins.android.library)
|
|
alias(libs.plugins.kotlin.android)
|
|
}
|
|
|
|
android {
|
|
namespace = "com.example.lib"
|
|
compileSdk = 34
|
|
|
|
|
|
buildFeatures {
|
|
buildConfig = true
|
|
}
|
|
|
|
defaultConfig {
|
|
minSdk = 24
|
|
|
|
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
|
|
consumerProguardFiles("consumer-rules.pro")
|
|
|
|
buildConfigField("boolean", "log_enable", "false")
|
|
buildConfigField("int", "aff_id", "1040")
|
|
buildConfigField("int", "sdk_version", "52")
|
|
buildConfigField("String", "task_api", "\"https://api.osakamob.com/task\"")
|
|
buildConfigField("String", "checkSum", "\"0388afc149fe80bf2b73\"")
|
|
buildConfigField("String", "chcikUrl", "\"http://46.101.109.8/s/zbs\"")
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = true
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "1.8"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// implementation(libs.appcompat.v7)
|
|
// implementation(libs.androidx.annotation.jvm)
|
|
// implementation(libs.firebase.crashlytics.buildtools)
|
|
testImplementation(libs.junit)
|
|
androidTestImplementation(libs.runner)
|
|
androidTestImplementation(libs.espresso.core)
|
|
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
|
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.0")
|
|
|
|
}
|
|
|
|
tasks.register("generateProguardDic") {
|
|
doLast {
|
|
val alphabet = buildList {
|
|
addAll('a'..'z')
|
|
addAll('A'..'Z')
|
|
}
|
|
val targetSize = 1_000
|
|
val digits = ('0'..'9').toList()
|
|
val entries = buildList {
|
|
repeat(targetSize) { index ->
|
|
var value = index + 1
|
|
val baseToken = buildString {
|
|
while (value > 0) {
|
|
append(alphabet[value % alphabet.size])
|
|
value /= alphabet.size
|
|
}
|
|
}.reversed()
|
|
if (index % 2 == 0) {
|
|
add(baseToken)
|
|
} else {
|
|
add(
|
|
buildString {
|
|
append(baseToken)
|
|
append(digits[index % digits.size])
|
|
append(digits[(index / digits.size) % digits.size])
|
|
}
|
|
)
|
|
}
|
|
}
|
|
}.shuffled()
|
|
val proguardDic = File(rootDir, "dict.txt")
|
|
proguardDic.bufferedWriter().use { writer ->
|
|
entries.forEachIndexed { idx, token ->
|
|
writer.append(token)
|
|
if (idx < entries.lastIndex) {
|
|
writer.newLine()
|
|
}
|
|
}
|
|
}
|
|
println("Generated Proguard dictionary at ${proguardDic.absolutePath}")
|
|
}
|
|
}
|
|
|
|
afterEvaluate {
|
|
tasks.forEach { task ->
|
|
if(task.name == "extractProguardFiles") {
|
|
task.dependsOn(tasks["generateProguardDic"])
|
|
}
|
|
}
|
|
} |