commit eb3ea2675b06cbd0f53361349b7a108c49e0643c
parent 234fe2c2aa0ddfee086d8d9a5aa9dcc0eb2ce9b2
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date:   Tue, 23 Jan 2024 20:13:21 +0100

feat: disable memories snap feed

Diffstat:
Mcommon/src/main/assets/lang/en_US.json | 4++++
Mcommon/src/main/kotlin/me/rhunk/snapenhance/common/config/impl/Global.kt | 1+
Mcore/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ConfigurationOverride.kt | 1+
3 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/common/src/main/assets/lang/en_US.json b/common/src/main/assets/lang/en_US.json @@ -506,6 +506,10 @@ "name": "Block Ads", "description": "Prevents Advertisements from being displayed" }, + "disable_memories_snap_feed": { + "name": "Disable Memories Snap Feed", + "description": "Prevents Snapchat from showing recent memories when you swipe up in camera" + }, "spotlight_comments_username": { "name": "Spotlight Comments Username", "description": "Shows author username in Spotlight comments" diff --git a/common/src/main/kotlin/me/rhunk/snapenhance/common/config/impl/Global.kt b/common/src/main/kotlin/me/rhunk/snapenhance/common/config/impl/Global.kt @@ -14,6 +14,7 @@ class Global : ConfigContainer() { val disableMetrics = boolean("disable_metrics") { requireRestart() } val disableStorySections = multiple("disable_story_sections", "friends", "following", "discover") { requireRestart(); requireCleanCache() } val blockAds = boolean("block_ads") + val disableMemoriesSnapFeed = boolean("disable_memories_snap_feed") val spotlightCommentsUsername = boolean("spotlight_comments_username") { requireRestart() } val bypassVideoLengthRestriction = unique("bypass_video_length_restriction", "split", "single") { addNotices( FeatureNotice.BAN_RISK); requireRestart(); nativeHooks() } diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ConfigurationOverride.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ConfigurationOverride.kt @@ -67,6 +67,7 @@ class ConfigurationOverride : Feature("Configuration Override", loadParams = Fea arrayOf("CUSTOM_AD_TRACKER_URL", "CUSTOM_AD_INIT_SERVER_URL", "CUSTOM_AD_SERVER_URL", "INIT_PRIMARY_URL", "INIT_SHADOW_URL").forEach { overrideProperty(it, { context.config.global.blockAds.get() }, { "http://127.0.0.1" }) } + overrideProperty("ENABLE_SNAP_FEED", { context.config.global.disableMemoriesSnapFeed.get() }, { false }) classReference.getAsClass()?.hook( getProperty.getAsString()!!,