From d92362b0d9803f00af6ba9700eccc7afd69a619a Mon Sep 17 00:00:00 2001 From: abichinger Date: Tue, 29 Jul 2025 10:30:43 +0200 Subject: [PATCH] feat(ORF ON): Add `Remove root detection` patch (#5551) --- patches/api/patches.api | 4 ++++ .../patches/orfon/detection/root/Fingerprints.kt | 13 +++++++++++++ .../detection/root/RemoveRootDetectionPatch.kt | 16 ++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 patches/src/main/kotlin/app/revanced/patches/orfon/detection/root/Fingerprints.kt create mode 100644 patches/src/main/kotlin/app/revanced/patches/orfon/detection/root/RemoveRootDetectionPatch.kt diff --git a/patches/api/patches.api b/patches/api/patches.api index f976256be..559de899f 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -424,6 +424,10 @@ public final class app/revanced/patches/openinghours/misc/fix/crash/FixCrashPatc public static final fun getFixCrashPatch ()Lapp/revanced/patcher/patch/BytecodePatch; } +public final class app/revanced/patches/orfon/detection/root/RemoveRootDetectionPatchKt { + public static final fun getRemoveRootDetectionPatch ()Lapp/revanced/patcher/patch/BytecodePatch; +} + public final class app/revanced/patches/pandora/ads/DisableAudioAdsPatchKt { public static final fun getDisableAudioAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch; } diff --git a/patches/src/main/kotlin/app/revanced/patches/orfon/detection/root/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/orfon/detection/root/Fingerprints.kt new file mode 100644 index 000000000..525d4f37d --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/orfon/detection/root/Fingerprints.kt @@ -0,0 +1,13 @@ +package app.revanced.patches.orfon.detection.root + +import app.revanced.patcher.fingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +internal val isDeviceRootedFingeprint = fingerprint { + accessFlags(AccessFlags.PUBLIC) + returns("Z") + custom { method, classDef -> + method.name == "isDeviceRooted" && + classDef.endsWith("/RootChecker;") + } +} diff --git a/patches/src/main/kotlin/app/revanced/patches/orfon/detection/root/RemoveRootDetectionPatch.kt b/patches/src/main/kotlin/app/revanced/patches/orfon/detection/root/RemoveRootDetectionPatch.kt new file mode 100644 index 000000000..594083337 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/orfon/detection/root/RemoveRootDetectionPatch.kt @@ -0,0 +1,16 @@ +package app.revanced.patches.orfon.detection.root + +import app.revanced.patcher.patch.bytecodePatch +import app.revanced.util.returnEarly + +@Suppress("unused") +val removeRootDetectionPatch = bytecodePatch( + name = "Remove root detection", + description = "Removes the check for root permissions.", +) { + compatibleWith("com.nousguide.android.orftvthek") + + execute { + isDeviceRootedFingeprint.method.returnEarly(false) + } +} \ No newline at end of file