Protect JS V5(Although I don’t know what is the use for players other than China)
-
Although I don’t know what is the use for players other than China,But I still plan to make it public and in Scripts.
This js is for reference only, need to be used to fix the js.var DeBug = setting.boolean("DeBug", false), Values = [DeBug]; var File = Java.type("java.io.File"); var FileReader = Java.type("java.io.FileReader"); var FileWriter = Java.type("java.io.FileWriter"); var BufferedReader = Java.type("java.io.BufferedReader"); var BufferedWriter = Java.type("java.io.BufferedWriter"); var ChatComponentText = Java.type('net.minecraft.util.ChatComponentText'); var Display = Java.type('org.lwjgl.opengl.Display'); var S40PacketDisconnect = Java.type('net.minecraft.network.play.server.S40PacketDisconnect'); function Validation() { var flag; var Global = ["xix", "fg", "by maxigen", "asflypassword", "revel", "slience", "渣渣", "内部", "Cynicism", "873332460", "Nightsky", "破甲", "你妈"]; if (!CheckHUD(Global) || !CheckModules(Global) || !CheckTitle(Global) || Alarm()) { flag = true; } //chat.print('[Protect] Validation-[' + !Flag + '].'); return !flag; } function CheckHUD(Global) { var flag; var Texts = []; var Image = [""]; var Config = function () { try { return JSON.parse(readFile(LiquidBounce.fileManager.hudConfig.getFile())); } catch (err) { return []; }}(); for (var i in Config) { var Element = Config[i]; switch (Element.Type) { case "Image": if (MatchText([Element.Image], Image, true, true)) { flag = true; } break; case "Text": if (MatchText([Element.DisplayText], Global.concat(Texts), false, false) || NumberFlag(Element.DisplayText)) { flag = true; } if (MatchText([Element.DisplayText], ["DeBug", "AsFly"], false, false) || true) { isDeBug = true; } break; } } //chat.print('[Protect] HUD-[' + !Flag + '].'); return !flag; } function CheckModules(Global) { var Texts = []; var Config = function () { try { return JSON.parse(readFile(LiquidBounce.fileManager.modulesConfig.getFile())); } catch (err) { return []; }}(); var modules = Object.keys(Config); var flag = MatchText(modules, Global.concat(Texts)); if (!flag) { for (var i in modules) { if (NumberFlag(modules[i])) { return false; } } } //chat.print('[Protect] Modules-[' + !Flag + '].'); return !flag; } function CheckTitle(Global) { var Texts = []; var Title = Java.type('org.lwjgl.opengl.Display').getTitle(); Texts = Global.concat(Texts); for (var i in Texts) { if (Title.indexOf(Texts[i]) != -1 || NumberFlag(Title)) { return false; } } return true; } function NumberFlag(Text) { var amount = 0; var number = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '〇', '①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑴', '⑵', '⑶', '⑷', '⑸', '⑹', '⑺', '⑻', '⑼', '⒈', '⒉', '⒊', '⒋', '⒌', '⒍', '⒎', '⒏', '⒐', '❶', '❷', '❸', '❹', '❺', '❻', '❼', '❽', '❾', '㈠', '㈡', '㈢', '㈣', '㈤', '㈥', '㈦', '㈧', '㈨', '一', '二', '三', '四', '五', '六', '七', '八', '九', '零']; for (var i = 0; i < Text.length; i++) { if (number.indexOf(Text[i]) != -1) { amount++; } } if (amount > 5 && amount < 11) { return true; } return false; } function Alarm() { var flag = (Record(Flag), Mark[0]); var Config = function () { try { return JSON.parse(readFile(LiquidBounce.fileManager.hudConfig.getFile())); } catch (err) { return []; }}(); if (!flag) { return flag; } for (var i in Config) { if (Config[i].Type == 'Text') { if (MatchText([Config[i].DisplayText], ["AsFly-Design: As丶One & Cookie & mumy"], false, false)) { return false; } } } return flag; } function Record(flag) { Mark = function () { try { return JSON.parse(readFile(mc.mcDataDir + "/config/Record.json")); } catch (err) { return null }}(); if (!Mark || flag) { Mark = [!!Flag, "By-mumy"]; writeFile(mc.mcDataDir + "/config/Record.json", JSON.stringify(Mark)); } } function MatchText(Arr, TextArr, Case, Strict) { var a, b; for (var i in Arr) { for (var x in TextArr) { Arr[i] += '', TextArr[x] += ''; a = Case ? Arr[i] : Arr[i].toLowerCase(); b = Case ? TextArr[x] : TextArr[x].toLowerCase(); if (Strict ? a == b : a.indexOf(b) != -1) { return true; } } } return false; } function Protect() { if (Flag || Alarm() || isDeBug && DeBug.get()) { Record(Flag || isDeBug && DeBug.get()); var Text = new ChatComponentText(""); if (mc.isSingleplayer()) { return false; } if (DeBug.get()) { DeBug.set(false); } try { mc.thePlayer.sendQueue.handleDisconnect(new S40PacketDisconnect(Text)); } catch (err) { mc.thePlayer.sendQueue.getNetworkManager().closeChannel(Text); } finally { return true; for (var i = 0; i > -1; i++) { i++; } } } return false; } function readFile(filePath) { try { var file = new File(filePath); var reader = new BufferedReader(new FileReader(file)); var content = ''; var line; while ((line = reader.readLine()) !== null) { content += line; } return content; } catch (err) { throw err; return null; } } function writeFile(path, string) { try { writer = new BufferedWriter(new FileWriter(path)); writer.write(string); writer.close(); } catch (err) {} }
-
@cookiechinese What does this do?