generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(scbeasy): add
remove-debugging-detection
patch (#2287)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
- Loading branch information
1 parent
857cae3
commit 53d91e3
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
.../patches/scbeasy/detection/debugging/annotations/RemoveDebuggingDetectionCompatibility.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package app.revanced.patches.scbeasy.detection.debugging.annotations | ||
|
||
import app.revanced.patcher.annotation.Compatibility | ||
import app.revanced.patcher.annotation.Package | ||
|
||
@Compatibility([Package("com.scb.phone")]) | ||
@Target(AnnotationTarget.CLASS) | ||
internal annotation class RemoveDebuggingDetectionCompatibility |
8 changes: 8 additions & 0 deletions
8
...evanced/patches/scbeasy/detection/debugging/fingerprints/DebuggingDetectionFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package app.revanced.patches.scbeasy.detection.debugging.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
|
||
object DebuggingDetectionFingerprint : MethodFingerprint( | ||
returnType = "Z", | ||
strings = listOf("adb_enabled") | ||
) |
31 changes: 31 additions & 0 deletions
31
...n/app/revanced/patches/scbeasy/detection/debugging/patch/RemoveDebuggingDetectionPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package app.revanced.patches.scbeasy.detection.debugging.patch | ||
|
||
import app.revanced.patcher.annotation.* | ||
import app.revanced.patcher.data.BytecodeContext | ||
import app.revanced.patcher.extensions.addInstructions | ||
import app.revanced.patcher.patch.BytecodePatch | ||
import app.revanced.patcher.patch.PatchResult | ||
import app.revanced.patcher.patch.PatchResultSuccess | ||
import app.revanced.patcher.patch.annotations.Patch | ||
import app.revanced.patches.scbeasy.detection.debugging.annotations.RemoveDebuggingDetectionCompatibility | ||
import app.revanced.patches.scbeasy.detection.debugging.fingerprints.DebuggingDetectionFingerprint | ||
|
||
@Patch(false) | ||
@Name("remove-debugging-detection") | ||
@Description("Removes the USB and wireless debugging checks.") | ||
@RemoveDebuggingDetectionCompatibility | ||
@Version("0.0.1") | ||
class RemoveDebuggingDetectionPatch : BytecodePatch( | ||
listOf(DebuggingDetectionFingerprint) | ||
) { | ||
override fun execute(context: BytecodeContext): PatchResult { | ||
DebuggingDetectionFingerprint.result!!.mutableMethod.addInstructions( | ||
0, | ||
""" | ||
const/4 v0, 0x0 | ||
return v0 | ||
""" | ||
) | ||
return PatchResultSuccess() | ||
} | ||
} |