1
mirror of https://github.com/revanced/revanced-patcher synced 2025-09-06 16:38:50 +02:00

Compare commits

...

6 Commits

Author SHA1 Message Date
semantic-release-bot
2a8cc283c7 chore(release): 13.0.0-dev.2 [skip ci]
# [13.0.0-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v13.0.0-dev.1...v13.0.0-dev.2) (2023-08-12)

### Bug Fixes

* disable correct loggers ([c2d89c6](c2d89c622e))
* get framework ids to compile resources ([f2cb7ee](f2cb7ee7df))
* set package metadata correctly ([02d6ff1](02d6ff15fe))
2023-08-12 00:25:18 +00:00
oSumAtrIX
433fe3af9f build(Needs bump): Bump dependencies 2023-08-12 02:23:03 +02:00
oSumAtrIX
c2d89c622e fix: disable correct loggers 2023-08-12 02:22:52 +02:00
oSumAtrIX
02d6ff15fe fix: set package metadata correctly 2023-08-12 02:19:28 +02:00
oSumAtrIX
f2cb7ee7df fix: get framework ids to compile resources 2023-08-12 02:18:43 +02:00
oSumAtrIX
a2ac44dcc1 chore: use more generic inline docs 2023-08-12 02:15:26 +02:00
5 changed files with 38 additions and 16 deletions

View File

@@ -1,3 +1,12 @@
# [13.0.0-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v13.0.0-dev.1...v13.0.0-dev.2) (2023-08-12)
### Bug Fixes
* disable correct loggers ([c2d89c6](https://github.com/ReVanced/revanced-patcher/commit/c2d89c622e06e58e5042e1a00ef67cee8a246e53))
* get framework ids to compile resources ([f2cb7ee](https://github.com/ReVanced/revanced-patcher/commit/f2cb7ee7dffa573c31df497cf235a3f5d120f91f))
* set package metadata correctly ([02d6ff1](https://github.com/ReVanced/revanced-patcher/commit/02d6ff15fe87c2352de29749610e9d72db8ba418))
# [13.0.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v12.1.1...v13.0.0-dev.1) (2023-08-11)

View File

@@ -26,7 +26,7 @@ dependencies {
implementation("xpp3:xpp3:1.1.4c")
implementation("com.android.tools.smali:smali:3.0.3")
implementation("app.revanced:multidexlib2:3.0.3.r2")
implementation("app.revanced:apktool-lib:2.8.2-2")
implementation("app.revanced:apktool-lib:2.8.2-3")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.8.22")
testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.20-RC")

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 13.0.0-dev.1
version = 13.0.0-dev.2

View File

@@ -11,6 +11,7 @@ import brut.androlib.AaptInvoker
import brut.androlib.ApkDecoder
import brut.androlib.Config
import brut.androlib.apk.ApkInfo
import brut.androlib.apk.UsesFramework
import brut.androlib.res.Framework
import brut.androlib.res.ResourcesDecoder
import brut.androlib.res.decoder.AndroidManifestResourceParser
@@ -53,13 +54,21 @@ class Patcher(private val options: PatcherOptions) {
}
init {
LogManager.getLogManager().getLogger("brut.*").useParentHandlers = false
// Disable unwanted logging.
LogManager.getLogManager().let {
listOf("app.revanced.apktool-lib", "app.revanced.brut.*").forEach { loggerName ->
it.getLogger(loggerName)?.useParentHandlers = false
}
}
logger.info("Reading dex files")
// read dex files
val dexFile = MultiDexIO.readDexFile(true, options.inputFile, NAMER, null, null)
// get the opcodes
opcodes = dexFile.opcodes
// finally create patcher context
context = PatcherContext(dexFile.classes.toMutableList(), File(options.resourceCacheDirectory))
@@ -195,14 +204,18 @@ class Patcher(private val options: PatcherOptions) {
try {
when (mode) {
ResourceDecodingMode.FULL -> {
val outDir = options.recreateResourceCacheDirectory()
logger.info("Decoding resources")
val outDir = options.recreateResourceCacheDirectory()
resourcesDecoder.decodeManifest(outDir)
resourcesDecoder.decodeResources(outDir)
apkDecoder.recordUncompressedFiles(resourcesDecoder.resFileMapping)
apkInfo.usesFramework = UsesFramework().apply {
ids = resourcesDecoder.resTable.listFramePackages().map { it.id }
}
}
ResourceDecodingMode.MANIFEST_ONLY -> {
logger.info("Decoding app manifest")
@@ -220,15 +233,15 @@ class Patcher(private val options: PatcherOptions) {
}
}
)
}
}
// Get the package name and version from the manifest using the XmlPullStreamDecoder.
// XmlPullStreamDecoder.decodeManifest() sets metadata.apkInfo.
context.packageMetadata.let { metadata ->
metadata.packageName = resourcesDecoder.resTable.currentResPackage.name
apkInfo.versionInfo.let {
metadata.packageVersion = it.versionName ?: it.versionCode
// Get the package name and version from the manifest using the XmlPullStreamDecoder.
// XmlPullStreamDecoder.decodeManifest() sets metadata.apkInfo.
context.packageMetadata.let { metadata ->
metadata.packageName = resourcesDecoder.resTable.packageRenamed
apkInfo.versionInfo.let {
metadata.packageVersion = it.versionName ?: it.versionCode
}
}
}
}
} finally {

View File

@@ -79,10 +79,10 @@ class PatchOptions(vararg options: PatchOption<*>) : Iterable<PatchOption<*>> {
/**
* A [Patch] option.
* @param key Unique identifier of the option. Example: _`settings.microg.enabled`_
* @param key Unique identifier of the option. Example: _`settings`_
* @param default The default value of the option.
* @param title A human-readable title of the option. Example: _MicroG Settings_
* @param description A human-readable description of the option. Example: _Settings integration for MicroG._
* @param title A human-readable title of the option. Example: _Patch Settings_
* @param description A human-readable description of the option. Example: _Settings for the patches._
* @param required Whether the option is required.
*/
@Suppress("MemberVisibilityCanBePrivate")