From 7508d747aa0aa33a17cb69c10526da95fec7322c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= Date: Sat, 14 May 2022 23:19:16 +0800 Subject: [PATCH] Use kts --- app/build.gradle | 47 ---------------- app/build.gradle.kts | 54 +++++++++++++++++++ app/proguard-rules.pro | 2 +- app/src/main/java/xfk233/genshinproxy/Hook.kt | 2 +- .../main/java/xfk233/genshinproxy/MainHook.kt | 8 ++- build.gradle | 19 ------- build.gradle.kts | 20 +++++++ settings.gradle => settings.gradle.kts | 2 +- 8 files changed, 84 insertions(+), 70 deletions(-) delete mode 100644 app/build.gradle create mode 100644 app/build.gradle.kts delete mode 100644 build.gradle create mode 100644 build.gradle.kts rename settings.gradle => settings.gradle.kts (94%) diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 9728da0..0000000 --- a/app/build.gradle +++ /dev/null @@ -1,47 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' - id 'top.niunaijun.blackobfuscator' -} - -android { - compileSdk 32 - - defaultConfig { - applicationId "xfk233.genshinproxy" - minSdk 28 - targetSdk 32 - versionCode 5 - versionName "1.5" - } - - buildTypes { - release { - minifyEnabled true - shrinkResources true - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-log.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - kotlinOptions { - jvmTarget = '11' - } -} - -BlackObfuscator { - enabled true - depth 3 - obfClass = ["xfk233.genshinproxy"] -} - - -dependencies { - //API - compileOnly 'de.robv.android.xposed:api:82' - //带源码Api - compileOnly 'de.robv.android.xposed:api:82:sources' - implementation 'com.github.kyuubiran:EzXHelper:0.9.2' -} \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..12a9438 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,54 @@ +plugins { + id("com.android.application") + id("kotlin-android") + id("top.niunaijun.blackobfuscator") +// id("icu.nullptr.stringfuck") version "0.2.1" +} + +android { + compileSdk = 32 + + defaultConfig { + applicationId = "xfk233.genshinproxy" + minSdk = 28 + targetSdk = 32 + versionCode = 5 + versionName = "1.5" + } + + buildTypes { + release { + isMinifyEnabled = true + isShrinkResources = true + setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro", "proguard-log.pro")) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.majorVersion + } +} + +BlackObfuscator { + isEnabled = true + depth = 3 + setObfClass("xfk233.genshinproxy") +} + +//stringFuck { +// setKey("xfk233") +// isPrintDebugInfo = false +// isWorkOnDebug = true +// isWhiteList = false +// obfuscationList = setOf("xfk233.genshinproxy") +//} + +dependencies { + compileOnly("de.robv.android.xposed:api:82") + compileOnly("de.robv.android.xposed:api:82:sources") + implementation("com.github.kyuubiran:EzXHelper:0.9.2") + implementation("icu.nullptr.stringfuck:library:0.2.1") +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index a04f79f..2fa38d3 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,6 +1,6 @@ # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. +# proguardFiles setting in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/app/src/main/java/xfk233/genshinproxy/Hook.kt b/app/src/main/java/xfk233/genshinproxy/Hook.kt index 2abc6c3..66587cc 100644 --- a/app/src/main/java/xfk233/genshinproxy/Hook.kt +++ b/app/src/main/java/xfk233/genshinproxy/Hook.kt @@ -297,7 +297,7 @@ class Hook { runOnMainThread { dialog.visibility = View.VISIBLE } - Thread.sleep(10 * 1000) + Thread.sleep(15000) runOnMainThread { dialog.visibility = View.GONE activity.windowManager.removeView(dialog) diff --git a/app/src/main/java/xfk233/genshinproxy/MainHook.kt b/app/src/main/java/xfk233/genshinproxy/MainHook.kt index 54b59a9..72dc32c 100644 --- a/app/src/main/java/xfk233/genshinproxy/MainHook.kt +++ b/app/src/main/java/xfk233/genshinproxy/MainHook.kt @@ -3,10 +3,16 @@ package xfk233.genshinproxy import de.robv.android.xposed.IXposedHookLoadPackage import de.robv.android.xposed.IXposedHookZygoteInit import de.robv.android.xposed.callbacks.XC_LoadPackage +import icu.nullptr.stringfuck.StringFuck class MainHook : IXposedHookLoadPackage, IXposedHookZygoteInit { - private val hook = Hook() + private val hook: Hook + + init { + StringFuck.init() + hook = Hook() + } override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { hook.handleLoadPackage(lpparam) diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 13efecd..0000000 --- a/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - repositories { - google() - mavenCentral() - maven { url 'https://jitpack.io' } - } - dependencies { - classpath "com.android.tools.build:gradle:7.0.4" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21" - classpath "com.github.CodingGay:BlackObfuscator-ASPlugin:3.7" - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..1adda1d --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,20 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + google() + mavenCentral() + maven("https://api.xposed.info") + maven("https://jitpack.io") + } + dependencies { + classpath("com.android.tools.build:gradle:7.1.3") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21") + classpath("com.github.CodingGay:BlackObfuscator-ASPlugin:3.7") + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +tasks.register("Delete", Delete::class) { + delete(rootProject.buildDir) +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle.kts similarity index 94% rename from settings.gradle rename to settings.gradle.kts index f147441..41b41a7 100644 --- a/settings.gradle +++ b/settings.gradle.kts @@ -7,4 +7,4 @@ dependencyResolutionManagement { } } rootProject.name = "GenshinProxy" -include ':app' +include(":app")