refactor(orfon): RemoveRootDetectionPatch
This commit is contained in:
parent
52ae070369
commit
b6d1f1c62a
2 changed files with 15 additions and 14 deletions
|
|
@ -1,13 +1,16 @@
|
||||||
package app.revanced.patches.orfon.detection.root
|
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
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
internal val isDeviceRootedFingeprint = fingerprint {
|
internal val BytecodePatchContext.isDeviceRootedMethod by gettingFirstMutableMethodDeclaratively {
|
||||||
accessFlags(AccessFlags.PUBLIC)
|
accessFlags(AccessFlags.PUBLIC)
|
||||||
returns("Z")
|
name("isDeviceRooted")
|
||||||
custom { method, classDef ->
|
definingClass("/RootChecker;"::endsWith)
|
||||||
method.name == "isDeviceRooted" &&
|
returnType("Z")
|
||||||
classDef.endsWith("/RootChecker;")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,16 @@
|
||||||
package app.revanced.patches.orfon.detection.root
|
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_DESCRIPTION_REMOVE_ROOT_DETECTION
|
||||||
import app.revanced.patches.shared.PATCH_NAME_REMOVE_ROOT_DETECTION
|
|
||||||
import app.revanced.util.returnEarly
|
import app.revanced.util.returnEarly
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused", "ObjectPropertyName")
|
||||||
val removeRootDetectionPatch = bytecodePatch(
|
val `Remove root detection` by creatingBytecodePatch(
|
||||||
name = PATCH_NAME_REMOVE_ROOT_DETECTION,
|
|
||||||
description = PATCH_DESCRIPTION_REMOVE_ROOT_DETECTION
|
description = PATCH_DESCRIPTION_REMOVE_ROOT_DETECTION
|
||||||
) {
|
) {
|
||||||
compatibleWith("com.nousguide.android.orftvthek")
|
compatibleWith("com.nousguide.android.orftvthek")
|
||||||
|
|
||||||
apply {
|
apply {
|
||||||
isDeviceRootedFingeprint.method.returnEarly(false)
|
isDeviceRootedMethod.returnEarly(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue