commit 2cf172e597efbadbff2c41f2434a7be4b86cfbca parent 7c2f23f084cb94921cf4a489cc057feb947e8032 Author: rhunk <101876869+rhunk@users.noreply.github.com> Date: Mon, 4 Sep 2023 00:24:45 +0200 Merge remote-tracking branch 'origin/refactor_2_0_0' into refactor_2_0_0 Diffstat:
3 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/config/impl/Spoof.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/config/impl/Spoof.kt @@ -17,6 +17,8 @@ class Spoof : ConfigContainer() { val debugFlag = boolean("debug_flag") val mockLocationState = boolean("mock_location") val splitClassLoader = string("split_classloader") + val isLowEndDevice = string("low_end_device") + val getDataDirectory = string("get_data_directory") } val device = container("device", Device()) { addNotices(FeatureNotice.BAN_RISK) } } \ No newline at end of file diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/data/SnapClassCache.kt b/core/src/main/kotlin/me/rhunk/snapenhance/data/SnapClassCache.kt @@ -17,6 +17,8 @@ class SnapClassCache ( val conversation by lazy { findClass("com.snapchat.client.messaging.Conversation") } val feedManager by lazy { findClass("com.snapchat.client.messaging.FeedManager\$CppProxy") } val chromiumJNIUtils by lazy { findClass("org.chromium.base.JNIUtils")} + val chromiumBuildInfo by lazy { findClass("org.chromium.base.BuildInfo")} + val chromiumPathUtils by lazy { findClass("org.chromium.base.PathUtils")} private fun findClass(className: String): Class<*> { return try { diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/experiments/DeviceSpooferHook.kt b/core/src/main/kotlin/me/rhunk/snapenhance/features/impl/experiments/DeviceSpooferHook.kt @@ -15,12 +15,15 @@ class DeviceSpooferHook: Feature("device_spoofer", loadParams = FeatureLoadParam val debugFlag by context.config.experimental.spoof.device.debugFlag val mockLocationState by context.config.experimental.spoof.device.mockLocationState val splitClassLoader by context.config.experimental.spoof.device.splitClassLoader + val isLowEndDevice by context.config.experimental.spoof.device.isLowEndDevice + val getDataDirectory by context.config.experimental.spoof.device.getDataDirectory val settingsSecureClass = android.provider.Settings.Secure::class.java val fingerprintClass = android.os.Build::class.java val packageManagerClass = android.content.pm.PackageManager::class.java val applicationInfoClass = android.content.pm.ApplicationInfo::class.java + //FINGERPRINT if (fingerprint.isNotEmpty()) { Hooker.hook(fingerprintClass, "FINGERPRINT", HookStage.BEFORE) { hookAdapter -> hookAdapter.setResult(fingerprint) @@ -32,6 +35,7 @@ class DeviceSpooferHook: Feature("device_spoofer", loadParams = FeatureLoadParam } } + //ANDROID ID if (androidId.isNotEmpty()) { Hooker.hook(settingsSecureClass, "getString", HookStage.BEFORE) { hookAdapter -> if(hookAdapter.args()[1] == "android_id") { @@ -68,5 +72,22 @@ class DeviceSpooferHook: Feature("device_spoofer", loadParams = FeatureLoadParam hookAdapter.setResult(splitClassLoader) } } + + //ISLOWENDDEVICE + if(isLowEndDevice.isNotEmpty()) { + Hooker.hook(context.classCache.chromiumBuildInfo, "getAll", HookStage.BEFORE) { hookAdapter -> + hookAdapter.setResult(isLowEndDevice) + } + } + + //GETDATADIRECTORY + if(getDataDirectory.isNotEmpty()) { + Hooker.hook(context.classCache.chromiumPathUtils, "getDataDirectory", HookStage.BEFORE) {hookAdapter -> + hookAdapter.setResult(getDataDirectory) + } + } + + //accessibility_enabled + } } \ No newline at end of file