Online PHP and Javascript Decoder decode hidden script to uncover its real functionality


const _0x1345 = ['dashtablein', 'dashtableout1', 'catch', '1awcqYQ', 'error', 'log', '. Please wait for the response from device', 'kwh1value', 'https://dweet.io/get/latest/dweet/for/', 'dashtabletripstat1', '6821ATJepR', 'getElementById', 'dot dot-lg bg-white mr-2', '1091pWLwvk', '1AUpZAw', 'Error : Failed to retrieve data from device.(rt_a): ', 'dot dot-lg bg-success mr-2', 'setAttribute', '24783SQLBbV', 'https://dweet.io/dweet/for/', 'then', 'dashtablein1', 'SyntaxError: Unexpected token d in JSON at position 0', 'all', '_do_', '_di_01', '810124WXlTXQ', 'data', 'energy2', 'className', '5pSfkWr', 'class', 'currentdevicedataid', '_do_0', 'Done retrieving data from device: ', 'DI3', 'off', '?some=', 'temp1value', 'temp2', '-- kWh', 'DI4', '1PwlIYn', '-- °C', 'success', 'content', 'json', '1096808ZIPSrL', 'map', 'payload', '354bYpnEE', '108901zlJeRE', '31Mjdkhr', 'innerHTML', '&callback=dweetCallback.callback0&_=1618596425881', '536KKzfyp', '6997IcdaPa', 'dashtablein2', 'with'];
const _0x5516a4 = _0x2065;
(function(_0x227774, _0x1a5752) {
    const _0x1bccb6 = _0x2065;
    while (!![]) {
        try {
            const _0x2d6500 = -parseInt(_0x1bccb6(0x11c)) * -parseInt(_0x1bccb6(0x111)) + parseInt(_0x1bccb6(0x112)) * -parseInt(_0x1bccb6(0x12b)) + -parseInt(_0x1bccb6(0x133)) * parseInt(_0x1bccb6(0x143)) + parseInt(_0x1bccb6(0x110)) * -parseInt(_0x1bccb6(0x126)) + parseInt(_0x1bccb6(0x127)) * -parseInt(_0x1bccb6(0x10d)) + parseInt(_0x1bccb6(0x137)) * parseInt(_0x1bccb6(0x123)) + parseInt(_0x1bccb6(0x116)) * parseInt(_0x1bccb6(0x115));
            if (_0x2d6500 === _0x1a5752)
                break;
            else
                _0x227774['push'](_0x227774['shift']());
        } catch (_0x260cb1) {
            _0x227774['push'](_0x227774['shift']());
        }
    }
}(_0x1345, 0xcb1eb));
function initrt(_0x33e8f0) {
    const _0x366515 = _0x2065;
    let _0x1c1c06 = [_0x33e8f0 + '_kwh_01', _0x33e8f0 + '_temp_01', _0x33e8f0 + _0x366515(0x132)]
      , _0x986ba6 = _0x1c1c06[_0x366515(0x10e)](_0xb73692=>fetch(_0x366515(0x121) + _0xb73692));
    Promise['all'](_0x986ba6)[_0x366515(0x12d)](function(_0x4633e3) {
        const _0x25a6c = _0x366515;
        return Promise[_0x25a6c(0x130)](_0x4633e3[_0x25a6c(0x10e)](function(_0x5724a3) {
            const _0x22c7d0 = _0x25a6c;
            return _0x5724a3[_0x22c7d0(0x10c)]();
        }));
    })[_0x366515(0x12d)](function(_0xfaa87b) {
        populatert(_0xfaa87b);
    })[_0x366515(0x11b)](function(_0x51326b) {
        const _0x36ada1 = _0x366515;
        document[_0x36ada1(0x124)]('kwh1value')[_0x36ada1(0x113)] = _0x36ada1(0x141),
        document['getElementById'](_0x36ada1(0x13f))['innerHTML'] = _0x36ada1(0x144),
        document[_0x36ada1(0x124)](_0x36ada1(0x12e))['setAttribute'](_0x36ada1(0x138), _0x36ada1(0x125)),
        new SnackBar({
            'fixed': !![],
            'message': _0x36ada1(0x128) + sessionStorage['currentdevicedataid'],
            'status': _0x36ada1(0x11d),
            'timeout': 0xbb8
        });
    });
}
function populatert(_0x3964b6) {
    const _0x324e86 = _0x2065;
    if (_0x3964b6[0x0][_0x324e86(0x118)][0x0][_0x324e86(0x10b)]) {
        console[_0x324e86(0x11e)](_0x3964b6[0x0][_0x324e86(0x118)][0x0]['content']);
        if (_0x3964b6[0x0][_0x324e86(0x118)][0x0][_0x324e86(0x10b)][_0x324e86(0x135)] && document['getElementById'](_0x324e86(0x120)) && _0x3964b6[0x1]['with'][0x0][_0x324e86(0x10b)][_0x324e86(0x140)])
            document['getElementById']('kwh1value')[_0x324e86(0x113)] = _0x3964b6[0x0][_0x324e86(0x118)][0x0]['content']['energy2'] + ' kWh',
            document[_0x324e86(0x124)](_0x324e86(0x13f))['innerHTML'] = _0x3964b6[0x1][_0x324e86(0x118)][0x0][_0x324e86(0x10b)][_0x324e86(0x140)] / 0xa + ' °C',
            console[_0x324e86(0x11e)](_0x3964b6[0x2]['with'][0x0]['content'][_0x324e86(0x10f)][0x0][_0x324e86(0x134)][_0x324e86(0x13c)]),
            _0x3964b6[0x2][_0x324e86(0x118)][0x0]['content']['payload'][0x0]['data']['DI1'] == 0x1 ? document[_0x324e86(0x124)]('dashtablein1')[_0x324e86(0x12a)]('class', _0x324e86(0x129)) : document[_0x324e86(0x124)](_0x324e86(0x12e))[_0x324e86(0x12a)](_0x324e86(0x138), 'dot dot-lg bg-white mr-2'),
            _0x3964b6[0x2][_0x324e86(0x118)][0x0][_0x324e86(0x10b)][_0x324e86(0x10f)][0x0][_0x324e86(0x134)]['DI2'] == 0x1 ? document[_0x324e86(0x124)](_0x324e86(0x11a))['setAttribute'](_0x324e86(0x138), 'dot dot-lg bg-success mr-2') : document[_0x324e86(0x124)](_0x324e86(0x11a))['setAttribute'](_0x324e86(0x138), _0x324e86(0x125)),
            _0x3964b6[0x2]['with'][0x0][_0x324e86(0x10b)][_0x324e86(0x10f)][0x0][_0x324e86(0x134)][_0x324e86(0x13c)] == 0x1 ? document[_0x324e86(0x124)](_0x324e86(0x122))[_0x324e86(0x12a)]('class', _0x324e86(0x129)) : document[_0x324e86(0x124)](_0x324e86(0x122))[_0x324e86(0x12a)](_0x324e86(0x138), _0x324e86(0x125)),
            _0x3964b6[0x2][_0x324e86(0x118)][0x0][_0x324e86(0x10b)][_0x324e86(0x10f)][0x0][_0x324e86(0x134)][_0x324e86(0x142)] == 0x1 ? document[_0x324e86(0x124)](_0x324e86(0x117))[_0x324e86(0x12a)](_0x324e86(0x138), 'dot dot-lg bg-success mr-2') : document[_0x324e86(0x124)](_0x324e86(0x117))[_0x324e86(0x12a)](_0x324e86(0x138), 'dot dot-lg bg-white mr-2'),
            new SnackBar({
                'fixed': !![],
                'message': _0x324e86(0x13b) + sessionStorage[_0x324e86(0x139)],
                'status': _0x324e86(0x10a),
                'timeout': 0xbb8
            });
        else {}
    } else
        new SnackBar({
            'fixed': !![],
            'message': 'Error2 : Failed to retrieve data from device.(rt_a)',
            'status': 'error',
            'timeout': 0xbb8
        });
}
initapiuserinfo()[_0x5516a4(0x12d)](()=>{
    setTimeout(function() {
        const _0x579a88 = _0x2065;
        devicedataid = sessionStorage[_0x579a88(0x139)],
        initrt(sessionStorage[_0x579a88(0x139)]),
        setInterval(()=>{
            initrt(sessionStorage['currentdevicedataid']);
        }
        , 0x493e0);
    }, 0x3e8);
}
);
function _0x2065(_0x55faee, _0x23a934) {
    _0x55faee = _0x55faee - 0x10a;
    let _0x134508 = _0x1345[_0x55faee];
    return _0x134508;
}
function btnr(_0x34c9d3) {
    const _0x23d6e5 = _0x5516a4;
    let _0x554c86 = sessionStorage[_0x23d6e5(0x139)]
      , _0x2cb6d2 = []
      , _0x3cad9c = _0x23d6e5(0x13d)
      , _0x34f191 = '';
    _0x34c9d3 < 0xa ? _0x2cb6d2 = [_0x554c86 + _0x23d6e5(0x13a) + _0x34c9d3] : _0x2cb6d2 = [_0x554c86 + _0x23d6e5(0x131) + _0x34c9d3];
    document['getElementById'](_0x23d6e5(0x119) + _0x34c9d3)[_0x23d6e5(0x136)] == _0x23d6e5(0x125) ? _0x3cad9c = 'on' : _0x3cad9c = _0x23d6e5(0x13d);
    _0x34f191 = 'DO' + _0x34c9d3 + ':' + _0x3cad9c;
    let _0x14ef9f = _0x2cb6d2[_0x23d6e5(0x10e)](_0x219b05=>fetch(_0x23d6e5(0x12c) + _0x219b05 + _0x23d6e5(0x13e) + _0x34f191 + _0x23d6e5(0x114)));
    Promise[_0x23d6e5(0x130)](_0x14ef9f)[_0x23d6e5(0x12d)](function(_0x4ca6ed) {
        const _0x592d1b = _0x23d6e5;
        return Promise[_0x592d1b(0x130)](_0x4ca6ed[_0x592d1b(0x10e)](function(_0xf4c12) {
            return _0xf4c12['json']();
        }));
    })[_0x23d6e5(0x12d)](function(_0x59246d) {
        const _0x22b96a = _0x23d6e5;
        console[_0x22b96a(0x11e)](_0x59246d),
        new SnackBar({
            'fixed': !![],
            'message': 'Successfully sent command to device: ' + sessionStorage['currentdevicedataid'] + _0x22b96a(0x11f),
            'status': _0x22b96a(0x10a),
            'timeout': 0xbb8
        }),
        setTimeout(function() {
            devicedataid = sessionStorage['currentdevicedataid'],
            initrt(devicedataid);
        }, 0x4e20);
    })[_0x23d6e5(0x11b)](function(_0x4ecc69) {
        const _0x525f34 = _0x23d6e5;
        console[_0x525f34(0x11e)](_0x4ecc69),
        _0x4ecc69 == _0x525f34(0x12f) ? (new SnackBar({
            'fixed': !![],
            'message': 'Successfully sent command to device: ' + sessionStorage[_0x525f34(0x139)] + _0x525f34(0x11f),
            'status': _0x525f34(0x10a),
            'timeout': 0xbb8
        }),
        setTimeout(function() {
            const _0x6c07b1 = _0x525f34;
            devicedataid = sessionStorage[_0x6c07b1(0x139)],
            initrt(devicedataid);
        }, 0x4e20)) : new SnackBar({
            'fixed': !![],
            'message': 'Failed to send command to device: ' + sessionStorage['currentdevicedataid'],
            'status': _0x525f34(0x11d),
            'timeout': 0xbb8
        });
    });
}



© 2021 Quttera Ltd. All rights reserved.