mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-20 09:33:57 +00:00
refactor(orfon): RemoveRootDetectionPatch
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user