From a44802ef4ebf59ae47213854ba761c81dadc51f3 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 15 Oct 2024 07:39:33 -0400 Subject: [PATCH 1/2] fix: Make it work on Android 12 and lower by using existing APIs (#312) Co-authored-by: oSumAtrIX --- .../app/revanced/patcher/patch/BytecodePatchContext.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/app/revanced/patcher/patch/BytecodePatchContext.kt b/src/main/kotlin/app/revanced/patcher/patch/BytecodePatchContext.kt index 6c219c7..e9e881a 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/BytecodePatchContext.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/BytecodePatchContext.kt @@ -62,17 +62,16 @@ class BytecodePatchContext internal constructor(private val config: PatcherConfi * Merge the extensions for this set of patches. */ internal fun Set>.mergeExtensions() { - // Lookup map for fast checking if a class exists by its type. + // Lookup map to check if a class exists by its type quickly. val classesByType = mutableMapOf().apply { classes.forEach { classDef -> put(classDef.type, classDef) } } forEachRecursively { patch -> - if (patch is BytecodePatch && patch.extension != null) { + if (patch !is BytecodePatch) return@forEachRecursively - val extension = patch.extension.readAllBytes() - - RawDexIO.readRawDexFile(extension, 0, null).classes.forEach { classDef -> + patch.extension?.use { extensionStream -> + RawDexIO.readRawDexFile(extensionStream, 0, null).classes.forEach { classDef -> val existingClass = classesByType[classDef.type] ?: run { logger.fine("Adding class \"$classDef\"") From 5024204046f0abaa43596d11fd028bd1d25363c1 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 15 Oct 2024 11:41:01 +0000 Subject: [PATCH 2/2] chore: Release v20.0.2-dev.1 [skip ci] ## [20.0.2-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v20.0.1...v20.0.2-dev.1) (2024-10-15) ### Bug Fixes * Make it work on Android 12 and lower by using existing APIs ([#312](https://github.com/ReVanced/revanced-patcher/issues/312)) ([a44802e](https://github.com/ReVanced/revanced-patcher/commit/a44802ef4ebf59ae47213854ba761c81dadc51f3)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dbdb9b..29afe91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [20.0.2-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v20.0.1...v20.0.2-dev.1) (2024-10-15) + + +### Bug Fixes + +* Make it work on Android 12 and lower by using existing APIs ([#312](https://github.com/ReVanced/revanced-patcher/issues/312)) ([a44802e](https://github.com/ReVanced/revanced-patcher/commit/a44802ef4ebf59ae47213854ba761c81dadc51f3)) + ## [20.0.1](https://github.com/ReVanced/revanced-patcher/compare/v20.0.0...v20.0.1) (2024-10-13) diff --git a/gradle.properties b/gradle.properties index 8eccd10..13d25d1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.parallel = true org.gradle.caching = true -version = 20.0.1 +version = 20.0.2-dev.1