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 index 525d4f37d..9f4570309 100644 --- 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 @@ -1,13 +1,16 @@ package app.revanced.patches.orfon.detection.root -import app.revanced.patcher.fingerprint +import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively +import app.revanced.patcher.accessFlags +import app.revanced.patcher.definingClass +import app.revanced.patcher.name +import app.revanced.patcher.patch.BytecodePatchContext +import app.revanced.patcher.returnType import com.android.tools.smali.dexlib2.AccessFlags -internal val isDeviceRootedFingeprint = fingerprint { +internal val BytecodePatchContext.isDeviceRootedMethod by gettingFirstMutableMethodDeclaratively { accessFlags(AccessFlags.PUBLIC) - returns("Z") - custom { method, classDef -> - method.name == "isDeviceRooted" && - classDef.endsWith("/RootChecker;") - } + name("isDeviceRooted") + definingClass("/RootChecker;"::endsWith) + returnType("Z") } 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 index f0dd38df2..e0a6198d8 100644 --- 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 @@ -1,18 +1,16 @@ package app.revanced.patches.orfon.detection.root -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.shared.PATCH_DESCRIPTION_REMOVE_ROOT_DETECTION -import app.revanced.patches.shared.PATCH_NAME_REMOVE_ROOT_DETECTION import app.revanced.util.returnEarly -@Suppress("unused") -val removeRootDetectionPatch = bytecodePatch( - name = PATCH_NAME_REMOVE_ROOT_DETECTION, +@Suppress("unused", "ObjectPropertyName") +val `Remove root detection` by creatingBytecodePatch( description = PATCH_DESCRIPTION_REMOVE_ROOT_DETECTION ) { compatibleWith("com.nousguide.android.orftvthek") apply { - isDeviceRootedFingeprint.method.returnEarly(false) + isDeviceRootedMethod.returnEarly(false) } -} \ No newline at end of file +}