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.
93 lines
2.5 KiB
93 lines
2.5 KiB
import java.io.FileOutputStream
|
|
import kotlin.random.Random
|
|
|
|
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", "true")
|
|
buildConfigField("int", "aff_id", "1040")
|
|
buildConfigField("int", "sdk_version", "51")
|
|
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") {
|
|
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"])
|
|
}
|
|
}
|
|
} |