mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +00:00
Rebuild manifest
This commit is contained in:
parent
3ae7344747
commit
b68658e974
@ -21,9 +21,11 @@ import java.io.ByteArrayInputStream
|
|||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.PrintStream
|
import java.io.PrintStream
|
||||||
|
import java.nio.file.Files
|
||||||
import java.security.KeyStore
|
import java.security.KeyStore
|
||||||
import java.security.cert.X509Certificate
|
import java.security.cert.X509Certificate
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
import java.util.jar.JarFile
|
||||||
import java.util.zip.*
|
import java.util.zip.*
|
||||||
|
|
||||||
private fun Project.androidBase(configure: Action<BaseExtension>) =
|
private fun Project.androidBase(configure: Action<BaseExtension>) =
|
||||||
@ -90,6 +92,7 @@ private fun addComment(apkPath: File, signConfig: SigningConfig, minSdk: Int, eo
|
|||||||
SigningExtension(signingOptions).register(it)
|
SigningExtension(signingOptions).register(it)
|
||||||
it.eocdComment = eocdComment.toByteArray()
|
it.eocdComment = eocdComment.toByteArray()
|
||||||
it.get(IncrementalPackager.APP_METADATA_ENTRY_PATH)?.delete()
|
it.get(IncrementalPackager.APP_METADATA_ENTRY_PATH)?.delete()
|
||||||
|
it.get(JarFile.MANIFEST_NAME)?.delete()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,11 +136,8 @@ private fun Project.setupAppCommon() {
|
|||||||
android.applicationVariants.all {
|
android.applicationVariants.all {
|
||||||
val projectName = project.name.toLowerCase(Locale.ROOT)
|
val projectName = project.name.toLowerCase(Locale.ROOT)
|
||||||
val variantCapped = name.capitalize(Locale.ROOT)
|
val variantCapped = name.capitalize(Locale.ROOT)
|
||||||
val variant = name.toLowerCase(Locale.ROOT)
|
|
||||||
tasks.getByPath(":$projectName:package$variantCapped").doLast {
|
tasks.getByPath(":$projectName:package$variantCapped").doLast {
|
||||||
val apkDir = if (properties["android.injected.invoked.from.ide"] == "true")
|
val apk = outputs.files.asFileTree.filter { it.name.endsWith(".apk") }.singleFile
|
||||||
"intermediates" else "outputs"
|
|
||||||
val apk = File(buildDir, "${apkDir}/apk/${variant}/$projectName-${variant}.apk")
|
|
||||||
val comment = "version=${Config.version}\nversionCode=${Config.versionCode}"
|
val comment = "version=${Config.version}\nversionCode=${Config.versionCode}"
|
||||||
addComment(apk, signingConfig, android.defaultConfig.minSdk!!, comment)
|
addComment(apk, signingConfig, android.defaultConfig.minSdk!!, comment)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user