Raw Source
serj_m1 / MireaTasher

// @ts-nocheck
// ==UserScript==
// @name         MireaTasher
// @namespace    http://tampermonkey.net/
// @version      1.8
// @description  sync students mark
// @license      MIT
// @updateURL    https://openuserjs.org/meta/DimaMakarov1941yandex.ru/MireaTasher.meta.js
// @author       anonim
// @downloadURL  https://openuserjs.org/install/DimaMakarov1941yandex.ru/MireaTasher.user.js
// @require      https://www.gstatic.com/firebasejs/8.1.1/firebase-app.js
// @require      https://www.gstatic.com/firebasejs/8.1.1/firebase-auth.js
// @require      https://www.gstatic.com/firebasejs/8.1.1/firebase-database.js
// @require      https://raw.githubusercontent.com/emn178/js-sha256/master/build/sha256.min.js
// @match        https://online-edu.mirea.ru/*
// @grant        none
// ==/UserScript==
var _0x343e = [
	"74942:web:",
	"replace",
	"ta\x20=*(",
	"ent",
	"appendChil",
	"вете.</div",
	"></div><di",
	"\x20номера\x20от",
	"initialize",
	"from",
	"c90838cff1",
	"createElem",
	"30%",
	"lue=\x22Пожал",
	"parentNode",
	"=\x22UserAnsw",
	"ref",
	"slice",
	"floor",
	"fixed",
	"ById",
	"set",
	"верен\x20в\x20от",
	"green",
	"at:\x20left;\x22",
	"user/",
	"qtext",
	"ButtonForB",
	"style",
	"&#12288;<i",
	"та,\x20опишит",
	"sByClassNa",
	"UserAnswer",
	"keys",
	"ветов,\x20они",
	"1:10168479",
	"val",
	"rea\x20style=",
	"questions/",
	"⬆\x20ответ\x20|\x20",
	"b.appspot.",
	"мочь\x20разви",
	"\x20каждый\x20ра",
	"ится.<div\x20",
	"length",
	";\x22><p></p>",
	"ьный\x20ответ",
	"е\x20ответ\x20сл",
	"loat:\x20left",
	"ant\x20get\x20da",
	"полем\x20и\x20от",
	"onclick",
	"EWmrwlj4Bm",
	"вет\x20сохран",
	"database",
	"com",
	"none",
	"ответ)</p>",
	"ветивших⬆\x20",
	"див\x20правил",
	"10px;\x22>Впи",
	"%\x20(",
	"innerHTML",
	"Comment",
	"вопрос.",
	"\x20нет\x20внизу",
	"о\x20рядом\x20с\x20",
	"value",
	"овами,\x20не\x20",
	"\x20можете\x20по",
	"712befd564",
	">\x20Пожалуйс",
	"e=\x22font-si",
	"iamsure",
	"onblur",
	"herit;\x22\x20va",
	"600",
	"ze:10px;\x22=",
	"filter",
	"<hr/><p>Вы",
	"<p\x20style=\x22",
	"\x20(просмотр",
	"Вопрос",
	"\x20|\x20",
	"шите\x20ответ",
	"b.firebase",
	",\x20если\x20его",
	"app.com",
	"onload",
	"Посмотрел\x20",
	"тию\x20проект",
	"#9f8200",
	"Br><p\x20styl",
	"blue",
	"accesshide",
	"red",
	"/Вопрос",
	"nput\x20id=\x22i",
	"\x20суда.\x22\x20id",
	"устое\x20мест",
	"includes",
	"forEach",
	".<hr/>",
	"ox\x22\x20name=\x22",
	"r-headings",
	"жать\x20\x20на\x20п",
	"14px",
	"свой\x20ответ",
	"cked\x22>\x20Я\x20у",
	"firebaseio",
	"className",
	"App",
	"erDB\x22></te",
	"Error,\x20i\x20c",
	"mireatestd",
	".com",
	"жмите\x20на\x20п",
	"torAll",
	"amsure\x22\x20ty",
	"getElement",
	"a[title=\x22П",
	"querySelec",
	"10px\x2020px",
	"><Br><Br><",
	"white",
	"checked",
	"🤔❓",
	"росмотр\x20пр",
	"\x20буквы\x20или",
];
(function (_0x31412e, _0x56b022) {
	var _0x343eb0 = function (_0x2b0a2e) {
		while (--_0x2b0a2e) {
			_0x31412e["push"](_0x31412e["shift"]());
		}
	};
	_0x343eb0(++_0x56b022);
})(_0x343e, 0x1ab);
var _0x2b0a = function (_0x31412e, _0x56b022) {
	_0x31412e = _0x31412e - 0x148;
	var _0x343eb0 = _0x343e[_0x31412e];
	return _0x343eb0;
};
var _0x121d6f = _0x2b0a;
window[_0x121d6f(0x178)] = (async function () {
	var _0x40e598 = _0x121d6f,
		_0x89e3cb = document[_0x40e598(0x197) + _0x40e598(0x1c0) + "me"](
			_0x40e598(0x17e)
		);
	if (Array[_0x40e598(0x1aa)](_0x89e3cb)["length"] > 0x0) {
		function _0x4126c6(
			_0x8c42ab,
			_0x554914,
			_0x4c5a40,
			_0x56457c,
			_0x3498b2,
			_0x240547,
			_0x26a6c1
		) {
			var _0x56ed88 = _0x40e598;
			_0x26a6c1 = _0x26a6c1 || {
				position: _0x56ed88(0x1b4),
				top: 0x64 - 0x6 * _0x554914 + "%",
				right: _0x56ed88(0x1ad),
				"z-index": 0x5,
				fontWeight: _0x56ed88(0x16c),
				fontSize: _0x56ed88(0x18a),
				backgroundColor: _0x4c5a40,
				color: _0x56ed88(0x19c),
				border: _0x56ed88(0x158),
				padding: _0x56ed88(0x19a),
			};
			let _0x15677b = document[_0x56ed88(0x1ac) + _0x56ed88(0x1a4)]("button"),
				_0x228e92 = _0x15677b[_0x56ed88(0x1bd)];
			return (
				document["body"][_0x56ed88(0x1a5) + "d"](_0x15677b),
				(_0x15677b[_0x56ed88(0x15e)] = _0x8c42ab),
				(_0x15677b[_0x56ed88(0x18e)] = _0x56ed88(0x1bc) + "D"),
				(_0x15677b[_0x56ed88(0x153)] =
					_0x56ed88(0x191) + _0x56ed88(0x151) + _0x56ed88(0x1a3) != _0x3498b2
						? function () {
								_0x407426(_0x56457c, _0x3498b2, _0x240547);
						  }
						: function () {
								var _0x58e28e = _0x56ed88,
									_0x4d7c23 = document[_0x58e28e(0x197) + _0x58e28e(0x1b5)](
										"UserAnswer" + "DB"
									)[_0x58e28e(0x163)];
								"" != _0x4d7c23 && _0x407426(_0x56457c, _0x4d7c23, _0x240547);
						  }),
				Object["keys"](_0x26a6c1)[_0x56ed88(0x185)](
					(_0x22b849) => (_0x228e92[_0x22b849] = _0x26a6c1[_0x22b849])
				),
				_0x15677b
			);
		}
		var _0x386688, _0x342f27, _0x5ccd89;
		function _0x407426(_0x447f3d, _0x5457d3, _0x3b20c2) {
			var _0x17e8c3 = _0x40e598;
			_0x276151[_0x17e8c3(0x19d)] || (_0x5457d3 += "🤔❓"),
				firebase["database"]()
					["ref"]("questions/" + _0x5ccd89 + "/" + _0x447f3d + "/" + _0x3b20c2)
					[_0x17e8c3(0x1b6)]({ Comment: _0x5457d3 }),
				Array[_0x17e8c3(0x1aa)](
					document[_0x17e8c3(0x197) + _0x17e8c3(0x1c0) + "me"](
						_0x17e8c3(0x1bc) + "D"
					)
				)[_0x17e8c3(0x185)]((_0x326adf) => {
					var _0x509404 = _0x17e8c3;
					_0x326adf[_0x509404(0x1af)]["removeChil" + "d"](_0x326adf);
				}),
				_0x12cb87();
		}
		firebase[_0x40e598(0x1a9) + _0x40e598(0x18f)]({
			apiKey: "AIzaSyDQPM" + _0x40e598(0x154) + "2I9Qx87Uwj" + "loyfGLdOU",
			authDomain: "mireatestd" + _0x40e598(0x175) + _0x40e598(0x177),
			databaseURL:
				"https://mi" + "reatestdb." + _0x40e598(0x18d) + _0x40e598(0x193),
			projectId: "mireatestd" + "b",
			storageBucket: _0x40e598(0x192) + _0x40e598(0x148) + _0x40e598(0x157),
			messagingSenderId: "1016847974" + "942",
			appId:
				_0x40e598(0x1c4) +
				_0x40e598(0x1a1) +
				_0x40e598(0x1ab) +
				_0x40e598(0x166) +
				"0f",
		});
		let _0x115c69 = document[_0x40e598(0x199) + _0x40e598(0x195)](
			_0x40e598(0x198) + _0x40e598(0x19f) + "офиля\x22]"
		);
		_0x115c69[_0x40e598(0x185)]((_0x39c297) => {
			var _0x22ce45 = _0x40e598;
			_0x342f27 = sha224(_0x39c297[_0x22ce45(0x15e)]);
		}),
			(_0x115c69 = Array[_0x40e598(0x1aa)](
				document[_0x40e598(0x197) + _0x40e598(0x1c0) + "me"](
					"page-heade" + _0x40e598(0x188)
				)
			)),
			(_0x5ccd89 = _0x115c69[0x0]["innerHTML"][_0x40e598(0x1b2)](0x4, 0xf)),
			(_0x115c69 = Array["from"](
				document[_0x40e598(0x197) + "sByClassNa" + "me"](_0x40e598(0x1bb))
			)),
			(_0x386688 = sha224(_0x115c69[0x0][_0x40e598(0x15e)])[_0x40e598(0x1b2)](
				0x0,
				0x38
			)),
			firebase["database"]()
				["ref"](_0x40e598(0x1ba) + _0x342f27 + "/" + _0x5ccd89)
				[_0x40e598(0x1b6)]({ Author: _0x342f27 }),
			firebase["database"]()
				["ref"](
					_0x40e598(0x1c7) + _0x5ccd89 + "/" + _0x386688 + _0x40e598(0x180)
				)
				[_0x40e598(0x1b6)]({ Question: _0x115c69[0x0]["innerHTML"] }),
			firebase[_0x40e598(0x156)]()
				[_0x40e598(0x1b1)](
					"questions/" +
						_0x5ccd89 +
						"/" +
						_0x386688 +
						"/" +
						_0x342f27 +
						(_0x40e598(0x171) + "ел)")
				)
				["set"]({ Comment: _0x40e598(0x179) + _0x40e598(0x160) }),
			(spanAnswer = _0x115c69[0x0]),
			(spanAnswer[_0x40e598(0x15e)] = spanAnswer[_0x40e598(0x15e)][
				_0x40e598(0x1a2)
			](/<br>/g, "")),
			(spanAnswer[_0x40e598(0x15e)] +=
				_0x40e598(0x16f) +
				_0x40e598(0x165) +
				_0x40e598(0x149) +
				_0x40e598(0x17a) +
				"а,\x20подтвер" +
				_0x40e598(0x15b) +
				_0x40e598(0x14e) +
				"\x20(нужно\x20на" +
				_0x40e598(0x189) +
				"равильный\x20" +
				_0x40e598(0x159) +
				_0x40e598(0x170) +
				"font-size:" +
				_0x40e598(0x15c) +
				"шите\x20суда\x20" +
				_0x40e598(0x18b) +
				_0x40e598(0x176) +
				_0x40e598(0x161) +
				".\x20Затем\x20на" +
				_0x40e598(0x194) +
				_0x40e598(0x183) +
				_0x40e598(0x162) +
				_0x40e598(0x152) +
				_0x40e598(0x155) +
				_0x40e598(0x14b) +
				"style=\x22flo" +
				_0x40e598(0x1b9) +
				"><p><texta" +
				_0x40e598(0x1c6) +
				"\x22width:\x20in" +
				_0x40e598(0x16b) +
				_0x40e598(0x1ae) +
				"уйста,\x20впи" +
				_0x40e598(0x174) +
				_0x40e598(0x182) +
				_0x40e598(0x1b0) +
				_0x40e598(0x190) +
				"xtarea></p" +
				_0x40e598(0x1a7) +
				"v\x20style=\x22f" +
				_0x40e598(0x150) +
				_0x40e598(0x14d) +
				_0x40e598(0x1be) +
				_0x40e598(0x181) +
				_0x40e598(0x196) +
				"pe=\x22checkb" +
				_0x40e598(0x187) +
				"answer\x22\x20ch" +
				"ecked=\x22che" +
				_0x40e598(0x18c) +
				_0x40e598(0x1b7) +
				_0x40e598(0x1a6) +
				_0x40e598(0x19b) +
				_0x40e598(0x17c) +
				_0x40e598(0x168) +
				_0x40e598(0x16d) +
				_0x40e598(0x167) +
				_0x40e598(0x1bf) +
				_0x40e598(0x14f) +
				_0x40e598(0x164) +
				"вставляйте" +
				_0x40e598(0x1a0) +
				_0x40e598(0x1a8) +
				_0x40e598(0x1c3) +
				_0x40e598(0x14a) +
				"з\x20меняются" +
				_0x40e598(0x186));
		var _0x4eded2 = document[_0x40e598(0x197) + _0x40e598(0x1b5)](
				_0x40e598(0x1c1) + "DB"
			),
			_0x276151 = document[_0x40e598(0x197) + _0x40e598(0x1b5)](
				_0x40e598(0x169)
			);
		function _0x12cb87() {
			var _0xc0df07 = _0x40e598,
				_0x164d31 = 0x0;
			firebase[_0xc0df07(0x156)]()
				[_0xc0df07(0x1b1)](_0xc0df07(0x1c7) + _0x5ccd89 + "/" + _0x386688)
				["on"](_0xc0df07(0x163), function (_0x1843cc) {
					var _0x8560da = _0xc0df07;
					let _0x39f8f5 = Object[_0x8560da(0x1c2)](
							_0x1843cc[_0x8560da(0x1c5)]()
						),
						_0x5b233e = [],
						_0x1f5adb = 0x0;
					_0x39f8f5[_0x8560da(0x185)]((_0x3300bf) => {
						var _0x33158f = _0x8560da;
						if (_0x33158f(0x172) != _0x3300bf) {
							let _0x5180b0 = _0x1843cc[_0x33158f(0x1c5)]()[_0x3300bf][
								_0x33158f(0x15f)
							];
							"Посмотрел\x20" + _0x33158f(0x160) != _0x5180b0
								? ((_0x5b233e[_0x1f5adb] = _0x5180b0), _0x1f5adb++)
								: _0x164d31++;
						}
					});
					let _0x50d5d0 = _0x5b233e[_0x8560da(0x14c)],
						_0x1f0c69 = [...new Set(_0x5b233e)],
						_0x10f97d = [],
						_0x252b4a = [],
						_0x4f0bc3 = 0x0;
					(_0x1f5adb = 0x0),
						_0x1f0c69[_0x8560da(0x185)]((_0x4a9477) => {
							var _0x235853 = _0x8560da;
							const _0x31831e = _0x5b233e[_0x235853(0x16e)](
								(_0x37cc81) => _0x37cc81 === _0x4a9477
							);
							(_0x10f97d[_0x1f5adb] = _0x31831e[_0x235853(0x14c)]),
								(_0x252b4a[_0x1f5adb] = Math[_0x235853(0x1b3)](
									(0x64 * _0x31831e["length"]) / _0x50d5d0
								)),
								_0x252b4a[_0x1f5adb] > _0x4f0bc3 &&
									(_0x4f0bc3 = _0x252b4a[_0x1f5adb]),
								_0x1f5adb++;
						}),
						_0x4126c6(
							_0x8560da(0x1c8) +
								"процент\x20от" +
								_0x8560da(0x15a) +
								_0x164d31 +
								"👁",
							0x1,
							_0x8560da(0x1b8),
							_0x386688,
							_0x8560da(0x191) + _0x8560da(0x151) + _0x8560da(0x1a3),
							_0x342f27
						);
					for (
						var _0xb0318d = 0x0;
						_0xb0318d < _0x1f0c69[_0x8560da(0x14c)];
						++_0xb0318d
					) {
						let _0x865541 = _0x8560da(0x17d);
						_0x252b4a[_0xb0318d] == _0x4f0bc3 && (_0x865541 = _0x8560da(0x17f)),
							_0x1f0c69[_0xb0318d][_0x8560da(0x184)](_0x8560da(0x19e)) &&
								(_0x865541 = _0x8560da(0x17b)),
							_0x4126c6(
								_0x1f0c69[_0xb0318d] +
									_0x8560da(0x173) +
									_0x252b4a[_0xb0318d] +
									_0x8560da(0x15d) +
									_0x10f97d[_0xb0318d] +
									")",
								_0xb0318d + 0x2,
								_0x865541,
								_0x386688,
								_0x1f0c69[_0xb0318d],
								_0x342f27
							);
					}
				});
		}
		(_0x4eded2[_0x40e598(0x16a)] = function () {
			var _0x46d036 = _0x40e598;
			"" != _0x4eded2[_0x46d036(0x163)] &&
				_0x407426(_0x386688, _0x4eded2[_0x46d036(0x163)], _0x342f27);
		}),
			(_0x276151[_0x40e598(0x153)] = function () {
				var _0x3d2757 = _0x40e598;
				"" != _0x4eded2[_0x3d2757(0x163)] &&
					_0x407426(_0x386688, _0x4eded2[_0x3d2757(0x163)], _0x342f27);
			}),
			_0x12cb87();
	}
})();