From 1845e4e5b4c317812cd29e76f4b6f685d306d4c9 Mon Sep 17 00:00:00 2001 From: 327135569 Date: Wed, 7 Apr 2021 17:09:46 +0800 Subject: [PATCH] refine build --- README.md | 18 +----------------- build.gradle | 8 ++++++++ patch/build.gradle | 4 +--- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 335b4c3..463e831 100644 --- a/README.md +++ b/README.md @@ -1,17 +1 @@ -# Readme -LSPosed as hook framework - -There some major change since xpatch - -1. use LSPosed as hook framework -1. keep loader simple, clear not nesseacry things, like bypass signature. let developer do this part - - -`Maybe perform force push if some private data leak in project. Sorry for the confusion.` - -# Useage -1. You need do signature bypass by yourself -1. Orignal signature saved to assets/original_signature_info.ini -1. Orignal apk saved to assets/original_apk.bin - -For example, you may need to replace signatures from getPackageInfo and redirect `/data/app/{your apk}/base.apk` to `original_apk.bin` to bypass normally signature check. \ No newline at end of file +Run `gradlew.bat build[Debug|Release]` build this project diff --git a/build.gradle b/build.gradle index 236dd39..b27465f 100644 --- a/build.gradle +++ b/build.gradle @@ -40,3 +40,11 @@ allprojects { task clean(type: Delete) { delete rootProject.buildDir } + +["Debug", "Release"].each { variant -> + tasks.register("build$variant") { + description("Build LSPatch with $variant") + dependsOn tasks.getByPath(":app:copy$variant") + dependsOn tasks.getByPath(":patch:build") + } +} diff --git a/patch/build.gradle b/patch/build.gradle index 2e26cad..91bcc97 100644 --- a/patch/build.gradle +++ b/patch/build.gradle @@ -18,10 +18,10 @@ dependencies { jar { baseName = "mmpatch" + destinationDirectory = new File("$rootProject.projectDir/out") manifest { attributes 'Main-Class': 'com.storm.wind.xpatch.MainCommand' } - //添加将引用的jar的源码打入最终的jar from { (configurations.runtime).collect { it.isDirectory() ? it : zipTree(it) @@ -30,7 +30,6 @@ jar { from fileTree(dir: 'src/main', includes: ['assets/**']) - //排除引用的jar中的签名信息 exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF' } @@ -39,7 +38,6 @@ tasks.build.doLast { println("Try \'java -jar " + jar.archiveName + "\' find more help") } -//添加源码中引入的非代码文件,例如资源等 sourceSets.main.resources { srcDirs = [ "src/main/java",