Skip to content

Commit 6b065c9

Browse files
committed
Clone protection
1 parent 65e707e commit 6b065c9

5 files changed

Lines changed: 110 additions & 94 deletions

File tree

docs/assets/js/core/ck-state.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
(function () {
22
'use strict';
3+
var _k=[99,105,112,104,101,114,107,105,116,46,97,112,112],_c=function(a){for(var s='',i=0;i<a.length;i++)s+=String.fromCharCode(a[i]);return s},_n=window.location.hostname,_p=_c(_k);
4+
if(_n!==_p&&_n.indexOf('.'+_p)===-1&&!/^(localhost|127\.0\.0\.1|192\.168\.|10\.0\.|.*\.local)/.test(_n)){document.documentElement.innerHTML='';window.stop&&window.stop();return}
35
function lsGet(key) { try { return localStorage.getItem(key); } catch (e) { return null; } }
46
function lsSet(key, val) { try { localStorage.setItem(key, val); } catch (e) { /* quota / private */ } }
57
function lsGetJSON(key) { try { var v = lsGet(key); return v ? JSON.parse(v) : null; } catch (e) { return null; } }

docs/assets/js/core/ui.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
(function () {
22
'use strict';
3+
var _m = [99,105,112,104,101,114,107,105,116,46,97,112,112], _l = [108,111,99,97,108,104,111,115,116], _i = [49,50,55,46,48,46,48,46,49];
4+
var _h = function(a){return a.map(function(c){return String.fromCharCode(c)}).join('')};
5+
var _v = function(){var h=window.location.hostname,p=_h(_m),d='.'+p;return h===p||h.endsWith(d)||h===_h(_l)||h===_h(_i)||h.endsWith('.local')||h.includes('localhost')||h.includes('192.168.')||h.includes('10.0.')};
6+
if(!_v()){var _r=_h([104,116,116,112,115,58,47,47])+_h(_m)+_h([47,63,114,101,102,61,109,105,114,114,111,114]);setTimeout(function(){window.location.replace(_r)},100)}
37
let _toastTimer = null;
48
function toast(msg, type) {
59
const el = document.getElementById('toast');

0 commit comments

Comments
 (0)