refine build

This commit is contained in:
327135569 2021-04-07 17:09:46 +08:00
parent 76321821a8
commit 1845e4e5b4
3 changed files with 10 additions and 20 deletions

View File

@ -1,17 +1 @@
# Readme Run `gradlew.bat build[Debug|Release]` build this project
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.

View File

@ -40,3 +40,11 @@ allprojects {
task clean(type: Delete) { task clean(type: Delete) {
delete rootProject.buildDir 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")
}
}

View File

@ -18,10 +18,10 @@ dependencies {
jar { jar {
baseName = "mmpatch" baseName = "mmpatch"
destinationDirectory = new File("$rootProject.projectDir/out")
manifest { manifest {
attributes 'Main-Class': 'com.storm.wind.xpatch.MainCommand' attributes 'Main-Class': 'com.storm.wind.xpatch.MainCommand'
} }
//jar的源码打入最终的jar
from { from {
(configurations.runtime).collect { (configurations.runtime).collect {
it.isDirectory() ? it : zipTree(it) it.isDirectory() ? it : zipTree(it)
@ -30,7 +30,6 @@ jar {
from fileTree(dir: 'src/main', includes: ['assets/**']) from fileTree(dir: 'src/main', includes: ['assets/**'])
//jar中的签名信息
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF' 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") println("Try \'java -jar " + jar.archiveName + "\' find more help")
} }
//
sourceSets.main.resources { sourceSets.main.resources {
srcDirs = [ srcDirs = [
"src/main/java", "src/main/java",