fix(core): crashes

Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
rhunk
2025-07-06 13:22:43 +02:00
parent e7822d8fc5
commit 6bae2de516
3 changed files with 13 additions and 2 deletions

View File

@@ -282,7 +282,7 @@ class HomeSettings : Routes.Route() {
Column(
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
PreferenceToggle(context.sharedPreferences, key = "test_mode", text = "Test Mode (Debugging)")
PreferenceToggle(context.sharedPreferences, key = "test_mode", text = "Test Mode (FOR DEBUGGING ONLY)")
PreferenceToggle(context.sharedPreferences, key = "disable_feature_loading", text = "Disable Feature Loading")
PreferenceToggle(context.sharedPreferences, key = "disable_mapper", text = "Disable Auto Mapper")
}

View File

@@ -24,6 +24,8 @@ import me.rhunk.snapenhance.common.config.VersionRequirement
import me.rhunk.snapenhance.common.ui.createComposeView
import me.rhunk.snapenhance.core.event.events.impl.UnaryCallEvent
import me.rhunk.snapenhance.core.ui.CustomComposable
import me.rhunk.snapenhance.core.util.hook.HookStage
import me.rhunk.snapenhance.core.util.hook.hook
import me.rhunk.snapenhance.core.util.ktx.getObjectField
class SecurityFeatures(
@@ -89,6 +91,11 @@ class SecurityFeatures(
}
}
context.androidContext.classLoader.loadClass("com.snapchat.client.client_attestation.ArgosClient\$CppProxy").apply {
hook("getArgosTokenAsync", HookStage.BEFORE) { it.setResult(null) }
hook("getAttestationHeaders", HookStage.BEFORE) { it.setResult(null) }
}
context.features.addActivityCreateListener { activity ->
if (!activity.javaClass.name.endsWith("LoginSignupActivity")) return@addActivityCreateListener
@@ -110,7 +117,7 @@ class SecurityFeatures(
Icon(Icons.Rounded.NotInterested, contentDescription = null, tint = MaterialTheme.colorScheme.onSurface, modifier = Modifier.size(110.dp))
Spacer(Modifier.height(50.dp))
Text(
"SnapEnhance can't be used to login or signup because your Snapchat version isn't the recommended one (v${MOD_DETECTION_VERSION_CHECK.maxVersion?.first ?: "0.0.0"}). Please downgrade to continue using it.\n\nFor more details, join t.me/snapenhance_chat",
"SnapEnhance can't be used to login or signup because your Snapchat version isn't the recommended one. Please downgrade to Snapchat v${MOD_DETECTION_VERSION_CHECK.maxVersion?.first ?: "0.0.0"} or disable SnapEnhance in LSPosed to continue.\n\nFor more details, join t.me/snapenhance_chat",
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Center,
)

View File

@@ -243,6 +243,10 @@ class SnapEnhance {
}?.forEach { method ->
method.hook(HookStage.BEFORE) {
appContext.log.verbose("called $method")
if (Throwable().stackTrace.lastOrNull()?.methodName == "getAttestationPayloadProto") {
appContext.log.verbose("sleeping")
Thread.sleep(Long.MAX_VALUE)
}
it.setResult(null)
}
} ?: error("Failed to get pluginNativeClass class")