Skip to content

Commit b8bd63a

Browse files
authored
chore: Merge branch dev to main (#3533)
2 parents 630857b + 8b602ca commit b8bd63a

File tree

28 files changed

+908
-674
lines changed

28 files changed

+908
-674
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
# [4.13.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v4.13.0-dev.1...v4.13.0-dev.2) (2024-08-15)
2+
3+
4+
### Features
5+
6+
* **YouTube:** Add `Check watch history domain name resolution` patch ([#3537](https://github.com/ReVanced/revanced-patches/issues/3537)) ([2af1425](https://github.com/ReVanced/revanced-patches/commit/2af142525cda07a131335faadd4b3889979fd077))
7+
8+
# [4.13.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v4.12.1-dev.1...v4.13.0-dev.1) (2024-08-15)
9+
10+
11+
### Features
12+
13+
* **Google Photos:** Add `Spoof features` patch ([#3459](https://github.com/ReVanced/revanced-patches/issues/3459)) ([7c218cd](https://github.com/ReVanced/revanced-patches/commit/7c218cd168aa72eb99bcb47d12dfa45616e8ad88))
14+
* **SCB Easy:** Remove broken `Remove debugging detection` patch ([#3518](https://github.com/ReVanced/revanced-patches/issues/3518)) ([f4e23cb](https://github.com/ReVanced/revanced-patches/commit/f4e23cbb8a24638318d8cee20a1991c51855d9d2))
15+
16+
## [4.12.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v4.12.0...v4.12.1-dev.1) (2024-08-15)
17+
18+
19+
### Bug Fixes
20+
21+
* **YouTube - GmsCore support:** Fix notifications not working by using the correct permissions ([19ddae2](https://github.com/ReVanced/revanced-patches/commit/19ddae2d15e513e18eb1556c468cd94bd197685b))
22+
123
# [4.12.0](https://github.com/ReVanced/revanced-patches/compare/v4.11.0...v4.12.0) (2024-08-06)
224

325

api/revanced-patches.api

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,16 @@ public final class app/revanced/patches/googlenews/misc/integrations/Integration
279279
public static final field INSTANCE Lapp/revanced/patches/googlenews/misc/integrations/IntegrationsPatch;
280280
}
281281

282+
public final class app/revanced/patches/googlephotos/features/SpoofFeaturesPatch : app/revanced/patcher/patch/BytecodePatch {
283+
public static final field INSTANCE Lapp/revanced/patches/googlephotos/features/SpoofFeaturesPatch;
284+
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
285+
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
286+
}
287+
288+
public final class app/revanced/patches/googlephotos/features/fingerprints/InitializeFeaturesEnumFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
289+
public static final field INSTANCE Lapp/revanced/patches/googlephotos/features/fingerprints/InitializeFeaturesEnumFingerprint;
290+
}
291+
282292
public final class app/revanced/patches/googlephotos/misc/gms/GmsCoreSupportPatch : app/revanced/patches/shared/misc/gms/BaseGmsCoreSupportPatch {
283293
public static final field INSTANCE Lapp/revanced/patches/googlephotos/misc/gms/GmsCoreSupportPatch;
284294
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
org.gradle.parallel = true
22
org.gradle.caching = true
33
kotlin.code.style = official
4-
version = 4.12.0
4+
version = 4.13.0-dev.2
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package app.revanced.patches.googlephotos.features
2+
3+
import app.revanced.patcher.patch.annotation.Patch
4+
import app.revanced.patches.all.misc.build.BaseSpoofBuildInfoPatch
5+
6+
@Patch(description = "Spoof build info to Google Pixel XL.")
7+
internal class SpoofBuildInfoPatch : BaseSpoofBuildInfoPatch() {
8+
override val brand = "google"
9+
override val manufacturer = "Google"
10+
override val device = "marlin"
11+
override val product = "marlin"
12+
override val model = "Pixel XL"
13+
override val fingerprint = "google/marlin/marlin:10/QP1A.191005.007.A3/5972272:user/release-keys"
14+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
package app.revanced.patches.googlephotos.features
2+
3+
import app.revanced.patcher.data.BytecodeContext
4+
import app.revanced.patcher.extensions.InstructionExtensions.getInstructions
5+
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
6+
import app.revanced.patcher.patch.BytecodePatch
7+
import app.revanced.patcher.patch.annotation.CompatiblePackage
8+
import app.revanced.patcher.patch.annotation.Patch
9+
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringArrayPatchOption
10+
import app.revanced.patches.googlephotos.features.fingerprints.InitializeFeaturesEnumFingerprint
11+
import app.revanced.util.getReference
12+
import app.revanced.util.resultOrThrow
13+
import com.android.tools.smali.dexlib2.Opcode
14+
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
15+
import com.android.tools.smali.dexlib2.iface.reference.StringReference
16+
17+
@Patch(
18+
name = "Spoof features",
19+
description = "Spoofs the device to enable Google Pixel exclusive features, including unlimited storage.",
20+
dependencies = [SpoofBuildInfoPatch::class],
21+
compatiblePackages = [CompatiblePackage("com.google.android.apps.photos")],
22+
)
23+
@Suppress("unused")
24+
object SpoofFeaturesPatch : BytecodePatch(setOf(InitializeFeaturesEnumFingerprint)) {
25+
private val featuresToEnable by stringArrayPatchOption(
26+
"featuresToEnable",
27+
arrayOf(
28+
"com.google.android.apps.photos.NEXUS_PRELOAD",
29+
"com.google.android.apps.photos.nexus_preload",
30+
),
31+
title = "Features to enable",
32+
description = "Google Pixel exclusive features to enable. Features up to Pixel XL enable the unlimited storage feature.",
33+
required = true,
34+
)
35+
36+
private val featuresToDisable by stringArrayPatchOption(
37+
"featuresToDisable",
38+
arrayOf(
39+
"com.google.android.apps.photos.PIXEL_2017_PRELOAD",
40+
"com.google.android.apps.photos.PIXEL_2018_PRELOAD",
41+
"com.google.android.apps.photos.PIXEL_2019_MIDYEAR_PRELOAD",
42+
"com.google.android.apps.photos.PIXEL_2019_PRELOAD",
43+
"com.google.android.feature.PIXEL_2020_MIDYEAR_EXPERIENCE",
44+
"com.google.android.feature.PIXEL_2020_EXPERIENCE",
45+
"com.google.android.feature.PIXEL_2021_MIDYEAR_EXPERIENCE",
46+
"com.google.android.feature.PIXEL_2021_EXPERIENCE",
47+
"com.google.android.feature.PIXEL_2022_MIDYEAR_EXPERIENCE",
48+
"com.google.android.feature.PIXEL_2022_EXPERIENCE",
49+
"com.google.android.feature.PIXEL_2023_MIDYEAR_EXPERIENCE",
50+
"com.google.android.feature.PIXEL_2023_EXPERIENCE",
51+
"com.google.android.feature.PIXEL_2024_MIDYEAR_EXPERIENCE",
52+
"com.google.android.feature.PIXEL_2024_EXPERIENCE",
53+
"com.google.android.feature.PIXEL_2025_MIDYEAR_EXPERIENCE",
54+
),
55+
title = "Features to disable",
56+
description = "Google Pixel exclusive features to disable." +
57+
"Features after Pixel XL may have to be disabled for unlimited storage depending on the device.",
58+
required = true,
59+
)
60+
61+
override fun execute(context: BytecodeContext) {
62+
val featuresToEnable = featuresToEnable!!.toSet()
63+
val featuresToDisable = featuresToDisable!!.toSet()
64+
65+
InitializeFeaturesEnumFingerprint.resultOrThrow().let { result ->
66+
result.mutableMethod.apply {
67+
getInstructions().filter { it.opcode == Opcode.CONST_STRING }.forEach {
68+
val feature = it.getReference<StringReference>()!!.string
69+
70+
val spoofedFeature = when (feature) {
71+
in featuresToEnable -> "android.hardware.wifi"
72+
in featuresToDisable -> "dummy"
73+
else -> return@forEach
74+
}
75+
76+
val constStringIndex = it.location.index
77+
val constStringRegister = (it as OneRegisterInstruction).registerA
78+
79+
replaceInstruction(
80+
constStringIndex,
81+
"const-string v$constStringRegister, \"$spoofedFeature\"",
82+
)
83+
}
84+
}
85+
}
86+
}
87+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package app.revanced.patches.googlephotos.features.fingerprints
2+
3+
import app.revanced.patcher.fingerprint.MethodFingerprint
4+
5+
object InitializeFeaturesEnumFingerprint : MethodFingerprint(
6+
strings = listOf("com.google.android.apps.photos.NEXUS_PRELOAD"),
7+
)

src/main/kotlin/app/revanced/patches/instagram/patches/ad/HideAdsPatch.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import app.revanced.util.exception
1010

1111
@Patch(
1212
name = "Hide ads",
13-
description = "Hides ads in stories, discover, profile, etc." +
13+
description = "Hides ads in stories, discover, profile, etc. " +
1414
"An ad can still appear once when refreshing the home feed.",
1515
compatiblePackages = [CompatiblePackage("com.instagram.android")],
1616
)

src/main/kotlin/app/revanced/patches/piccomafr/misc/SpoofAndroidDeviceIdPatch.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import app.revanced.util.exception
1111

1212
@Patch(
1313
name = "Spoof Android device ID",
14-
description = "Spoofs the Android device ID used by the app for account authentication." +
14+
description = "Spoofs the Android device ID used by the app for account authentication. " +
1515
"This can be used to copy the account to another device.",
1616
compatiblePackages = [
1717
CompatiblePackage(

src/main/kotlin/app/revanced/patches/scbeasy/detection/debugging/RemoveDebuggingDetectionPatch.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ import app.revanced.patches.scbeasy.detection.debugging.fingerprints.DebuggingDe
1010

1111
@Patch(
1212
use = false,
13-
name = "Remove debugging detection",
1413
description = "Removes the USB and wireless debugging checks.",
1514
compatiblePackages = [CompatiblePackage("com.scb.phone")]
1615
)
1716
@Suppress("unused")
17+
@Deprecated("This patch no longer work and will be removed in the future " +
18+
"due to the complexity of the application.\n" +
19+
"See https://github.com/ReVanced/revanced-patches/issues/3517 for more details.")
1820
object RemoveDebuggingDetectionPatch : BytecodePatch(
1921
setOf(DebuggingDetectionFingerprint)
2022
) {

src/main/kotlin/app/revanced/patches/shared/misc/gms/BaseGmsCoreSupportPatch.kt

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ import app.revanced.patches.shared.misc.gms.fingerprints.GooglePlayUtilityFinger
1818
import app.revanced.patches.shared.misc.gms.fingerprints.ServiceCheckFingerprint
1919
import app.revanced.util.exception
2020
import app.revanced.util.getReference
21+
import app.revanced.util.indexOfFirstInstructionOrThrow
2122
import app.revanced.util.returnEarly
2223
import com.android.tools.smali.dexlib2.Opcode
2324
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c
2425
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
2526
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
27+
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
2628
import com.android.tools.smali.dexlib2.iface.reference.StringReference
2729
import com.android.tools.smali.dexlib2.immutable.reference.ImmutableStringReference
2830
import com.android.tools.smali.dexlib2.util.MethodUtil
@@ -112,11 +114,20 @@ abstract class BaseGmsCoreSupportPatch(
112114
}
113115

114116
// Verify GmsCore is installed and whitelisted for power optimizations and background usage.
115-
mainActivityOnCreateFingerprint.result?.mutableMethod?.addInstructions(
116-
0,
117-
"invoke-static/range { p0 .. p0 }, Lapp/revanced/integrations/shared/GmsCoreSupport;->" +
118-
"checkGmsCore(Landroid/app/Activity;)V",
119-
) ?: throw mainActivityOnCreateFingerprint.exception
117+
mainActivityOnCreateFingerprint.result?.mutableMethod?.apply {
118+
val setContextIndex = indexOfFirstInstructionOrThrow {
119+
val reference = getReference<MethodReference>() ?: return@indexOfFirstInstructionOrThrow false
120+
121+
reference.toString() == "Lapp/revanced/integrations/shared/Utils;->setContext(Landroid/content/Context;)V"
122+
}
123+
124+
// Add after setContext call, because this patch needs the context.
125+
addInstructions(
126+
setContextIndex + 1,
127+
"invoke-static/range { p0 .. p0 }, Lapp/revanced/integrations/shared/GmsCoreSupport;->" +
128+
"checkGmsCore(Landroid/app/Activity;)V",
129+
)
130+
} ?: throw mainActivityOnCreateFingerprint.exception
120131

121132
// Change the vendor of GmsCore in ReVanced Integrations.
122133
GmsCoreSupportFingerprint.result?.mutableClass?.methods

0 commit comments

Comments
 (0)