mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-29 13:00:17 +02:00
feat: hide streak restore
This commit is contained in:
parent
1a40856ae7
commit
1d41aef8e0
@ -252,6 +252,10 @@
|
|||||||
"name": "Show Streak Expiration Info",
|
"name": "Show Streak Expiration Info",
|
||||||
"description": "Shows a Streak Expiration timer next to the Streaks counter"
|
"description": "Shows a Streak Expiration timer next to the Streaks counter"
|
||||||
},
|
},
|
||||||
|
"hide_streak_restore": {
|
||||||
|
"name": "Hide Streak Restore",
|
||||||
|
"description": "Hides the Restore button in the friend feed"
|
||||||
|
},
|
||||||
"hide_story_sections": {
|
"hide_story_sections": {
|
||||||
"name": "Hide Story Section",
|
"name": "Hide Story Section",
|
||||||
"description": "Hide certain UI Elements shown in the story section"
|
"description": "Hide certain UI Elements shown in the story section"
|
||||||
|
@ -26,6 +26,7 @@ class UserInterfaceTweaks : ConfigContainer() {
|
|||||||
val bootstrapOverride = container("bootstrap_override", BootstrapOverride()) { requireRestart() }
|
val bootstrapOverride = container("bootstrap_override", BootstrapOverride()) { requireRestart() }
|
||||||
val mapFriendNameTags = boolean("map_friend_nametags") { requireRestart() }
|
val mapFriendNameTags = boolean("map_friend_nametags") { requireRestart() }
|
||||||
val streakExpirationInfo = boolean("streak_expiration_info") { requireRestart() }
|
val streakExpirationInfo = boolean("streak_expiration_info") { requireRestart() }
|
||||||
|
val hideStreakRestore = boolean("hide_streak_restore") { requireRestart() }
|
||||||
val hideStorySections = multiple("hide_story_sections",
|
val hideStorySections = multiple("hide_story_sections",
|
||||||
"hide_friend_suggestions", "hide_friends", "hide_suggested", "hide_for_you") { requireRestart() }
|
"hide_friend_suggestions", "hide_friends", "hide_suggested", "hide_for_you") { requireRestart() }
|
||||||
val hideUiComponents = multiple("hide_ui_components",
|
val hideUiComponents = multiple("hide_ui_components",
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package me.rhunk.snapenhance.features.impl.ui
|
||||||
|
|
||||||
|
import me.rhunk.snapenhance.core.util.ktx.getObjectField
|
||||||
|
import me.rhunk.snapenhance.core.util.ktx.setObjectField
|
||||||
|
import me.rhunk.snapenhance.features.Feature
|
||||||
|
import me.rhunk.snapenhance.features.FeatureLoadParams
|
||||||
|
import me.rhunk.snapenhance.hook.HookStage
|
||||||
|
import me.rhunk.snapenhance.hook.hookConstructor
|
||||||
|
|
||||||
|
class HideStreakRestore : Feature("HideStreakRestore", loadParams = FeatureLoadParams.ACTIVITY_CREATE_SYNC) {
|
||||||
|
override fun onActivityCreate() {
|
||||||
|
if (!context.config.userInterface.hideStreakRestore.get()) return
|
||||||
|
|
||||||
|
context.classCache.feedEntry.hookConstructor(HookStage.AFTER) { param ->
|
||||||
|
val streakMetadata = param.thisObject<Any>().getObjectField("mStreakMetadata") ?: return@hookConstructor
|
||||||
|
streakMetadata.setObjectField("mExpiredStreak", null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -24,6 +24,7 @@ import me.rhunk.snapenhance.features.impl.spying.StealthMode
|
|||||||
import me.rhunk.snapenhance.features.impl.tweaks.*
|
import me.rhunk.snapenhance.features.impl.tweaks.*
|
||||||
import me.rhunk.snapenhance.features.impl.ui.ClientBootstrapOverride
|
import me.rhunk.snapenhance.features.impl.ui.ClientBootstrapOverride
|
||||||
import me.rhunk.snapenhance.features.impl.ui.FriendFeedMessagePreview
|
import me.rhunk.snapenhance.features.impl.ui.FriendFeedMessagePreview
|
||||||
|
import me.rhunk.snapenhance.features.impl.ui.HideStreakRestore
|
||||||
import me.rhunk.snapenhance.features.impl.ui.PinConversations
|
import me.rhunk.snapenhance.features.impl.ui.PinConversations
|
||||||
import me.rhunk.snapenhance.features.impl.ui.UITweaks
|
import me.rhunk.snapenhance.features.impl.ui.UITweaks
|
||||||
import me.rhunk.snapenhance.manager.Manager
|
import me.rhunk.snapenhance.manager.Manager
|
||||||
@ -104,6 +105,7 @@ class FeatureManager(
|
|||||||
OldBitmojiSelfie::class,
|
OldBitmojiSelfie::class,
|
||||||
SnapToChatMedia::class,
|
SnapToChatMedia::class,
|
||||||
FriendFeedMessagePreview::class,
|
FriendFeedMessagePreview::class,
|
||||||
|
HideStreakRestore::class,
|
||||||
)
|
)
|
||||||
|
|
||||||
initializeFeatures()
|
initializeFeatures()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user