mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-28 12:30:12 +02:00
Merge remote-tracking branch 'origin/refactor_2_0_0' into refactor_2_0_0
This commit is contained in:
commit
2cf172e597
@ -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) }
|
||||
}
|
@ -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 {
|
||||
|
@ -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
|
||||
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user