From 77dd13fee3b32fb24f31043f39d8e8add2410a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= Date: Sun, 15 May 2022 11:26:04 +0800 Subject: [PATCH] Update README.md --- .github/workflows/Android.yml | 3 ++ app/build.gradle.kts | 28 ++++++++++++++++++- .../main/java/xfk233/genshinproxy/MainHook.kt | 1 - build.gradle.kts | 5 ++++ gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Android.yml b/.github/workflows/Android.yml index 157b4d2..4ba94ba 100644 --- a/.github/workflows/Android.yml +++ b/.github/workflows/Android.yml @@ -30,6 +30,9 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Create key file + run: echo -n "${{ secrets.SIGNING_KEY }}" | base64 -d > signingKey.jks + - name: Build with Gradle run: | bash ./gradlew assembleRelease diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 594f1b1..950a3e6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -30,6 +30,23 @@ android { kotlinOptions { jvmTarget = JavaVersion.VERSION_11.majorVersion } + packagingOptions { + resources { + excludes += "/META-INF/**" + excludes += "/kotlin/**" + excludes += "/*.txt" + excludes += "/*.bin" + } + dex { + useLegacyPackaging = true + } + } + applicationVariants.all { + outputs.all { + (this as com.android.build.gradle.internal.api.BaseVariantOutputImpl).outputFileName = + "GenshinProxy-$versionName($versionCode)-$name.apk" + } + } } BlackObfuscator { @@ -38,8 +55,17 @@ BlackObfuscator { setObfClass("xfk233.genshinproxy") } +fun getKey(project: Project): ByteArray { + val keyFile = File(project.rootProject.projectDir, "signingKey.jks") + if (keyFile.exists() && keyFile.canRead()) { + return keyFile.readBytes() + } + println("Key not found!") + return "xfk2333".encodeToByteArray() +} + stringFuck { - setKey("xfk233") + key = getKey(rootProject) isPrintDebugInfo = false isWorkOnDebug = true isWhiteList = false diff --git a/app/src/main/java/xfk233/genshinproxy/MainHook.kt b/app/src/main/java/xfk233/genshinproxy/MainHook.kt index 72dc32c..07f8779 100644 --- a/app/src/main/java/xfk233/genshinproxy/MainHook.kt +++ b/app/src/main/java/xfk233/genshinproxy/MainHook.kt @@ -5,7 +5,6 @@ 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 diff --git a/build.gradle.kts b/build.gradle.kts index 1adda1d..82e7559 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,10 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { +// maven { +// setUrl("http://192.168.1.5:8081/repository/maven-public/") +// isAllowInsecureProtocol = true +// } google() mavenCentral() maven("https://api.xposed.info") @@ -10,6 +14,7 @@ buildscript { 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") + classpath("icu.nullptr.stringfuck:plugin:0.2.2") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 55d2082..59e68cf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Sat May 14 18:18:27 CST 2022 +#Sun May 15 10:11:18 CST 2022 distributionBase=GRADLE_USER_HOME distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip distributionPath=wrapper/dists