mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: スーパーアンチチェックのオフを許可
This commit is contained in:
parent
5c10a5a04e
commit
76bd58d984
@ -164,11 +164,22 @@ fun LabFragment() {
|
||||
isSwitch = it.getBoolean("persistent", false)
|
||||
) { v ->
|
||||
it.edit().putBoolean("persistent", v).apply()
|
||||
scope.toast(ctx, LocalString.restartSysToast)
|
||||
return@Function true
|
||||
}
|
||||
|
||||
Function(
|
||||
title = "反检测加强",
|
||||
desc = "可能导致某些设备频繁闪退",
|
||||
descColor = color,
|
||||
isSwitch = it.getBoolean("super_anti", false)
|
||||
) { v ->
|
||||
it.edit().putBoolean("super_anti", v).apply()
|
||||
scope.toast(ctx, LocalString.restartToast)
|
||||
return@Function true
|
||||
}
|
||||
}.onFailure {
|
||||
AppRuntime.log("无法启用免死金牌选项,当前Lsposed模块未激活或者不支持NewSharedPreferences。", Level.WARN)
|
||||
AppRuntime.log("无法启用附加选项,LSPosed模块未激活或者不支持XSharedPreferences", Level.WARN)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,6 +112,7 @@ private open class Default: VarString(
|
||||
b2Mode = "中二病模式",
|
||||
b2ModeDesc = "也许会导致奇怪的问题,大抵就是你看不懂罢了。",
|
||||
restartToast = "重启生效哦!",
|
||||
restartSysToast = "重启系统生效哦!",
|
||||
showDebugLog = "显示调试日志",
|
||||
showDebugLogDesc = "会导致日志刷屏。",
|
||||
antiTrace = "防止调用栈检测",
|
||||
@ -150,6 +151,7 @@ open class VarString(
|
||||
var b2ModeDesc: String,
|
||||
|
||||
var restartToast: String,
|
||||
var restartSysToast: String,
|
||||
|
||||
var showDebugLog: String,
|
||||
var showDebugLogDesc: String,
|
||||
|
@ -84,6 +84,8 @@ int fake_system_property_get(const char *name, char *value) {
|
||||
return backup_system_property_get(name, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
FILE* fake_fopen(const char *filename, const char *mode) {
|
||||
if (strstr(filename, "qemu_pipe")) {
|
||||
LOGI("[Shamrock] bypass qemu detection");
|
||||
@ -107,8 +109,15 @@ NativeOnModuleLoaded native_init(const NativeAPIEntries *entries) {
|
||||
hook_function = entries->hook_func;
|
||||
LOGI("[Shamrock] LSPosed NativeModule Init: %p", hook_function);
|
||||
|
||||
hook_function((void*) __system_property_get, (void *)fake_system_property_get, (void **) &backup_system_property_get);
|
||||
hook_function((void*) fopen, (void*) fake_fopen, (void**) &backup_fopen);
|
||||
|
||||
return on_library_loaded;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_moe_fuqiuluo_shamrock_xposed_actions_AntiDetection_antiNativeDetections(JNIEnv *env,
|
||||
jobject thiz) {
|
||||
if (hook_function == nullptr) return false;
|
||||
hook_function((void*) __system_property_get, (void *)fake_system_property_get, (void **) &backup_system_property_get);
|
||||
hook_function((void*) fopen, (void*) fake_fopen, (void**) &backup_fopen);
|
||||
return true;
|
||||
}
|
@ -6,6 +6,7 @@ import android.content.pm.PackageManager
|
||||
import android.content.pm.VersionedPackage
|
||||
import android.os.Build
|
||||
import de.robv.android.xposed.XC_MethodReplacement
|
||||
import de.robv.android.xposed.XSharedPreferences
|
||||
import de.robv.android.xposed.XposedBridge
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import moe.fuqiuluo.shamrock.helper.Level
|
||||
@ -13,6 +14,7 @@ import moe.fuqiuluo.shamrock.helper.LogCenter
|
||||
import moe.fuqiuluo.shamrock.remote.service.config.ShamrockConfig
|
||||
import moe.fuqiuluo.shamrock.tools.hookMethod
|
||||
import moe.fuqiuluo.shamrock.xposed.XposedEntry
|
||||
import moe.fuqiuluo.shamrock.xposed.loader.FuckAMS
|
||||
import moe.fuqiuluo.shamrock.xposed.loader.LuoClassloader
|
||||
import moe.fuqiuluo.shamrock.xposed.loader.NativeLoader
|
||||
|
||||
@ -20,6 +22,8 @@ import moe.fuqiuluo.shamrock.xposed.loader.NativeLoader
|
||||
* 反检测
|
||||
*/
|
||||
class AntiDetection: IAction {
|
||||
external fun antiNativeDetections(): Boolean
|
||||
|
||||
override fun invoke(ctx: Context) {
|
||||
antiFindPackage(ctx)
|
||||
antiNativeDetection()
|
||||
@ -49,7 +53,15 @@ class AntiDetection: IAction {
|
||||
LogCenter.log("[Shamrock] Shamrock反检测启动失败(env=$env, injected=$injected)", Level.ERROR)
|
||||
} else {
|
||||
XposedEntry.sec_static_nativehook_inited = true
|
||||
LogCenter.log("[Shamrock] Shamrock反检测启动成功", Level.INFO)
|
||||
val pref = XSharedPreferences("moe.fuqiuluo.shamrock", "shared_config")
|
||||
if (pref.file.canRead()) {
|
||||
if (pref.getBoolean("super_anti", false)) {
|
||||
antiNativeDetections()
|
||||
LogCenter.log("[Shamrock] Shamrock反检测启动成功", Level.INFO)
|
||||
}
|
||||
} else {
|
||||
LogCenter.log("[Shamrock] unable to load XSharedPreferences", Level.WARN)
|
||||
}
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
LogCenter.log("[Shamrock] Shamrock反检测启动失败,请检查LSPosed版本使用大于100: ${e.message}", Level.ERROR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user