From 4257a4537293257fa15f5e23c2e2c5d33444c6ac Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 16 Jul 2025 14:30:23 +1000 Subject: [PATCH] fix(canary/SlashCommandsFix): 7.16.2 - use new props --- canary/SlashCommandsFix/build.gradle.kts | 5 ++++- .../coreplugins/slashcommandsfix/Patches.java | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/canary/SlashCommandsFix/build.gradle.kts b/canary/SlashCommandsFix/build.gradle.kts index fb739de..5707059 100644 --- a/canary/SlashCommandsFix/build.gradle.kts +++ b/canary/SlashCommandsFix/build.gradle.kts @@ -1,10 +1,13 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -version = "7.16.1" +version = "7.16.2" description = "Beta backport of SlashCommandsFix" aliucord { changelog.set(""" + # 7.16.2 + * Use new props + # 7.16.1 * Prompt restarts diff --git a/canary/SlashCommandsFix/src/main/java/com/aliucord/coreplugins/slashcommandsfix/Patches.java b/canary/SlashCommandsFix/src/main/java/com/aliucord/coreplugins/slashcommandsfix/Patches.java index 3bbeba7..dcee32c 100644 --- a/canary/SlashCommandsFix/src/main/java/com/aliucord/coreplugins/slashcommandsfix/Patches.java +++ b/canary/SlashCommandsFix/src/main/java/com/aliucord/coreplugins/slashcommandsfix/Patches.java @@ -7,6 +7,8 @@ package com.aliucord.coreplugins.slashcommandsfix; import android.content.Context; +import android.util.Base64; + import com.aliucord.api.GatewayAPI; import com.aliucord.Http; import com.aliucord.Logger; @@ -15,6 +17,7 @@ import com.aliucord.patcher.Patcher; import com.aliucord.patcher.PreHook; import com.aliucord.Utils; import com.aliucord.utils.GsonUtils; +import com.aliucord.utils.RNSuperProperties; import com.discord.api.channel.Channel; import com.discord.models.commands.Application; import com.discord.models.commands.ApplicationCommand; @@ -270,9 +273,19 @@ final class Patches { var applicationIndex = source.getFromCache(applicationIndexCache); if (!applicationIndex.isPresent()) { try { + var versionCode = 218111; + var versionString = "218.11 - rn"; + var userAgent = "Discord-Android/218111;RNA"; + var props = RNSuperProperties.getSuperProperties() + .put("client_version", versionString) + .put("client_build_number", versionCode); + var props64 = Base64.encodeToString(props.toString().getBytes(), 2); + // Request application index from API applicationIndex = Optional.of( Http.Request.newDiscordRNRequest(source.getEndpoint()) + .setHeader("User-Agent", userAgent) + .setHeader("X-Super-Properties", props64) .execute() .json(GsonUtils.getGsonRestApi(), ApiApplicationIndex.class) .toModel()