mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-04-29 22:24:35 +02:00
refactor(common): remove native hooks feature notice
Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
parent
008c094cd4
commit
5fc415d56c
@ -382,7 +382,6 @@ class FeaturesRootSection : Routes.Route() {
|
||||
FeatureNotice.UNSTABLE.key to Color(0xFFFFFB87),
|
||||
FeatureNotice.BAN_RISK.key to Color(0xFFFF8585),
|
||||
FeatureNotice.INTERNAL_BEHAVIOR.key to Color(0xFFFFFB87),
|
||||
FeatureNotice.REQUIRE_NATIVE_HOOKS.key to Color(0xFFFF5722),
|
||||
)
|
||||
|
||||
val versionCheck = remember { property.key.params.versionCheck }
|
||||
@ -426,6 +425,7 @@ class FeaturesRootSection : Routes.Route() {
|
||||
Text(
|
||||
text = context.translation[property.key.propertyName()],
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 16.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
Text(
|
||||
|
@ -344,8 +344,7 @@
|
||||
"notices": {
|
||||
"unstable": "\u26A0 Unstable",
|
||||
"ban_risk": "\u26A0 This feature may cause bans",
|
||||
"internal_behavior": "\u26A0 This may break Snapchat internal behavior",
|
||||
"require_native_hooks": "\u26A0 This feature requires experimental Native Hooks to work correctly"
|
||||
"internal_behavior": "\u26A0 This may break Snapchat internal behavior"
|
||||
},
|
||||
"properties": {
|
||||
"downloader": {
|
||||
|
@ -16,8 +16,7 @@ enum class FeatureNotice(
|
||||
) {
|
||||
UNSTABLE("unstable"),
|
||||
BAN_RISK("ban_risk"),
|
||||
INTERNAL_BEHAVIOR("internal_behavior"),
|
||||
REQUIRE_NATIVE_HOOKS("require_native_hooks");
|
||||
INTERNAL_BEHAVIOR("internal_behavior");
|
||||
|
||||
val id get() = 1 shl ordinal
|
||||
}
|
||||
@ -90,10 +89,6 @@ class ConfigParams(
|
||||
this._flags = (this._flags ?: 0) or values.fold(0) { acc, flag -> acc or flag.id }
|
||||
}
|
||||
|
||||
fun nativeHooks() {
|
||||
addNotices(FeatureNotice.REQUIRE_NATIVE_HOOKS)
|
||||
}
|
||||
|
||||
fun requireRestart() {
|
||||
addFlags(ConfigFlag.REQUIRE_RESTART)
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ class Experimental : ConfigContainer() {
|
||||
val meoPasscodeBypass = boolean("meo_passcode_bypass")
|
||||
val noFriendScoreDelay = boolean("no_friend_score_delay") { requireRestart()}
|
||||
val bestFriendPinning = boolean("best_friend_pinning") { requireRestart(); addNotices(FeatureNotice.UNSTABLE) }
|
||||
val e2eEncryption = container("e2ee", E2EEConfig()) { requireRestart(); nativeHooks() }
|
||||
val e2eEncryption = container("e2ee", E2EEConfig()) { requireRestart() }
|
||||
val hiddenSnapchatPlusFeatures = boolean("hidden_snapchat_plus_features") {
|
||||
addNotices(FeatureNotice.BAN_RISK, FeatureNotice.UNSTABLE)
|
||||
requireRestart()
|
||||
|
@ -48,7 +48,7 @@ class Global : ConfigContainer() {
|
||||
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() }
|
||||
FeatureNotice.BAN_RISK); requireRestart() }
|
||||
val defaultVideoPlaybackRate = float("default_video_playback_rate", 1.0F) { requireRestart(); inputCheck = { (it.toFloatOrNull() ?: 1.0F) in 0.1F..4.0F} }
|
||||
val videoPlaybackRateSlider = boolean("video_playback_rate_slider") { requireRestart() }
|
||||
val disableGooglePlayDialogs = boolean("disable_google_play_dialogs") { requireRestart() }
|
||||
|
@ -79,7 +79,6 @@ class MessagingTweaks : ConfigContainer() {
|
||||
) { requireRestart(); customOptionTranslationPath = "content_type" }
|
||||
val preventMessageSending = multiple("prevent_message_sending", *NotificationType.getOutgoingValues().map { it.key }.toTypedArray()) {
|
||||
customOptionTranslationPath = "features.options.notifications"
|
||||
nativeHooks()
|
||||
}
|
||||
val friendMutationNotifier = multiple("friend_mutation_notifier",
|
||||
"remove_friend",
|
||||
@ -94,7 +93,7 @@ class MessagingTweaks : ConfigContainer() {
|
||||
customOptionTranslationPath = "features.options.notifications"
|
||||
}
|
||||
val messageLogger = container("message_logger", MessageLoggerConfig()) { requireRestart() }
|
||||
val galleryMediaSendOverride = unique("gallery_media_send_override", "always_ask", "SNAP", "NOTE", "SAVEABLE_SNAP") { requireRestart(); nativeHooks() }
|
||||
val galleryMediaSendOverride = unique("gallery_media_send_override", "always_ask", "SNAP", "NOTE", "SAVEABLE_SNAP") { requireRestart() }
|
||||
val stripMediaMetadata = multiple("strip_media_metadata", "hide_caption_text", "hide_snap_filters", "hide_extras", "remove_audio_note_duration", "remove_audio_note_transcript_capability") { requireRestart() }
|
||||
val bypassMessageRetentionPolicy = boolean("bypass_message_retention_policy") { addNotices(FeatureNotice.UNSTABLE); requireRestart() }
|
||||
val bypassMessageActionRestrictions = boolean("bypass_message_action_restrictions") { requireRestart() }
|
||||
|
@ -18,5 +18,5 @@ class RootConfig : ConfigContainer() {
|
||||
val experimental = container("experimental", Experimental()) { icon = Icons.Default.Science; addNotices(
|
||||
FeatureNotice.UNSTABLE) }
|
||||
val scripting = container("scripting", Scripting()) { icon = Icons.Default.DataObject }
|
||||
val friendTracker = container("friend_tracker", FriendTrackerConfig()) { icon = Icons.Default.PersonSearch; nativeHooks() }
|
||||
val friendTracker = container("friend_tracker", FriendTrackerConfig()) { icon = Icons.Default.PersonSearch }
|
||||
}
|
@ -50,7 +50,7 @@ enum class MessagingRuleType(
|
||||
AUTO_DOWNLOAD("auto_download", true, Icons.Outlined.DownloadForOffline),
|
||||
AUTO_SAVE("auto_save", true, Icons.Outlined.Save, defaultValue = "blacklist"),
|
||||
AUTO_OPEN_SNAPS("auto_open_snaps", true, Icons.Outlined.OpenInFull, configNotices = arrayOf(FeatureNotice.BAN_RISK, FeatureNotice.UNSTABLE), defaultValue = null),
|
||||
UNSAVEABLE_MESSAGES("unsaveable_messages", true, Icons.Outlined.FolderOff, configNotices = arrayOf(FeatureNotice.REQUIRE_NATIVE_HOOKS), defaultValue = null),
|
||||
UNSAVEABLE_MESSAGES("unsaveable_messages", true, Icons.Outlined.FolderOff, defaultValue = null),
|
||||
HIDE_FRIEND_FEED("hide_friend_feed", false, Icons.Outlined.VisibilityOff, showInFriendMenu = false),
|
||||
E2E_ENCRYPTION("e2e_encryption", false, Icons.Outlined.Lock),
|
||||
PIN_CONVERSATION("pin_conversation", false, Icons.Outlined.PushPin, showInFriendMenu = false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user