mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-13 13:47:47 +02:00
feat: bypass screenshot detection
This commit is contained in:
@ -312,6 +312,10 @@
|
|||||||
"name": "Messaging",
|
"name": "Messaging",
|
||||||
"description": "Change how you interact with friends",
|
"description": "Change how you interact with friends",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"bypass_screenshot_detection": {
|
||||||
|
"name": "Bypass Screenshot Detection",
|
||||||
|
"description": "Prevents Snapchat from detecting when you take a screenshot"
|
||||||
|
},
|
||||||
"anonymous_story_viewing": {
|
"anonymous_story_viewing": {
|
||||||
"name": "Anonymous Story Viewing",
|
"name": "Anonymous Story Viewing",
|
||||||
"description": "Prevents anyone from knowing you've seen their story"
|
"description": "Prevents anyone from knowing you've seen their story"
|
||||||
|
@ -5,6 +5,7 @@ import me.rhunk.snapenhance.common.config.FeatureNotice
|
|||||||
import me.rhunk.snapenhance.common.data.NotificationType
|
import me.rhunk.snapenhance.common.data.NotificationType
|
||||||
|
|
||||||
class MessagingTweaks : ConfigContainer() {
|
class MessagingTweaks : ConfigContainer() {
|
||||||
|
val bypassScreenshotDetection = boolean("bypass_screenshot_detection") { requireRestart() }
|
||||||
val anonymousStoryViewing = boolean("anonymous_story_viewing")
|
val anonymousStoryViewing = boolean("anonymous_story_viewing")
|
||||||
val hideBitmojiPresence = boolean("hide_bitmoji_presence")
|
val hideBitmojiPresence = boolean("hide_bitmoji_presence")
|
||||||
val hideTypingNotifications = boolean("hide_typing_notifications")
|
val hideTypingNotifications = boolean("hide_typing_notifications")
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
package me.rhunk.snapenhance.core.features.impl.tweaks
|
||||||
|
|
||||||
|
import android.content.ContentResolver
|
||||||
|
import android.database.ContentObserver
|
||||||
|
import android.net.Uri
|
||||||
|
import me.rhunk.snapenhance.core.features.Feature
|
||||||
|
import me.rhunk.snapenhance.core.features.FeatureLoadParams
|
||||||
|
import me.rhunk.snapenhance.core.util.hook.HookStage
|
||||||
|
import me.rhunk.snapenhance.core.util.hook.hook
|
||||||
|
|
||||||
|
class BypassScreenshotDetection : Feature("BypassScreenshotDetection", loadParams = FeatureLoadParams.ACTIVITY_CREATE_SYNC) {
|
||||||
|
override fun onActivityCreate() {
|
||||||
|
if (!context.config.messaging.bypassScreenshotDetection.get()) return
|
||||||
|
ContentResolver::class.java.methods.first {
|
||||||
|
it.name == "registerContentObserver" &&
|
||||||
|
it.parameterTypes.contentEquals(arrayOf(android.net.Uri::class.java, Boolean::class.javaPrimitiveType, ContentObserver::class.java))
|
||||||
|
}.hook(HookStage.BEFORE) { param ->
|
||||||
|
val uri = param.arg<Uri>(0)
|
||||||
|
if (uri.host != "media") return@hook
|
||||||
|
param.setResult(null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -17,6 +17,7 @@ import me.rhunk.snapenhance.core.features.impl.messaging.*
|
|||||||
import me.rhunk.snapenhance.core.features.impl.spying.MessageLogger
|
import me.rhunk.snapenhance.core.features.impl.spying.MessageLogger
|
||||||
import me.rhunk.snapenhance.core.features.impl.spying.StealthMode
|
import me.rhunk.snapenhance.core.features.impl.spying.StealthMode
|
||||||
import me.rhunk.snapenhance.core.features.impl.tweaks.CameraTweaks
|
import me.rhunk.snapenhance.core.features.impl.tweaks.CameraTweaks
|
||||||
|
import me.rhunk.snapenhance.core.features.impl.tweaks.BypassScreenshotDetection
|
||||||
import me.rhunk.snapenhance.core.features.impl.ui.*
|
import me.rhunk.snapenhance.core.features.impl.ui.*
|
||||||
import me.rhunk.snapenhance.core.logger.CoreLogger
|
import me.rhunk.snapenhance.core.logger.CoreLogger
|
||||||
import me.rhunk.snapenhance.core.manager.Manager
|
import me.rhunk.snapenhance.core.manager.Manager
|
||||||
@ -103,6 +104,7 @@ class FeatureManager(
|
|||||||
CallStartConfirmation::class,
|
CallStartConfirmation::class,
|
||||||
SnapPreview::class,
|
SnapPreview::class,
|
||||||
InstantDelete::class,
|
InstantDelete::class,
|
||||||
|
BypassScreenshotDetection::class,
|
||||||
)
|
)
|
||||||
|
|
||||||
initializeFeatures()
|
initializeFeatures()
|
||||||
|
Reference in New Issue
Block a user