mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-31 05:50:18 +02:00
feat: 2d bitmoji selfie
This commit is contained in:
parent
33131728ca
commit
3ba4e573ad
@ -191,6 +191,10 @@
|
|||||||
"name": "Hide UI Components",
|
"name": "Hide UI Components",
|
||||||
"description": "Select which UI components to hide"
|
"description": "Select which UI components to hide"
|
||||||
},
|
},
|
||||||
|
"2d_bitmoji_selfie": {
|
||||||
|
"name": "2D Bitmoji Selfie",
|
||||||
|
"description": "Brings back the 2D selfie from older Snapchat versions\nYou need to clean the Snapchat cache from debug for this to take effect"
|
||||||
|
},
|
||||||
"disable_spotlight": {
|
"disable_spotlight": {
|
||||||
"name": "Disable Spotlight",
|
"name": "Disable Spotlight",
|
||||||
"description": "Disables the Spotlight page"
|
"description": "Disables the Spotlight page"
|
||||||
|
@ -24,6 +24,7 @@ class UserInterfaceTweaks : ConfigContainer() {
|
|||||||
"hide_live_location_share_button",
|
"hide_live_location_share_button",
|
||||||
"hide_call_buttons"
|
"hide_call_buttons"
|
||||||
)
|
)
|
||||||
|
val ddBitmojiSelfie = boolean("2d_bitmoji_selfie")
|
||||||
val disableSpotlight = boolean("disable_spotlight")
|
val disableSpotlight = boolean("disable_spotlight")
|
||||||
val startupTab = unique("startup_tab",
|
val startupTab = unique("startup_tab",
|
||||||
"ngs_map_icon_container",
|
"ngs_map_icon_container",
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
package me.rhunk.snapenhance.features.impl.tweaks
|
||||||
|
|
||||||
|
import me.rhunk.snapenhance.core.eventbus.events.impl.NetworkApiRequestEvent
|
||||||
|
import me.rhunk.snapenhance.features.Feature
|
||||||
|
import me.rhunk.snapenhance.features.FeatureLoadParams
|
||||||
|
import me.rhunk.snapenhance.util.snap.BitmojiSelfie
|
||||||
|
|
||||||
|
class OldBitmojiSelfie : Feature("OldBitmojiSelfie", loadParams = FeatureLoadParams.INIT_SYNC) {
|
||||||
|
override fun init() {
|
||||||
|
val urlPrefixes = arrayOf("https://images.bitmoji.com/3d/render/", "https://cf-st.sc-cdn.net/3d/render/")
|
||||||
|
val state by context.config.userInterface.ddBitmojiSelfie
|
||||||
|
|
||||||
|
context.event.subscribe(NetworkApiRequestEvent::class, { state }) { event ->
|
||||||
|
if (urlPrefixes.firstOrNull { event.url.startsWith(it) } == null) return@subscribe
|
||||||
|
val bitmojiURI = event.url.substringAfterLast("/")
|
||||||
|
event.url =
|
||||||
|
BitmojiSelfie.BitmojiSelfieType.STANDARD.prefixUrl +
|
||||||
|
bitmojiURI +
|
||||||
|
(bitmojiURI.takeIf { !it.contains("?") }?.let { "?" } ?: "&") + "transparent=1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -30,6 +30,7 @@ import me.rhunk.snapenhance.features.impl.tweaks.GooglePlayServicesDialogs
|
|||||||
import me.rhunk.snapenhance.features.impl.tweaks.LocationSpoofer
|
import me.rhunk.snapenhance.features.impl.tweaks.LocationSpoofer
|
||||||
import me.rhunk.snapenhance.features.impl.tweaks.MediaQualityLevelOverride
|
import me.rhunk.snapenhance.features.impl.tweaks.MediaQualityLevelOverride
|
||||||
import me.rhunk.snapenhance.features.impl.tweaks.Notifications
|
import me.rhunk.snapenhance.features.impl.tweaks.Notifications
|
||||||
|
import me.rhunk.snapenhance.features.impl.tweaks.OldBitmojiSelfie
|
||||||
import me.rhunk.snapenhance.features.impl.tweaks.SendOverride
|
import me.rhunk.snapenhance.features.impl.tweaks.SendOverride
|
||||||
import me.rhunk.snapenhance.features.impl.tweaks.SnapchatPlus
|
import me.rhunk.snapenhance.features.impl.tweaks.SnapchatPlus
|
||||||
import me.rhunk.snapenhance.features.impl.tweaks.UnlimitedSnapViewTime
|
import me.rhunk.snapenhance.features.impl.tweaks.UnlimitedSnapViewTime
|
||||||
@ -95,6 +96,7 @@ class FeatureManager(private val context: ModContext) : Manager {
|
|||||||
register(ProfilePictureDownloader::class)
|
register(ProfilePictureDownloader::class)
|
||||||
register(AddFriendSourceSpoof::class)
|
register(AddFriendSourceSpoof::class)
|
||||||
register(DisableReplayInFF::class)
|
register(DisableReplayInFF::class)
|
||||||
|
register(OldBitmojiSelfie::class)
|
||||||
|
|
||||||
initializeFeatures()
|
initializeFeatures()
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package me.rhunk.snapenhance.util.snap
|
package me.rhunk.snapenhance.util.snap
|
||||||
|
|
||||||
object BitmojiSelfie {
|
object BitmojiSelfie {
|
||||||
enum class BitmojiSelfieType {
|
enum class BitmojiSelfieType(
|
||||||
STANDARD,
|
val prefixUrl: String,
|
||||||
THREE_D
|
) {
|
||||||
|
STANDARD("https://sdk.bitmoji.com/render/panel/"),
|
||||||
|
THREE_D("https://images.bitmoji.com/3d/render/")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getBitmojiSelfie(selfieId: String?, avatarId: String?, type: BitmojiSelfieType): String? {
|
fun getBitmojiSelfie(selfieId: String?, avatarId: String?, type: BitmojiSelfieType): String? {
|
||||||
@ -11,8 +13,8 @@ object BitmojiSelfie {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
return when (type) {
|
return when (type) {
|
||||||
BitmojiSelfieType.STANDARD -> "https://sdk.bitmoji.com/render/panel/$selfieId-$avatarId-v1.webp?transparent=1"
|
BitmojiSelfieType.STANDARD -> "${type.prefixUrl}$selfieId-$avatarId-v1.webp?transparent=1"
|
||||||
BitmojiSelfieType.THREE_D -> "https://images.bitmoji.com/3d/render/$selfieId-$avatarId-v1.webp?trim=circle"
|
BitmojiSelfieType.THREE_D -> "${type.prefixUrl}$selfieId-$avatarId-v1.webp?trim=circle"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user