mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-19 20:17:05 +02:00
build: Bump dependencies
This commit is contained in:
parent
fc505a8726
commit
fe5fb736cb
@ -73,6 +73,8 @@ public final class app/revanced/patcher/Patcher : java/io/Closeable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class app/revanced/patcher/PatcherConfig {
|
public final class app/revanced/patcher/PatcherConfig {
|
||||||
|
public fun <init> (Ljava/io/File;Ljava/io/File;Ljava/io/File;Ljava/lang/String;)V
|
||||||
|
public synthetic fun <init> (Ljava/io/File;Ljava/io/File;Ljava/io/File;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||||
public fun <init> (Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;)V
|
public fun <init> (Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;)V
|
||||||
public synthetic fun <init> (Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
public synthetic fun <init> (Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel=true
|
||||||
org.gradle.caching = true
|
org.gradle.caching=true
|
||||||
version = 21.1.0-dev.1
|
version=21.1.0-dev.1
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
[versions]
|
[versions]
|
||||||
android = "4.1.1.4"
|
android = "4.1.1.4"
|
||||||
apktool-lib = "2.9.3"
|
apktool-lib = "2.10.1.1"
|
||||||
binary-compatibility-validator = "0.15.1"
|
binary-compatibility-validator = "0.15.1"
|
||||||
kotlin = "2.0.0"
|
kotlin = "2.0.20"
|
||||||
kotlinx-coroutines-core = "1.8.1"
|
kotlinx-coroutines-core = "1.8.1"
|
||||||
mockk = "1.13.10"
|
mockk = "1.13.10"
|
||||||
multidexlib2 = "3.0.3.r3"
|
multidexlib2 = "3.0.3.r3"
|
||||||
# Tracking https://github.com/google/smali/issues/64.
|
# Tracking https://github.com/google/smali/issues/64.
|
||||||
#noinspection GradleDependency
|
#noinspection GradleDependency
|
||||||
smali = "3.0.5"
|
smali = "3.0.8"
|
||||||
xpp3 = "1.1.4c"
|
xpp3 = "1.1.4c"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
@ -16,9 +16,28 @@ import java.util.logging.Logger
|
|||||||
class PatcherConfig(
|
class PatcherConfig(
|
||||||
internal val apkFile: File,
|
internal val apkFile: File,
|
||||||
private val temporaryFilesPath: File = File("revanced-temporary-files"),
|
private val temporaryFilesPath: File = File("revanced-temporary-files"),
|
||||||
aaptBinaryPath: String? = null,
|
aaptBinaryPath: File? = null,
|
||||||
frameworkFileDirectory: String? = null,
|
frameworkFileDirectory: String? = null,
|
||||||
) {
|
) {
|
||||||
|
/**
|
||||||
|
* The configuration for the patcher.
|
||||||
|
*
|
||||||
|
* @param apkFile The apk file to patch.
|
||||||
|
* @param temporaryFilesPath A path to a folder to store temporary files in.
|
||||||
|
* @param aaptBinaryPath A path to a custom aapt binary.
|
||||||
|
* @param frameworkFileDirectory A path to the directory to cache the framework file in.
|
||||||
|
*/
|
||||||
|
@Deprecated(
|
||||||
|
"Use the constructor with a File for aaptBinaryPath instead.",
|
||||||
|
ReplaceWith("PatcherConfig(apkFile, temporaryFilesPath, aaptBinaryPath?.let { File(it) }, frameworkFileDirectory)"),
|
||||||
|
)
|
||||||
|
constructor(
|
||||||
|
apkFile: File,
|
||||||
|
temporaryFilesPath: File = File("revanced-temporary-files"),
|
||||||
|
aaptBinaryPath: String? = null,
|
||||||
|
frameworkFileDirectory: String? = null,
|
||||||
|
) : this(apkFile, temporaryFilesPath, aaptBinaryPath?.let { File(it) }, frameworkFileDirectory)
|
||||||
|
|
||||||
private val logger = Logger.getLogger(PatcherConfig::class.java.name)
|
private val logger = Logger.getLogger(PatcherConfig::class.java.name)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,8 +52,7 @@ class PatcherConfig(
|
|||||||
*/
|
*/
|
||||||
internal val resourceConfig =
|
internal val resourceConfig =
|
||||||
Config.getDefaultConfig().apply {
|
Config.getDefaultConfig().apply {
|
||||||
useAapt2 = true
|
aaptBinary = aaptBinaryPath
|
||||||
aaptPath = aaptBinaryPath ?: ""
|
|
||||||
frameworkDirectory = frameworkFileDirectory
|
frameworkDirectory = frameworkFileDirectory
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ import brut.androlib.ApkDecoder
|
|||||||
import brut.androlib.apk.UsesFramework
|
import brut.androlib.apk.UsesFramework
|
||||||
import brut.androlib.res.Framework
|
import brut.androlib.res.Framework
|
||||||
import brut.androlib.res.ResourcesDecoder
|
import brut.androlib.res.ResourcesDecoder
|
||||||
|
import brut.androlib.res.decoder.AndroidManifestPullStreamDecoder
|
||||||
import brut.androlib.res.decoder.AndroidManifestResourceParser
|
import brut.androlib.res.decoder.AndroidManifestResourceParser
|
||||||
import brut.androlib.res.decoder.XmlPullStreamDecoder
|
import brut.androlib.res.xml.ResXmlUtils
|
||||||
import brut.androlib.res.xml.ResXmlPatcher
|
|
||||||
import brut.directory.ExtFile
|
import brut.directory.ExtFile
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import java.io.OutputStream
|
import java.io.OutputStream
|
||||||
@ -51,8 +51,7 @@ class ResourcePatchContext internal constructor(
|
|||||||
*
|
*
|
||||||
* @param mode The [ResourceMode] to use.
|
* @param mode The [ResourceMode] to use.
|
||||||
*/
|
*/
|
||||||
internal fun decodeResources(mode: ResourceMode) =
|
internal fun decodeResources(mode: ResourceMode) = with(packageMetadata.apkInfo) {
|
||||||
with(packageMetadata.apkInfo) {
|
|
||||||
config.initializeTemporaryFilesDirectories()
|
config.initializeTemporaryFilesDirectories()
|
||||||
|
|
||||||
// Needed to decode resources.
|
// Needed to decode resources.
|
||||||
@ -65,8 +64,7 @@ class ResourcePatchContext internal constructor(
|
|||||||
resourcesDecoder.decodeManifest(config.apkFiles)
|
resourcesDecoder.decodeManifest(config.apkFiles)
|
||||||
|
|
||||||
// Needed to record uncompressed files.
|
// Needed to record uncompressed files.
|
||||||
val apkDecoder = ApkDecoder(config.resourceConfig, this)
|
ApkDecoder(this, config.resourceConfig).recordUncompressedFiles(resourcesDecoder.resFileMapping)
|
||||||
apkDecoder.recordUncompressedFiles(resourcesDecoder.resFileMapping)
|
|
||||||
|
|
||||||
usesFramework =
|
usesFramework =
|
||||||
UsesFramework().apply {
|
UsesFramework().apply {
|
||||||
@ -77,10 +75,10 @@ class ResourcePatchContext internal constructor(
|
|||||||
|
|
||||||
// Decode manually instead of using resourceDecoder.decodeManifest
|
// Decode manually instead of using resourceDecoder.decodeManifest
|
||||||
// because it does not support decoding to an OutputStream.
|
// because it does not support decoding to an OutputStream.
|
||||||
XmlPullStreamDecoder(
|
AndroidManifestPullStreamDecoder(
|
||||||
AndroidManifestResourceParser(resourcesDecoder.resTable),
|
AndroidManifestResourceParser(resourcesDecoder.resTable),
|
||||||
resourcesDecoder.resXmlSerializer,
|
resourcesDecoder.newXmlSerializer(),
|
||||||
).decodeManifest(
|
).decode(
|
||||||
apkFile.directory.getFileInput("AndroidManifest.xml"),
|
apkFile.directory.getFileInput("AndroidManifest.xml"),
|
||||||
// Older Android versions do not support OutputStream.nullOutputStream()
|
// Older Android versions do not support OutputStream.nullOutputStream()
|
||||||
object : OutputStream() {
|
object : OutputStream() {
|
||||||
@ -90,7 +88,7 @@ class ResourcePatchContext internal constructor(
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Get the package name and version from the manifest using the XmlPullStreamDecoder.
|
// Get the package name and version from the manifest using the XmlPullStreamDecoder.
|
||||||
// XmlPullStreamDecoder.decodeManifest() sets metadata.apkInfo.
|
// AndroidManifestPullStreamDecoder.decode() sets metadata.apkInfo.
|
||||||
packageMetadata.let { metadata ->
|
packageMetadata.let { metadata ->
|
||||||
metadata.packageName = resourcesDecoder.resTable.packageRenamed
|
metadata.packageName = resourcesDecoder.resTable.packageRenamed
|
||||||
versionInfo.let {
|
versionInfo.let {
|
||||||
@ -100,7 +98,7 @@ class ResourcePatchContext internal constructor(
|
|||||||
/*
|
/*
|
||||||
The ResTable if flagged as sparse if the main package is not loaded, which is the case here,
|
The ResTable if flagged as sparse if the main package is not loaded, which is the case here,
|
||||||
because ResourcesDecoder.decodeResources loads the main package
|
because ResourcesDecoder.decodeResources loads the main package
|
||||||
and not XmlPullStreamDecoder.decodeManifest.
|
and not AndroidManifestPullStreamDecoder.decode.
|
||||||
See ARSCDecoder.readTableType for more info.
|
See ARSCDecoder.readTableType for more info.
|
||||||
|
|
||||||
Set this to false again to prevent the ResTable from being flagged as sparse falsely.
|
Set this to false again to prevent the ResTable from being flagged as sparse falsely.
|
||||||
@ -130,10 +128,10 @@ class ResourcePatchContext internal constructor(
|
|||||||
AaptInvoker(
|
AaptInvoker(
|
||||||
config.resourceConfig,
|
config.resourceConfig,
|
||||||
packageMetadata.apkInfo,
|
packageMetadata.apkInfo,
|
||||||
).invokeAapt(
|
).invoke(
|
||||||
resources.resolve("resources.apk"),
|
resources.resolve("resources.apk"),
|
||||||
config.apkFiles.resolve("AndroidManifest.xml").also {
|
config.apkFiles.resolve("AndroidManifest.xml").also {
|
||||||
ResXmlPatcher.fixingPublicAttrsInProviderAttributes(it)
|
ResXmlUtils.fixingPublicAttrsInProviderAttributes(it)
|
||||||
},
|
},
|
||||||
config.apkFiles.resolve("res"),
|
config.apkFiles.resolve("res"),
|
||||||
null,
|
null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user