Skip to content

Commit

Permalink
feat(CieID): Add bypass root check patch (#3011)
Browse files Browse the repository at this point in the history
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
  • Loading branch information
GioPan04 and oSumAtrIX committed Oct 12, 2023
1 parent 03d2628 commit 20cfa8a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package app.revanced.patches.cieid.restrictions.root

import app.revanced.extensions.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.cieid.restrictions.root.fingerprints.CheckRootFingerprint

@Patch(
name = "Bypass root checks",
description = "Removes the restriction to use the app with root permissions or on a custom ROM.",
compatiblePackages = [CompatiblePackage("it.ipzs.cieid")]
)
class BypassRootChecksPatch : BytecodePatch(
setOf(CheckRootFingerprint)
) {
override fun execute(context: BytecodeContext) {
CheckRootFingerprint.result?.mutableMethod?.addInstruction(1, "return-void")
?: throw CheckRootFingerprint.exception
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package app.revanced.patches.cieid.restrictions.root.fingerprints

import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

object CheckRootFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ ->
methodDef.definingClass == "Lit/ipzs/cieid/BaseActivity;" && methodDef.name == "onResume"
}
)

0 comments on commit 20cfa8a

Please sign in to comment.